Skip to content

Commit ccb53a9

Browse files
authored
Backport "Only look for synthetic applies under TypeApply with inferred arguments" (#16044)
Backports #15970
2 parents c4ce8b0 + 6a7a9fa commit ccb53a9

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) => isSyntheticApply(fn) && targs.forall(_.isInstanceOf[tpd.InferredTypeTree])
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)