Skip to content

java.lang.AssertionError: NoDenotation.owner while compiling .... #15897

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
OndrejSpanel opened this issue Aug 24, 2022 · 1 comment · Fixed by #15963
Closed

java.lang.AssertionError: NoDenotation.owner while compiling .... #15897

OndrejSpanel opened this issue Aug 24, 2022 · 1 comment · Fixed by #15963

Comments

@OndrejSpanel
Copy link
Member

OndrejSpanel commented Aug 24, 2022

Compiler version

3.2.0-RC1

Minimized code

object O {
  class AC(code: => Unit)

  val action = new AC({mode = ???}) {}

  def mode: AnyRef = ???
  def mode=(em: AnyRef): Unit = {}
}

Output

java.lang.AssertionError: NoDenotation.owner while compiling src/main/scala/main.scala

See also Scastie repro https://scastie.scala-lang.org/pMVjCO6zS9uAM2CugmFbGg

@OndrejSpanel OndrejSpanel added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Aug 24, 2022
@Kordyjan Kordyjan added area:typer and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Aug 24, 2022
@Kordyjan
Copy link
Contributor

Kordyjan commented Aug 24, 2022

The top of the stack trace after an attempt to compile the snippet with current nightly:

Expand

java.lang.AssertionError: NoDenotation.owner
Error compiling project (Scala 3.2.1-RC1-bin-20220823-3ad97df-NIGHTLY, JVM)
	at dotty.tools.dotc.core.SymDenotations$NoDenotation$.owner(SymDenotations.scala:2501)
	at dotty.tools.dotc.typer.Typer.canAssign$1(Typer.scala:990)
	at dotty.tools.dotc.typer.Typer.typedAssign(Typer.scala:1027)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2922)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2978)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3045)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3049)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3165)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1064)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2923)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2978)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.$anonfun$7(ProtoTypes.scala:483)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:406)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:484)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:866)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:866)
	at dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:557)
	at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:622)
	at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:460)
	at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:748)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:865)
	at dotty.tools.dotc.typer.Applications.ApplyTo(Applications.scala:1077)
	at dotty.tools.dotc.typer.Applications.ApplyTo$(Applications.scala:327)
	at dotty.tools.dotc.typer.Typer.ApplyTo(Typer.scala:119)
	at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:923)
	at dotty.tools.dotc.typer.Applications.realApply$1$$anonfun$3(Applications.scala:1003)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:3189)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:1014)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1052)
	at dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:327)
	at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:119)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2915)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2978)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3045)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3049)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3165)
	at dotty.tools.dotc.typer.Typer.typedParent$1(Typer.scala:2466)
	at dotty.tools.dotc.typer.Typer.$anonfun$52(Typer.scala:2541)
	at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:87)
	at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:103)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2541)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:2903)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2907)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2977)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3045)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3049)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3071)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3121)
	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1058)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1062)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2923)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2978)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3045)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3049)
	at dotty.tools.dotc.typer.Typer.typedNew(Typer.scala:809)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2919)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2978)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3045)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3049)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3165)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1619)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1609)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1619)
	at dotty.tools.dotc.typer.Namer.typedAheadRhs$1$$anonfun$1(Namer.scala:1867)
	at dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:249)
	at dotty.tools.dotc.typer.Namer.typedAheadRhs$1(Namer.scala:1867)
	at dotty.tools.dotc.typer.Namer.rhsType$1(Namer.scala:1875)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1893)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1894)
	at dotty.tools.dotc.typer.Namer.inferredResultType(Namer.scala:1905)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1658)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1665)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:783)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:922)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:810)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:171)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:187)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:189)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:373)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2856)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2881)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2977)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3045)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3049)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3071)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3121)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2554)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:2903)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2907)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2977)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3045)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3049)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3071)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3121)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2685)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2948)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2978)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3045)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3049)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3165)
	at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:44)
	at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$adapted$1(TyperPhase.scala:54)
	at scala.Function0.apply$mcV$sp(Function0.scala:39)
	at dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:420)
	at dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:54)
	at dotty.tools.dotc.typer.TyperPhase.runOn$$anonfun$3(TyperPhase.scala:88)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:88)
	at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:234)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1328)
	at dotty.tools.dotc.Run.runPhases$1(Run.scala:245)

odersky added a commit to dotty-staging/dotty that referenced this issue Sep 4, 2022
KacperFKorban added a commit that referenced this issue Sep 4, 2022
mpollmeier pushed a commit to mpollmeier/dotty that referenced this issue Oct 16, 2022
@Kordyjan Kordyjan added this to the 3.2.2 milestone Aug 1, 2023
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