-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Code (0.22.0-RC1)
// in dotty-example-project
val inspector = new TastyInspector {
def processCompilationUnit(reflect: Reflection)(tree: reflect.Tree): Unit = {
import reflect.{_, given}
println(tree.show)
}
}
inspector.inspect("", List("TraitParams"))
Output
Exception in thread "main" scala.MatchError: AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class collection)),module immutable),Seq),List(OrType(TypeRef(ThisType(TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <root>)),module class <empty>)),module class TraitParams$)),class A),TypeRef(ThisType(TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <root>)),module class <empty>)),module class TraitParams$)),class B)))) (of class dotty.tools.dotc.core.Types$CachedAppliedType)
at scala.tasty.reflect.SourceCodePrinter$Buffer.printTypeTree(SourceCodePrinter.scala:1018)
at scala.tasty.reflect.SourceCodePrinter$Buffer.printParamDef(SourceCodePrinter.scala:848)
at scala.tasty.reflect.SourceCodePrinter$Buffer.printSeparated$14(SourceCodePrinter.scala:803)
at scala.tasty.reflect.SourceCodePrinter$Buffer.printArgsDefs$$anonfun$1(SourceCodePrinter.scala:810)
...