We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3938388 + e6fa1ab commit 3b2bceeCopy full SHA for 3b2bcee
compiler/src/dotty/tools/dotc/typer/Applications.scala
@@ -600,8 +600,8 @@ trait Applications extends Compatibility {
600
args match {
601
case arg :: Nil if isVarArg(arg) =>
602
addTyped(arg, formal)
603
- case Typed(Literal(Constant(null)), _) :: Nil =>
604
- addTyped(args.head, formal)
+ case (arg as Typed(Literal(Constant(null)), _)) :: Nil if ctx.isAfterTyper =>
+ addTyped(arg, formal)
605
case _ =>
606
val elemFormal = formal.widenExpr.argTypesLo.head
607
val typedArgs =
tests/run/i10062.scala
@@ -0,0 +1,9 @@
1
+class X
2
+
3
+object X {
4
+ extension (x: List[X]) { def isNull = x.head == null }
5
+}
6
7
+@main def Test =
8
+ assert(List(null: X).isNull)
9
+ assert(List((null: X)).isNull)
0 commit comments