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
classFoo:deffoo(x: =>Foo) = bar(x: Foo)
defbar(x: =>Foo) = x
[[syntax trees at end of MegaPhase{firstTransform, checkReentrant, elimPackagePrefixes, cookComments, checkStatic, betaReduce, inlineVals, expandSAMs}]] // i13349min.scalapackage<empty> {
@scala.annotation.internal.SourceFile("i13349min.scala") classFoo() extendsObject
() {
deffoo(x: =>Foo):Foo=this.bar(x:Foo)
defbar(x: =>Foo):Foo= x
}
}
[[syntax trees at end of MegaPhase{elimRepeated, protectedAccessors, extmethods, uncacheGivenAliases, byNameClosures, hoistSuperArgs, specializeApplyMethods, refchecks, tryCatchPatterns, patternMatcher}]] // i13349min.scala: unchanged since MegaPhase{firstTransform, checkReentrant, elimPackagePrefixes, cookComments, checkStatic, betaReduce, inlineVals, expandSAMs}
exception occurred while compiling i13349min.scala
java.lang.UnsupportedOperationException: mkClosure(x.apply():Foo) while compiling i13349min.scala
Exception in thread "main" java.lang.UnsupportedOperationException: mkClosure(x.apply():Foo)
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:54)
at dotty.tools.dotc.transform.TransformByNameApply.$anonfun$1(TransformByNameApply.scala:61)
at dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:153)
at dotty.tools.dotc.transform.TransformByNameApply.transformApply(TransformByNameApply.scala:61)
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.mapDefDef$1(MegaPhase.scala:249)
Compiler version
3.0.1, tested on macOS and Scastie
Minimized code
https://scastie.scala-lang.org/lCvA1ZJuSAahB7CATzl2cA
uncommenting the append function crashes the compiler.
exercise from the book "functional programming in scala"
Output
java.lang.UnsupportedOperationException: mkClosure(other.apply():�[35mPlayground.Stream[B]�[0m)
The text was updated successfully, but these errors were encountered: