Skip to content

Internal error: closing over non-method (parser stability) #9292

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
sir-wabbit opened this issue Jul 6, 2020 · 0 comments · Fixed by #10007
Closed

Internal error: closing over non-method (parser stability) #9292

sir-wabbit opened this issue Jul 6, 2020 · 0 comments · Fixed by #10007

Comments

@sir-wabbit
Copy link

Minimized code

// E-68737bd09b469bddc6c978e79bc741721ae24085
trait I0[-I1] {
def [@specialized(List[I2], i3
val
def i3(i4: Int }

Output (click arrow to expand)

-- [E040] Syntax Error: test.scala:3:0 -----------------------------------------
3 |val
  |^^^
  |')' expected, but 'val' found
-- [E040] Syntax Error: test.scala:4:0 -----------------------------------------
4 |def i3(i4: Int }
  |^^^
  |';' expected, but 'def' found
-- [E040] Syntax Error: test.scala:4:15 ----------------------------------------
4 |def i3(i4: Int }
  |               ^
  |               ')' expected, but '}' found
exception occurred while typechecking test.scala
exception occurred while compiling test.scala
java.lang.Error: internal error: closing over non-method <overloaded I0.this.$anonfun>, pos = <46..46> while compiling test.scala
Exception in thread "main" java.lang.Error: internal error: closing over non-method <overloaded I0.this.$anonfun>, pos = <46..46>
	at dotty.tools.dotc.typer.Typer.typedClosure(Typer.scala:1233)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2387)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2436)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2502)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2511)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2514)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2625)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:858)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2384)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2436)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2502)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2511)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2514)
	at dotty.tools.dotc.typer.Typer.typedFunctionValue(Typer.scala:1189)
	at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:971)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2386)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2436)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2502)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2511)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2514)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsUnappliedMethod$2(Typer.scala:3130)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants