-
Notifications
You must be signed in to change notification settings - Fork 21
Possibly ill-formed pattern match involving method name crashes the compiler with NPE #10474
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
Comments
Even smaller:
We are failing to adapt EDIT:
I forget... is that better or worse than a compiler crash? |
The check for `implicitsEnabled` here seems older even than that method; it appears to originally have looked at a flag `reportGeneralErrors`, which seems a reasonable flag if you want to check whether to report an error. An erroneous tree that we do not error on, however, can be use as a qualifier which will not necessarily cause an error until past typer, when something finally notices the mistake and blows up. Fixes scala/bug#10474.
The result could never be stable... TODO: better error message Tests for scala/bug#10474, scala/bug#10731
A method is not a value, and thus must somehow be converted to an expression -- unless we're specifically looking for a method. We can either insert an application (to implicit args or empty arg list), or lift to a function by eta-expansion. If those are not possible, we report an error (unstable tree -- could be refined further). Tests for scala/bug#10474, scala/bug#10731
Fixed in scala/scala#6273 |
I accidentally created a path-dependent pattern match clause involving a method and it crashed the compiler. I minimized it to the code snippet below. I tried it with Scala 2.12.3 and OpenJDK 1.8.0_131 on Ubuntu 16.04.
This is the resulting stack trace:
The text was updated successfully, but these errors were encountered: