Skip to content

Commit 3923aa5

Browse files
committed
Fix type SeqLiteral when pt is nullable
1 parent 4ec72e1 commit 3923aa5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,8 @@ class Typer extends Namer
16041604
}
16051605

16061606
def typedSeqLiteral(tree: untpd.SeqLiteral, pt: Type)(using Context): SeqLiteral = {
1607-
val elemProto = pt.elemType match {
1607+
val pt1 = if ctx.explicitNulls then pt.stripNull else pt
1608+
val elemProto = pt1.elemType match {
16081609
case NoType => WildcardType
16091610
case bounds: TypeBounds => WildcardType(bounds)
16101611
case elemtp => elemtp

0 commit comments

Comments
 (0)