Skip to content

MatchError in tree.show on TraitParams #8389

@pavelfatin

Description

@pavelfatin

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)
...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions