-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Union of three exceptions in throws clause does not compile #18168
Comments
I looked into this issue a bit and it seems to have different causes on the
|
Great analysis! |
I noted that this works now after the isFunctionType refactoring. I added the test to tests/pos/i13816.scala, where it was disabled before. |
Compiler version
3.3.1
Minimized example
Output
Expectation
Should compile. There's a dubious capture set with three members in the error message:
{x$0², evidence$1, x$0}
. I guess the two x$0 should map to the same reference.The $throws clause expands to roughly the code in the second
foo
method. The main difference is that$throws
clauses generate context functions. But we cannot write dependent context functions as a result type, that hits an implementation restriction. I therefore wrote them as normal functions, with embedded given clauses. But that change makes the error go away.The text was updated successfully, but these errors were encountered: