Skip to content

Commit 8a8d308

Browse files
committed
Fix type SeqLiteral
1 parent 4ec72e1 commit 8a8d308

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 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
@@ -3518,6 +3519,8 @@ class Typer extends Namer
35183519
}
35193520

35203521
def tryUnsafeNullConver(fail: => Tree)(using Context): Tree =
3522+
// println(tree.tpe)
3523+
// println(pt.stripAllNulls)
35213524
// If explicitNulls and unsafeNulls are enabled, and
35223525
if ctx.mode.is(Mode.UnsafeNullConversion) && pt.isValueType &&
35233526
tree.tpe.isUnsafeConvertable(pt)

0 commit comments

Comments
 (0)