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
Compiler AssertionError during refchecks involving block expression and unapplied method conversion #9745
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9745?orig=1 |
@liff said: object T9745 {
var i = 0
def f(i: Unit)(j: Int): Int = ???
val g = x => f(i += 1)(x)
} From what I could understand, the problem is that the typer, when typing the function value in
where the assignment transformation from the first argument list gets discarded but the error remains in the tree which causes the assignment transformation not to be applied again when doing typing with the second parameter list included. |
@liff said: |
@som-snytt said: |
Here's a slight alteration to the slightly altered test case, from the forum.
A slightly different look with members:
|
Do more for typedFunction of eta-expanded method: keep typed method selection (fix scala/bug#9745, follow up for scala#6007) Test case taken from original PR. Backported from 64d4c24
Do more for typedFunction of eta-expanded method: keep typed method selection (fix scala/bug#9745, follow up for scala#6007) Test case taken from original PR. Backported from 64d4c24
This works:
This crashes the compiler:
This affects both 2.12.0-M4 and 2.11.8.
The following fails with a Bad superClass error in 2.12.0-M4 and with a NullPointerException in 2.11.8:
The text was updated successfully, but these errors were encountered: