Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created April 6, 2022 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/debc8f1905b3469c205eb75529048f51 to your computer and use it in GitHub Desktop.
Save xuwei-k/debc8f1905b3469c205eb75529048f51 to your computer and use it in GitHub Desktop.
Welcome to Scala 3.1.1 (1.8.0_322, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> import scala.quoted.*
scala> def a[A](f : [x <: Quotes] => (x: x) => x.reflect.Tree => A): A = ???
def a[A](f: [x <: quoted.Quotes] => (x: x) => x.reflect.Tree => A): A
scala> a([x <: Quotes] => (x: x) => (tree: x.reflect.Tree) => tree.symbol)
error when pickling type x.type
error when pickling type (x.reflect : x.reflectModule)
error when pickling type x.reflect.Symbol
error when pickling tree x.reflect.Symbol
error when pickling tree val res0: x.reflect.Symbol =
a[x.reflect.Symbol](
{
final class $anon() extends Object(), PolyFunction {
def apply[x >: Nothing <: quoted.Quotes](x: x):
x.reflect.Tree => x.reflect.Symbol
=
{
def $anonfun(tree: x.reflect.Tree): x.reflect.Symbol =
x.reflect.TreeMethods.symbol(tree)
closure($anonfun)
}
}
new $anon():
([x <: quoted.Quotes] => (x: x) => x.reflect.Tree => x.reflect.Symbol)
}
)
error when pickling tree () extends Object() { this: repl.rs$line$3.type =>
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[repl.rs$line$3.type])
val res0: x.reflect.Symbol =
a[x.reflect.Symbol](
{
final class $anon() extends Object(), PolyFunction {
def apply[x >: Nothing <: quoted.Quotes](x: x):
x.reflect.Tree => x.reflect.Symbol
=
{
def $anonfun(tree: x.reflect.Tree): x.reflect.Symbol =
x.reflect.TreeMethods.symbol(tree)
closure($anonfun)
}
}
new $anon():
([x <: quoted.Quotes] => (x: x) => x.reflect.Tree => x.reflect.Symbol)
}
)
}
error when pickling tree @SourceFile("rs$line$3") final module class rs$line$3() extends Object() {
this: repl.rs$line$3.type =>
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[repl.rs$line$3.type])
val res0: x.reflect.Symbol =
a[x.reflect.Symbol](
{
final class $anon() extends Object(), PolyFunction {
def apply[x >: Nothing <: quoted.Quotes](x: x):
x.reflect.Tree => x.reflect.Symbol
=
{
def $anonfun(tree: x.reflect.Tree): x.reflect.Symbol =
x.reflect.TreeMethods.symbol(tree)
closure($anonfun)
}
}
new $anon():
([x <: quoted.Quotes] => (x: x) => x.reflect.Tree => x.reflect.Symbol)
}
)
}
error when pickling tree package repl {
final lazy module val rs$line$3: repl.rs$line$3 = new repl.rs$line$3()
@SourceFile("rs$line$3") final module class rs$line$3() extends Object() {
this: repl.rs$line$3.type =>
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[repl.rs$line$3.type])
val res0: x.reflect.Symbol =
a[x.reflect.Symbol](
{
final class $anon() extends Object(), PolyFunction {
def apply[x >: Nothing <: quoted.Quotes](x: x):
x.reflect.Tree => x.reflect.Symbol
=
{
def $anonfun(tree: x.reflect.Tree): x.reflect.Symbol =
x.reflect.TreeMethods.symbol(tree)
closure($anonfun)
}
}
new $anon():
([x <: quoted.Quotes] => (x: x) => x.reflect.Tree =>
x.reflect.Symbol
)
}
)
}
}
Exception in thread "main" java.lang.AssertionError: assertion failed: orphan parameter reference: TermParamRef(x)
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:289)
at dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:160)
at dotty.tools.dotc.core.tasty.TreePickler.pickleExternalRef$1(TreePickler.scala:200)
at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:220)
at dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:160)
at dotty.tools.dotc.core.tasty.TreePickler.pickleExternalRef$1(TreePickler.scala:200)
at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:220)
at dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:160)
at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:604)
at dotty.tools.dotc.core.tasty.TreePickler.pickleTpt(TreePickler.scala:316)
at dotty.tools.dotc.core.tasty.TreePickler.pickleDef$$anonfun$1(TreePickler.scala:333)
at dotty.tools.dotc.core.tasty.TreePickler.withLength(TreePickler.scala:58)
at dotty.tools.dotc.core.tasty.TreePickler.pickleDef(TreePickler.scala:337)
at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:545)
at dotty.tools.dotc.core.tasty.TreePickler.pickleStats$$anonfun$2(TreePickler.scala:360)
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.core.tasty.TreePickler.pickleStats(TreePickler.scala:360)
at dotty.tools.dotc.core.tasty.TreePickler.pickleTree$$anonfun$26(TreePickler.scala:586)
at dotty.tools.dotc.core.tasty.TreePickler.withLength(TreePickler.scala:58)
at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:587)
at dotty.tools.dotc.core.tasty.TreePickler.pickleDef$$anonfun$1(TreePickler.scala:332)
at dotty.tools.dotc.core.tasty.TreePickler.withLength(TreePickler.scala:58)
at dotty.tools.dotc.core.tasty.TreePickler.pickleDef(TreePickler.scala:337)
at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:562)
at dotty.tools.dotc.core.tasty.TreePickler.pickleStats$$anonfun$2(TreePickler.scala:360)
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.core.tasty.TreePickler.pickleStats(TreePickler.scala:360)
at dotty.tools.dotc.core.tasty.TreePickler.pickleTree$$anonfun$29(TreePickler.scala:602)
at dotty.tools.dotc.core.tasty.TreePickler.withLength(TreePickler.scala:58)
at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:602)
at dotty.tools.dotc.core.tasty.TreePickler.pickle$$anonfun$1(TreePickler.scala:773)
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.core.tasty.TreePickler.pickle(TreePickler.scala:773)
at dotty.tools.dotc.transform.Pickler.run$$anonfun$1$$anonfun$1(Pickler.scala:69)
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.transform.Pickler.run$$anonfun$1(Pickler.scala:106)
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.transform.Pickler.run(Pickler.scala:106)
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.transform.Pickler.runOn(Pickler.scala:111)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(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$1(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.compileUnits(Run.scala:228)
at dotty.tools.repl.ReplCompiler.runCompilationUnit(ReplCompiler.scala:167)
at dotty.tools.repl.ReplCompiler.compile(ReplCompiler.scala:178)
at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:251)
at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:219)
at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:153)
at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:156)
at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:175)
at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:156)
at dotty.tools.repl.ReplDriver.tryRunning(ReplDriver.scala:118)
at dotty.tools.repl.Main$.main(Main.scala:6)
at dotty.tools.MainGenericRunner$.run$1(MainGenericRunner.scala:177)
at dotty.tools.MainGenericRunner$.main(MainGenericRunner.scala:239)
at dotty.tools.MainGenericRunner.main(MainGenericRunner.scala)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment