Skip to content

Unbound wildcards cause assertion error/oom #1443

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

Closed
cswinter opened this issue Aug 8, 2016 · 1 comment
Closed

Unbound wildcards cause assertion error/oom #1443

cswinter opened this issue Aug 8, 2016 · 1 comment

Comments

@cswinter
Copy link
Contributor

cswinter commented Aug 8, 2016

E.g. val a: _ = ??? causes compiler hang/OOM and val a: List[_ <: _] = List(0) crashes with a failed assertion in typer. Some more details on why this happens can be found in this comment. This can only be replicated with dotc; REPL aborts compilation as soon as the frontend emits an "unbound wildcard type" error.

Further examples can be found in tests/pending/neg/unboundWildcard.scala, which should be moved to tests/neg once this issues has been resolved.

@odersky
Copy link
Contributor

odersky commented Aug 8, 2016

I think this has an easy fix: When the parser reports an unbound wildcard error for a type, it should return Any as the tree instead of the TypeBounds tree that it saw originally. No need to worry about follow-on errors: the reporter will suppress subsequent errors on the same position anyway.

cswinter added a commit to cswinter/dotty that referenced this issue Aug 12, 2016
cswinter added a commit to cswinter/dotty that referenced this issue Aug 12, 2016
cswinter added a commit to cswinter/dotty that referenced this issue Aug 12, 2016
smarter added a commit that referenced this issue Aug 15, 2016
Fix #1443: Replace toplevel TypeBounds with Any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants