Skip to content

Commit

Permalink
Only look for synthetic applies under TypeApply with inferred arguments
Browse files Browse the repository at this point in the history
fixes lampepfl#15969
  • Loading branch information
KacperFKorban authored and Kordyjan committed Sep 15, 2022
1 parent 8d966d7 commit 03df624
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 7 additions & 0 deletions tests/pos/i15969.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
object Obj {
def apply[L]: Unit = ???

extension (make: Unit) def apply(value: Int): String = ???

def test: String = Obj[Int](1)
}

0 comments on commit 03df624

Please sign in to comment.