Skip to content

Compiler crashes on polyfunctions applied to singleton types #16174

Closed
@Kordyjan

Description

@Kordyjan

Compiler version

3.2.0
3.2.2-RC1-bin-20221010-2844c2b-NIGHTLY

Minimized code

val f = [A] => (a: A) => a
val x = f[4](4)

Output (click arrow to expand)

Exception in thread "main" java.lang.AssertionError: NoDenotation.owner
	at dotty.tools.dotc.core.SymDenotations$NoDenotation$.owner(SymDenotations.scala:2499)
	at dotty.tools.dotc.ast.TypedTreeInfo.isKnownPureOp$1(TreeInfo.scala:479)
	at dotty.tools.dotc.ast.TypedTreeInfo.isPureApply(TreeInfo.scala:482)
	at dotty.tools.dotc.ast.TypedTreeInfo.isPureApply$(TreeInfo.scala:387)
	at dotty.tools.dotc.ast.tpd$.isPureApply(tpd.scala:23)
	at dotty.tools.dotc.ast.TypedTreeInfo.exprPurity(TreeInfo.scala:434)
	at dotty.tools.dotc.ast.TypedTreeInfo.exprPurity$(TreeInfo.scala:387)
	at dotty.tools.dotc.ast.tpd$.exprPurity(tpd.scala:23)
	at dotty.tools.dotc.ast.TypedTreeInfo.isPureExpr(TreeInfo.scala:462)
	at dotty.tools.dotc.ast.TypedTreeInfo.isPureExpr$(TreeInfo.scala:387)
	at dotty.tools.dotc.ast.tpd$.isPureExpr(tpd.scala:23)
	at dotty.tools.dotc.ast.TypedTreeInfo.constToLiteral(TreeInfo.scala:585)
	at dotty.tools.dotc.ast.TypedTreeInfo.constToLiteral$(TreeInfo.scala:387)
	at dotty.tools.dotc.ast.tpd$.constToLiteral(tpd.scala:23)
	at dotty.tools.dotc.transform.FirstTransform.transformApply(FirstTransform.scala:166)
	at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:650)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:280)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.mapValDef$1(MegaPhase.scala:234)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:239)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
	at dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:255)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:425)
	at dotty.tools.dotc.transform.MegaPhase.loop$1(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:438)
	at dotty.tools.dotc.transform.MegaPhase.mapPackage$1(MegaPhase.scala:379)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:382)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
	at dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:454)
	at dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:466)
	at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:311)
	at scala.collection.immutable.List.map(List.scala:246)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:312)
	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)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:253)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:262)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:262)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:192)
	at dotty.tools.repl.ReplCompiler.runCompilationUnit(ReplCompiler.scala:166)
	at dotty.tools.repl.ReplCompiler.compile(ReplCompiler.scala:177)
	at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:287)
	at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:249)
	at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:168)
	at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:171)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:192)
	at dotty.tools.repl.ReplDriver.runBody$$anonfun$1(ReplDriver.scala:180)
	at dotty.tools.runner.ScalaClassLoader$.asContext(ScalaClassLoader.scala:80)
	at dotty.tools.repl.ReplDriver.runBody(ReplDriver.scala:180)
	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:171)
	at dotty.tools.repl.ReplDriver.tryRunning(ReplDriver.scala:133)
	at dotty.tools.repl.Main$.main(Main.scala:7)
	at dotty.tools.repl.Main.main(Main.scala)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions