-
-
Notifications
You must be signed in to change notification settings - Fork 76
Upcasting generic collections #654
Copy link
Copy link
Open
Labels
A-frameworkAffects the framework crates and the translator for themAffects the framework crates and the translator for themenhancementNew feature or requestNew feature or request
Milestone
Description
Metadata
Metadata
Assignees
Labels
A-frameworkAffects the framework crates and the translator for themAffects the framework crates and the translator for themenhancementNew feature or requestNew feature or request
It'd be nice to have conversions to superclasses in collection types that use lightweight generics, i.e. some way to turn
NSArray<NSView>intoNSArray<NSResponder>, or evenNSArray<NSObject>.Note that this is only valid for
__covariantimmutable generic types, e.g.NSArray, but notNSMutableArray(see also this video from WWDC2015, timestamp around 23:40).Related to #518 and might require a trait like in #271.
Also desirable: Some unsafe way to cast only the generics, e.g.
NSArray<T>::cast_objects_unchecked<U>(self) -> NSArray<U>.