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
Given the following class definitions in which two final classes with the same name are declared inside different structs but both inherit from a base class:
openclassBase { ... }
publicstructStructA {
finalpublicclassHomonym: Base { ... }
}
publicstructStructB {
finalpublicclassHomonym: Base { ... }
}
When i declare the following extension in a separate project that links with said framework:
and then i use the convenience init to initialize a StructA.Homonym:
lethomonym = StructA.Homonym()
the compiler erroneously creates an object of type StructB.Homonym!
(lldb) po type(of: homonym)
Homonyms.StructB.Homonym
hence the extension seems to be applied to StructB.Homonym instead of StructA.Homonym.
Please run the attached workspace to see the strange behaviour.
Please note that this seems to happen only if the class hierarchy is declared in a separate framework: this behaviour does not seem to be reproducible inside a playground. If the classes are not declared as final, the application behaves as expected. If the extension is declared (as public) inside the framework, the application behaves as expected.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
Xcode 10.2.1 (10E1001)
Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Additional Detail from JIRA
md5: 7cb164b590d6e8801052dedae5b2f66c
Issue Description:
Given the following class definitions in which two final classes with the same name are declared inside different structs but both inherit from a base class:
When i declare the following extension in a separate project that links with said framework:
and then i use the convenience init to initialize a StructA.Homonym:
the compiler erroneously creates an object of type StructB.Homonym!
hence the extension seems to be applied to
StructB.Homonym
instead ofStructA.Homonym
.Please run the attached workspace to see the strange behaviour.
Please note that this seems to happen only if the class hierarchy is declared in a separate framework: this behaviour does not seem to be reproducible inside a playground. If the classes are not declared as final, the application behaves as expected. If the extension is declared (as public) inside the framework, the application behaves as expected.
The text was updated successfully, but these errors were encountered: