-
Notifications
You must be signed in to change notification settings - Fork 21
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
AssertionError
on anonymous class with refinement type and missing type parameters
#11337
Comments
someone want to check if this 1) should remain open and 2) isn't a duplicate? |
tree.tpe = <error>{}
tree.tpe.isErroneous = false 🤔 |
Dotty:
|
But dotty doesn't issue an error about new Foo { def baz(): Any = () } desugars to something like: {
class anon$1 extends Foo { // here dotty infers Nothing but scalac doesn't try to
def baz(): Any = ()
}
new anon$1
} Instead However |
I believe we should not try so hard to construct a meaningful type mismatch error for an anonymous class with erroneous definition. |
PR here scala/scala#7635 |
The following combination causes a compiler crash in typer with Scala 2.12.1:
I think the correct behavior should be to just output the error regarding the missing parameters on
new Foo
, and give up. Full output is here: error.txt.The crash also appears with 2.12.0, but not 2.11.8.
The text was updated successfully, but these errors were encountered: