diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 628dcc5a9d92..06a81a8a7bf9 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -105,7 +105,7 @@ object Typer { */ private[typer] def isSyntheticApply(tree: tpd.Tree): Boolean = tree match { case tree: tpd.Select => tree.hasAttachment(InsertedApply) - case TypeApply(fn, _) => isSyntheticApply(fn) + case TypeApply(fn, targs) if targs.forall(_.isInstanceOf[tpd.InferredTypeTree]) => isSyntheticApply(fn) case _ => false } diff --git a/tests/pos/i15969.scala b/tests/pos/i15969.scala new file mode 100644 index 000000000000..827f3ae1f233 --- /dev/null +++ b/tests/pos/i15969.scala @@ -0,0 +1,7 @@ +object Obj { + def apply[L]: Unit = ??? + + extension (make: Unit) def apply(value: Int): String = ??? + + def test: String = Obj[Int](1) +}