diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index ca5d94dba23b..4826c0d208c0 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -556,6 +556,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic => args match { case arg :: Nil if isVarArg(arg) => addTyped(arg, formal) + case Typed(Literal(Constant(null)), _) :: Nil => + addTyped(args.head, formal) case _ => val elemFormal = formal.widenExpr.argTypesLo.head val typedArgs = diff --git a/tests/pending/fuzzy/AE-c00f7074d074a942f48e3e24845e7f7054b76b69.scala b/tests/fuzzy/AE-c00f7074d074a942f48e3e24845e7f7054b76b69.scala similarity index 100% rename from tests/pending/fuzzy/AE-c00f7074d074a942f48e3e24845e7f7054b76b69.scala rename to tests/fuzzy/AE-c00f7074d074a942f48e3e24845e7f7054b76b69.scala diff --git a/tests/pos/i5039.scala b/tests/pos/i5039.scala new file mode 100644 index 000000000000..d65c51863409 --- /dev/null +++ b/tests/pos/i5039.scala @@ -0,0 +1,8 @@ +class I0 { + List(null:_*) + List[Null](null:_*) + List[Nothing](null:_*) + List(1, 2, null:_*) + List(null, null:_*) + List(???, null:_*) +}