[swift-dev] Was SE-0057 fully implemented in Swift 3?

Ben Pious benpious at uber.com
Wed Jul 12 16:24:21 CDT 2017


Hello all,

SE-0057 <https://github.com/apple/swift-evolution/blob/master/proposals/0057-importing-objc-generics.md> describes a method for bridging generics in to Objective-C which opt into type discovery by implementing -classForGenericArgumentAtIndex or +classForGenericArgumentAtIndex, and gives a number of examples using GameKit. However, the examples in SE-0057 don’t actually work in Swift 3. I can’t get the examples to work with the GameKit classes (which actually do implement those two methods in the iOS 10 SDK) or with my own Objective-C classes; they both fail with “Extension of a generic Objective-C class cannot access the class’s generic parameters at runtime.” 

I searched the Swift bug tracker, and didn’t find anything about it. Will this feature be added in a future version of Swift? 

Ben Pious
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170712/bb78f796/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2494 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170712/bb78f796/attachment.p7s>


More information about the swift-dev mailing list