Skip to content

Commit 1f94a38

Browse files
committed
Fix #9828: Add missing case for adapt of ExpMethodApply results
ExtMethodApply needs to bypass adaptation until everything is integrated.
1 parent 333ab8e commit 1f94a38

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3581,6 +3581,9 @@ class Typer extends Namer
35813581
case _: IntegratedTypeArgs => tree
35823582
case _ => tryInsertApplyOrImplicit(tree, pt, locked)(tree) // error will be reported in typedTypeApply
35833583
}
3584+
case pt: SelectionProto if tree.isInstanceOf[ExtMethodApply] =>
3585+
assert(pt.extensionName == tree.symbol.name)
3586+
tree
35843587
case _ =>
35853588
if (ctx.mode is Mode.Type) adaptType(tree.tpe)
35863589
else adaptNoArgs(wtp)

tests/pos/i9828.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
4+
extension (x: Int) inline def g (y: Int): Int = x + y
5+
extension [S](f: S => Int) inline def f(s: String) = "test"
6+
val z = 1.g(2)
7+
def testStuff = ((s: String) => 42).f("foo")
8+

0 commit comments

Comments
 (0)