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-6100] Compilation hangs when catching error with associated value defined inside generic class/struct #48655
Comments
The workaround could be specifying the generic value when catching the error, no matter what, it should just satisfy generic constraints (if any). do {}
catch One<Error>.E.SomeError(let error) {} So now I understand the problem. In my actual case I use the class generic as the associated value in error enum, and that said I must specify the type when referring to the error in catch. But in my sample code above the generic is referenced only once, and error enum case associated type is concrete, so I think in this case the generic reference could be omitted. Otherwise compile error should be triggered. |
Crashes with assertions:
@swift-ci create |
You do need to provide the generic parameter, since |
Even when nested structure/entity/class is there just in namespacing purposes and totally unrelated to generic? |
The compiler can't know whether it's unrelated or not. Or rather, it could, but then that decision could change on the fly if you start using the generic parameter inside a function body, and that would be a really weird way to break something you might be relying on. |
Environment
Xcode 9A235 with up-to-date toolchain, Swift 4, also can be reproduced with 9.1 beta.
Additional Detail from JIRA
md5: 2afa1ba8acb94b57563aca83911d1edf
Issue Description:
It just freezes at 100% CPU and nothing happens.
The text was updated successfully, but these errors were encountered: