Skip to content

Using empty refinement "{}" as a type by itself crashes in assertPositioned #1867

Closed
@helloqirun

Description

@helloqirun

scalac compiles but dotc crashes.

$ cat abc.scala

trait B {
  def f1: {}
}

$ dotc abc.scala

exception occurred while typechecking abc.scala

exception occurred while compiling abc.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: position not set for TypeDef(<refinement>,Template(DefDef(<init>,List(),List(),TypeTree,EmptyTree),List(TypedSplice(TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,lang)),Object)])),ValDef(_,EmptyTree,EmptyTree),List())) # 59
	at scala.Predef$.assert(Predef.scala:165)
	at dotty.tools.dotc.typer.Typer$.assertPositioned(Typer.scala:59)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1552)
	at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
	at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
	at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
<...>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions