Skip to content

var of type Unit causes AssertionError #5036

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 Aug 26, 2018 · 1 comment
Closed

var of type Unit causes AssertionError #5036

sir-wabbit opened this issue Aug 26, 2018 · 1 comment

Comments

@sir-wabbit
Copy link

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

@nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki self-assigned this Feb 5, 2019
OlivierBlanvillain added a commit that referenced this issue Feb 6, 2019
Fix #5036: Add missing implementation for setters of Unit
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