Skip to content

Commit 042cee2

Browse files
committed
Pass right prototype to SeqLiteral elements.
1 parent a612da8 commit 042cee2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ object Erasure extends TypeTestsCasts{
374374
}
375375
}
376376

377+
override def typedSeqLiteral(tree: untpd.SeqLiteral, pt: Type)(implicit ctx: Context) =
378+
super.typedSeqLiteral(tree, tree.typeOpt)
379+
// proto type of typed seq literal is original type; this makes elements be adapted to correct type.
380+
377381
override def typedValDef(vdef: untpd.ValDef, sym: Symbol)(implicit ctx: Context): ValDef =
378382
super.typedValDef(untpd.cpy.ValDef(vdef)(
379383
tpt = untpd.TypedSplice(TypeTree(sym.info).withPos(vdef.tpt.pos))), sym)

0 commit comments

Comments
 (0)