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
importscala.quoted._importscala.quoted.staging._deffoo(n: Int, t: Expr[Int])(givenQuoteContext):Expr[Int] =if (n ==0) t
else'{ vala=${Expr(n)}; ${foo(n -1, 'a)} + $t }
@main defmain= {
// make available the necessary toolbox for runtime code generationgivenToolbox=Toolbox.make(getClass.getClassLoader)
valf:Int= run { foo(2, Expr(5)) }
println(f)
}
Crash output (click arrow to expand)
classdotty.tools.dotc.reporting.diagnostic.messages$Error at /tmp/scastie2283433749370612327/src/main/scala/main.scala:<162..184>:undefined: [cannot display due to dotty.tools.dotc.core.Symbols$NoSymbol$ cannot be cast to dotty.tools.dotc.core.Symbols$ClassSymbol, raw string =Select(Inlined(EmptyTree,List(),Ident(a)),+)] #14345:TermRef(TermRef(NoPrefix,vala),+) at quotedFrontend
classdotty.tools.dotc.reporting.diagnostic.messages$Error at /tmp/scastie2283433749370612327/src/main/scala/main.scala:<162..184>:undefined: [cannot display due to dotty.tools.dotc.core.Symbols$NoSymbol$ cannot be cast to dotty.tools.dotc.core.Symbols$ClassSymbol, raw string =Select(Inlined(EmptyTree,List(),Ident(a)),+)] #14345:TermRef(TermRef(NoPrefix,vala),+) at quotedFrontend
at dotty.tools.dotc.reporting.Reporting.error(Reporter.scala:135)
at dotty.tools.dotc.core.Contexts$Context.error(Contexts.scala:75)
at dotty.tools.dotc.typer.ErrorReporting$.errorType(ErrorReporting.scala:29)
at dotty.tools.dotc.typer.TypeAssigner.assignType(TypeAssigner.scala:414)
at dotty.tools.dotc.typer.Typer.assignType(Typer.scala:83)
at dotty.tools.dotc.ast.tpd$.Apply(tpd.scala:46)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTerm$1(TreeUnpickler.scala:1091)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTerm$1(TreeUnpickler.scala:1104)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTerm$1(TreeUnpickler.scala:1115)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler.unpickle(TreeUnpickler.scala:107)
at dotty.tools.dotc.core.tasty.DottyUnpickler.computeRootTrees(DottyUnpickler.scala:59)
at dotty.tools.dotc.ast.tpd$TreeProvider.rootTrees(tpd.scala:1107)
at dotty.tools.dotc.core.tasty.DottyUnpickler.rootTrees(DottyUnpickler.scala:41)
at dotty.tools.dotc.ast.tpd$TreeProvider.tree(tpd.scala:1111)
at dotty.tools.dotc.core.tasty.DottyUnpickler.tree(DottyUnpickler.scala:41)
at dotty.tools.dotc.core.quoted.PickledQuotes$.unpickle(PickledQuotes.scala:131)
at dotty.tools.dotc.core.quoted.PickledQuotes$.unpickleExpr(PickledQuotes.scala:66)
at dotty.tools.dotc.tastyreflect.ReflectionCompilerInterface.unpickleExpr(ReflectionCompilerInterface.scala:38)
at scala.runtime.quoted.Unpickler$.unpickleExpr$direct(Unpickler.scala:16)
at main$package$.foo(main.scala:6)
at main$package$.foo$$anonfun$5$2$$anonfun$1(main.scala:6)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readHole(TreeUnpickler.scala:1293)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTerm$1(TreeUnpickler.scala:1204)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTerm$1(TreeUnpickler.scala:1115)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.completeSelect$1(TreeUnpickler.scala:1024)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readSimpleTerm$1(TreeUnpickler.scala:1058)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTerm$1(TreeUnpickler.scala:1090)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTerm$1(TreeUnpickler.scala:1104)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTerm$1(TreeUnpickler.scala:1115)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1212)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTerm(TreeUnpickler.scala:1006)
at dotty.tools.dotc.core.tasty.TreeUnpickler.unpickle(TreeUnpickler.scala:107)
at dotty.tools.dotc.core.tasty.DottyUnpickler.computeRootTrees(DottyUnpickler.scala:59)
at dotty.tools.dotc.ast.tpd$TreeProvider.rootTrees(tpd.scala:1107)
at dotty.tools.dotc.core.tasty.DottyUnpickler.rootTrees(DottyUnpickler.scala:41)
at dotty.tools.dotc.ast.tpd$TreeProvider.tree(tpd.scala:1111)
at dotty.tools.dotc.core.tasty.DottyUnpickler.tree(DottyUnpickler.scala:41)
at dotty.tools.dotc.core.quoted.PickledQuotes$.unpickle(PickledQuotes.scala:131)
at dotty.tools.dotc.core.quoted.PickledQuotes$.unpickleExpr(PickledQuotes.scala:66)
at dotty.tools.dotc.tastyreflect.ReflectionCompilerInterface.unpickleExpr(ReflectionCompilerInterface.scala:38)
at scala.runtime.quoted.Unpickler$.unpickleExpr$direct(Unpickler.scala:16)
at main$package$.foo(main.scala:6)
at main$package$.$anonfun$1(main.scala:12)
at scala.quoted.staging.package$.run$$anonfun$1(staging.scala:19)
at scala.quoted.staging.QuoteCompiler$QuotedFrontend.runOn$$anonfun$1(QuoteCompiler.scala:71)
at scala.collection.immutable.List.flatMap(List.scala:265)
at scala.quoted.staging.QuoteCompiler$QuotedFrontend.runOn(QuoteCompiler.scala:84)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:161)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.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:171)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:179)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:65)
at dotty.tools.dotc.Run.compileUnits(Run.scala:186)
at dotty.tools.dotc.Run.compileUnits(Run.scala:128)
at scala.quoted.staging.QuoteCompiler$ExprRun.compileExpr(QuoteCompiler.scala:104)
at scala.quoted.staging.QuoteDriver.run(QuoteDriver.scala:37)
at scala.quoted.staging.Toolbox$$anon$1.run(Toolbox.scala:36)
at scala.quoted.staging.package$.run(staging.scala:19)
at main$package$.main(main.scala:12)
at main.main(main.scala:8)
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sbt.Run.invokeMain(Run.scala:115)
at sbt.Run.execute$1(Run.scala:79)
at sbt.Run.$anonfun$runWithLoader$4(Run.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:10)
at sbt.TrapExit$App.run(TrapExit.scala:257)
at java.lang.Thread.run(Thread.java:748)
The text was updated successfully, but these errors were encountered:
Run on scastie: https://scastie.scala-lang.org/aIv0YMfSSoCH5tuen4bUKg
minimized code
Crash output (click arrow to expand)
The text was updated successfully, but these errors were encountered: