Skip to content

var of type Unit causes AssertionError #5036

Closed
@sir-wabbit

Description

@sir-wabbit
class i0(var i1:Unit)

without -Ycheck:all

Concrete method has no definition: DefDef(i1_=,List(),List(List(ValDef(x$1,TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class runtime)),class BoxedUnit)],EmptyTree))),TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Unit)],EmptyTree)
one error found

with -Ycheck:all

checking AE-23b20eba14de058f02b69cb1093063fe12b639fb.scala after phase MegaPhase{elimErasedValueType, vcElideAllocations, mixin, lazyVals, memoize, nonLocalReturns, capturedVars}
exception while typing @scala.annotation.internal.SourceFile(
  "AE-23b20eba14de058f02b69cb1093063fe12b639fb.scala"
) class i0(i1: scala.runtime.BoxedUnit) extends Object { 
  super()
  private var i1: scala.runtime.BoxedUnit
  <accessor> def i1(): scala.runtime.BoxedUnit = scala.runtime.BoxedUnit#UNIT
  <accessor> def i1_=(x$1: scala.runtime.BoxedUnit): Unit
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 681
exception while typing package <empty> {
  @scala.annotation.internal.SourceFile(
    "AE-23b20eba14de058f02b69cb1093063fe12b639fb.scala"
  ) class i0(i1: scala.runtime.BoxedUnit) extends Object { 
    super()
    private var i1: scala.runtime.BoxedUnit
    <accessor> def i1(): scala.runtime.BoxedUnit = scala.runtime.BoxedUnit#UNIT
    <accessor> def i1_=(x$1: scala.runtime.BoxedUnit): Unit
  }
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 871
*** error while checking AE-23b20eba14de058f02b69cb1093063fe12b639fb.scala after phase capturedVars ***
exception occurred while compiling AE-23b20eba14de058f02b69cb1093063fe12b639fb.scala
Exception in thread "main" java.lang.AssertionError: Non-deferred definition introduced by <no phase> lacks implementation: <accessor> def i1_=(x$1: scala.runtime.BoxedUnit): Unit
	at dotty.tools.dotc.transform.Memoize.errorLackImplementation$1(Memoize.scala:51)
	at dotty.tools.dotc.transform.Memoize.checkPostCondition(Memoize.scala:58)
	at dotty.tools.dotc.transform.TreeChecker.dotty$tools$dotc$transform$TreeChecker$Checker$$_$typedUnadapted$$anonfun$1(TreeChecker.scala:299)
	at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
	at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:299)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1900)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1912)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:270)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1931)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1965)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:446)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1565)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedClassDef(TreeChecker.scala:399)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1809)

AE-23b20eba14de058f02b69cb1093063fe12b639fb

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions