Skip to content

Commit 03df624

Browse files
KacperFKorbanKordyjan
authored andcommitted
Only look for synthetic applies under TypeApply with inferred arguments
fixes lampepfl#15969
1 parent 8d966d7 commit 03df624

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ object Typer {
105105
*/
106106
private[typer] def isSyntheticApply(tree: tpd.Tree): Boolean = tree match {
107107
case tree: tpd.Select => tree.hasAttachment(InsertedApply)
108-
case TypeApply(fn, _) => isSyntheticApply(fn)
108+
case TypeApply(fn, targs) if targs.forall(_.isInstanceOf[tpd.InferredTypeTree]) => isSyntheticApply(fn)
109109
case _ => false
110110
}
111111

tests/pos/i15969.scala

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
object Obj {
2+
def apply[L]: Unit = ???
3+
4+
extension (make: Unit) def apply(value: Int): String = ???
5+
6+
def test: String = Obj[Int](1)
7+
}

0 commit comments

Comments
 (0)