You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exception occurred while compiling LazyList.scala
java.lang.UnsupportedOperationException: mkClosure($anon$superArg$1()) while compiling LazyList.scala
Exception in thread "main" java.lang.UnsupportedOperationException: mkClosure($anon$superArg$1())
at dotty.tools.package$.unsupported(package.scala:25)
at dotty.tools.dotc.transform.TransformByNameApply.mkByNameClosure(TransformByNameApply.scala:37)
at dotty.tools.dotc.transform.TransformByNameApply.transformArg$1(TransformByNameApply.scala:55)
at dotty.tools.dotc.transform.TransformByNameApply.$anonfun$1(TransformByNameApply.scala:62)
at dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:153)
at dotty.tools.dotc.transform.TransformByNameApply.transformApply(TransformByNameApply.scala:62)
at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:644)
at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:645)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:281)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:429)
at dotty.tools.dotc.transform.MegaPhase.recur$2(MegaPhase.scala:453)
at dotty.tools.dotc.transform.MegaPhase.transformTrees(MegaPhase.scala:453)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:360)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:429)
at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:256)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
at dotty.tools.dotc.transform.MegaPhase.transformStat$2(MegaPhase.scala:437)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:299)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:429)
at dotty.tools.dotc.transform.MegaPhase.mapDefDef$1(MegaPhase.scala:249)
at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:252)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
at dotty.tools.dotc.transform.MegaPhase.transformStat$2(MegaPhase.scala:437)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:362)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:429)
at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:256)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:427)
at dotty.tools.dotc.transform.MegaPhase.transformStat$2(MegaPhase.scala:437)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.recur$1(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:442)
at dotty.tools.dotc.transform.MegaPhase.mapPackage$1(MegaPhase.scala:382)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:385)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:429)
at dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:448)
at dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:460)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:308)
at scala.collection.immutable.List.map(List.scala:246)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:309)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:261)
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:1323)
at dotty.tools.dotc.Run.runPhases$5(Run.scala:272)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:280)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
at dotty.tools.dotc.Run.compileUnits(Run.scala:289)
at dotty.tools.dotc.Run.compileSources(Run.scala:222)
at dotty.tools.dotc.Run.compile(Run.scala:206)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
at dotty.tools.dotc.Driver.process(Driver.scala:199)
at dotty.tools.dotc.Driver.process(Driver.scala:167)
at dotty.tools.dotc.Driver.process(Driver.scala:179)
at dotty.tools.dotc.Driver.main(Driver.scala:209)
at dotty.tools.dotc.Main.main(Main.scala)
Expectation
I think, the code should compile (or at least cause some legible error message). ;)
The culprit is the first parameter, top, to class Push. With a plain parameter instead of a by-name, the code compiles.
In the example, there are other by-name parameters commented out, which work just fine. Also commented out is another method, map, which looks quite similar to method append and doesn't cause problems. It is possible to replace class Push with an anonymous subclass of LazyList, and everything will work just fine.
I've seen earlier bug reports which looked a bit similar, but they seem to be closed already.
The text was updated successfully, but these errors were encountered:
nicolasstucki
changed the title
Problem with by-name class parameter passed to anonymous subclass [UnsupportedOperationException: mkClosure($anon$superArg$1())]
By-name field passed to anonymous class constuctor
Nov 29, 2021
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Dec 6, 2021
Compiler version
3.1.0
Minimized code
Output
Expectation
I think, the code should compile (or at least cause some legible error message). ;)
The culprit is the first parameter, top, to class Push. With a plain parameter instead of a by-name, the code compiles.
In the example, there are other by-name parameters commented out, which work just fine. Also commented out is another method, map, which looks quite similar to method append and doesn't cause problems. It is possible to replace class Push with an anonymous subclass of LazyList, and everything will work just fine.
I've seen earlier bug reports which looked a bit similar, but they seem to be closed already.
The text was updated successfully, but these errors were encountered: