Improving mapping of generic types #316
Labels
A-framework
Affects the framework crates and the translator for them
enhancement
New feature or request
Milestone
Currently, we're mapping generic types roughly as:
But this can be a bit limiting, since there's no easy way to carry any lifetime information in the type. Also, it is IMO a bit confusing to see
Id<NSArray<NSObject, Shared>, Shared>
, and this only gets worse on types with multiple generics (likeNSDictionary
).So perhaps we could instead introduce a helper trait and do it like this:
Where usage would then be
Id<NSArray<&NSObject>, Shared>
orId<NSArray<Id<NSObject, Shared>>, Shared>
.This will also help with #304, since
-[NSEnumerator nextObject]
by itself could now be safe by default (though-[NSArray objectEnumerator]
would still beunsafe
).The text was updated successfully, but these errors were encountered: