-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Currently, when accessing instance variables or calling methods the user must verify that the types actually match what Objective-C expects; this is cumbersome, although it can be somewhat alleviated using the "verify_message"
feature.
But what if we were to enable "verify_message"
always (or at least with debug_assertions
)? Could we change Encode
somehow to allow msg_send!
to become much safer? Or maybe it would be possible to add a safe variant (msg_send!
vs. msg_send_unchecked!
) that allows a subset of functionality?
An example: Disallow Encode
on types like NonNull<T>
and &T
because their validity cannot be verified using Objective-C encodings (because Rust has a more expressive type-system than C). Or at least disallow them on the return type.