diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index d40ec154e12d..e8ed165b02ce 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -3581,6 +3581,9 @@ class Typer extends Namer case _: IntegratedTypeArgs => tree case _ => tryInsertApplyOrImplicit(tree, pt, locked)(tree) // error will be reported in typedTypeApply } + case pt: SelectionProto if tree.isInstanceOf[ExtMethodApply] => + assert(pt.extensionName == tree.symbol.name) + tree case _ => if (ctx.mode is Mode.Type) adaptType(tree.tpe) else adaptNoArgs(wtp) diff --git a/tests/pos/i9828.scala b/tests/pos/i9828.scala new file mode 100644 index 000000000000..f84f1a6f77c4 --- /dev/null +++ b/tests/pos/i9828.scala @@ -0,0 +1,8 @@ + + + +extension (x: Int) inline def g (y: Int): Int = x + y +extension [S](f: S => Int) inline def f(s: String) = "test" +val z = 1.g(2) +def testStuff = ((s: String) => 42).f("foo") +