Skip to content

crash with "java.lang.IllegalArgumentException: requirement failed" #1647

Closed
@helloqirun

Description

@helloqirun

$ cat abc.scala

class ann {
  @ann({ def baz })
  def foo()
}

$ dotc abc.scala

-- [E018] Syntax Error: abc.scala --------------------------------------------------------------------------------------
3 |  @ann({ def baz })
  |                ^
  |                missing return type

longer explanation available when compiling with `-explain`
-- [E018] Syntax Error: abc.scala --------------------------------------------------------------------------------------
4 |  def foo()
  |           ^
  |           missing return type

longer explanation available when compiling with `-explain`

exception occurred while typechecking abc.scala

exception occurred while compiling abc.scala
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed
	at scala.Predef$.require(Predef.scala:207)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.enterNoReplace(SymDenotations.scala:1548)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.enter(SymDenotations.scala:1538)
	at dotty.tools.dotc.typer.NamerContextOps$class.enter(Namer.scala:34)
	at dotty.tools.dotc.core.Contexts$Context.enter(Contexts.scala:57)
	at dotty.tools.dotc.typer.Namer.enterSymbol(Namer.scala:334)
	at dotty.tools.dotc.typer.Namer.dotty$tools$dotc$typer$Namer$$recur$1(Namer.scala:417)
	at dotty.tools.dotc.typer.Namer.indexExpanded(Namer.scala:427)
<snipped>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions