New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-5993] Cannot subclass to a nested class ('Super' is not a member type of 'Baz'). #48550
Comments
Your playground has a whole bunch of different examples in it, and I can't reproduce the issue in isolation. Which ones are relevant? |
@belkadan The playground contains exactly two examples with the reproducible project structure, which I tried to describe above. There are two files which will trigger the issue, you can test them individually.
In each file it's only necessary to uncomment the last commented line to trigger the error. The error will be appear in a different place, on the line where the nested subclass is defined. |
@belkadan Here are two screenshots of both of the cases. |
Whoops, you did mention Bar.Sub1.swift and Bar.Sub2.swift. My bad for jumping to the attachment. |
Yeah, I think this is another SR-631, then. |
Re-opening this because the interaction between extension binding and subclassing is a bit more subtle than just SR-631. |
The example here is fixed by #18364 |
@DougGregor I assume the comment is the same as on twitter recently. This fix won't land in Swift 4.2? |
That's correct. This will not go into Swift 4.2. |
@DougGregor Any chance this might go into Swift 4.x (4.3) a couple of month later, or is it something for a major release like Swift 5? |
It will have to wait for a major release. This bug fix is a consequence of some significant architectural changes that don't fit into a dot release. |
Okay thank you for confirming it. |
Attachment: Download
Environment
Xcode Version 9.0 (9A235), Swift 4
Additional Detail from JIRA
md5: 8d6c77fe197d852dcf28d4056069c764
duplicates:
relates to:
Issue Description:
A class that is nested inside a different type through extensions from a different file cannot be subclassed as another nested sub-class in yet another different file. `typealias` cannot be used as a workaround.
See `Bar.Sub1` and `Bar.Sub2` in the attached playground.
This might be related to: https://bugs.swift.org/browse/SR-631
The text was updated successfully, but these errors were encountered: