File tree 1 file changed +4
-1
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1604,7 +1604,8 @@ class Typer extends Namer
1604
1604
}
1605
1605
1606
1606
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 {
1608
1609
case NoType => WildcardType
1609
1610
case bounds : TypeBounds => WildcardType (bounds)
1610
1611
case elemtp => elemtp
@@ -3518,6 +3519,8 @@ class Typer extends Namer
3518
3519
}
3519
3520
3520
3521
def tryUnsafeNullConver (fail : => Tree )(using Context ): Tree =
3522
+ // println(tree.tpe)
3523
+ // println(pt.stripAllNulls)
3521
3524
// If explicitNulls and unsafeNulls are enabled, and
3522
3525
if ctx.mode.is(Mode .UnsafeNullConversion ) && pt.isValueType &&
3523
3526
tree.tpe.isUnsafeConvertable(pt)
You can’t perform that action at this time.
0 commit comments