diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index a195b157cacd..4841250b8932 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -329,7 +329,7 @@ class TreePickler(pickler: TastyPickler) { pickleName(sym.name) pickleParams tpt match { - case _: Template | _: Hole => pickleTree(tpt) + case _: Template | _: Literal | _: Hole => pickleTree(tpt) case _ if tpt.isType => pickleTpt(tpt) } pickleTreeUnlessEmpty(rhs) diff --git a/tests/pos/i13503.scala b/tests/pos/i13503.scala new file mode 100644 index 000000000000..a3083ddca04d --- /dev/null +++ b/tests/pos/i13503.scala @@ -0,0 +1,7 @@ +trait First {type Out} +given First with {type Out = 123} + +trait Second {type Out} +transparent inline given (using f: First): Second = new Second {type Out = f.Out} + +val s = summon[Second] \ No newline at end of file