Skip to content

Commit

Permalink
Backport "Only look for synthetic applies under TypeApply with inferr…
Browse files Browse the repository at this point in the history
…ed arguments" (#16044)

Backports #15970
  • Loading branch information
Kordyjan authored Sep 15, 2022
2 parents c4ce8b0 + 6a7a9fa commit ccb53a9
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) => isSyntheticApply(fn) && targs.forall(_.isInstanceOf[tpd.InferredTypeTree])
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 ccb53a9

Please sign in to comment.