You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-10285 Subclass of a class that conforms to a protocol and extends NSObject is not instantiate correctly
Issue Description:
This is seemingly fixed in Xcode 11, but in case y'all weren't aware of it here's a repro case.
Because I hope that this will be closed as a dupe, I haven't done a lot of work to narrow down the root cause, so the sample project might be a little bloated: the code is spread out into three modules, as it is in our real project.
The TL:DR is that it seems as though if you subclass a type that conforms to `MyProtocol` in your module, then pass your type metadata into a function `create(_ type: MyProtocol.Type) -> MyProtocol`, you'll get instances of your superclass, rather than instances of the type you actually passed in.
The text was updated successfully, but these errors were encountered:
We do have this one, but it's good to have confirmation that it's fixed. Thank you for taking the time to file it! If we didn't have a test case for it, it would be a great thing to add.
Attachment: Download
Environment
Xcode 10.2.1, Swift 5 compiler.
Does not reproduce in Xcode 11.
Additional Detail from JIRA
md5: a927639914e0575f63fb5106e5ea51d3
duplicates:
Issue Description:
This is seemingly fixed in Xcode 11, but in case y'all weren't aware of it here's a repro case.
Because I hope that this will be closed as a dupe, I haven't done a lot of work to narrow down the root cause, so the sample project might be a little bloated: the code is spread out into three modules, as it is in our real project.
The TL:DR is that it seems as though if you subclass a type that conforms to `MyProtocol` in your module, then pass your type metadata into a function `create(_ type: MyProtocol.Type) -> MyProtocol`, you'll get instances of your superclass, rather than instances of the type you actually passed in.
The text was updated successfully, but these errors were encountered: