-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add safe upcasting #518
Comments
The trait |
Also valuable from |
Tried implementing Perhaps an inherent method on |
Some sort of extern_category!(
unsafe trait MyCategory { ... }
unsafe impl<T: SubclassOf<MyType>> MyCategory for T {}
); Which would make it such that all subclasses of a given type |
Would also like to figure out how |
The I believe this is nicer than a generic
|
We already have the ability to convert from
NSView
to its superclassesNSResponder
usingDeref
,ClassType::as_super
orId::into_super
. In general, we should maybe consider anUpCast
trait of some sort, to be able to do this fully generically? Even better if it could integrate with aFrom
implementation forId
.See also the inverse of this in #474.
The text was updated successfully, but these errors were encountered: