File tree 2 files changed +30
-1
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -3697,7 +3697,7 @@ class Typer extends Namer
3697
3697
case pt : FunProto =>
3698
3698
if tree.symbol.isAllOf(ApplyProxyFlags ) then newExpr
3699
3699
else adaptToArgs(wtp, pt)
3700
- case pt : PolyProto =>
3700
+ case pt : PolyProto if ! wtp.isImplicitMethod =>
3701
3701
tryInsertApplyOrImplicit(tree, pt, locked)(tree) // error will be reported in typedTypeApply
3702
3702
case _ =>
3703
3703
if (ctx.mode is Mode .Type ) adaptType(tree.tpe)
Original file line number Diff line number Diff line change
1
+ trait Foo
2
+ given foo : Foo with {}
3
+
4
+ extension (using Foo )(x : Any )
5
+ def foo1 [A ] = ???
6
+
7
+ extension (x : Any )(using Foo )
8
+ def foo2 [A ] = ???
9
+
10
+ implicit class LeadingFooOps (using Foo )(x : Any ) {
11
+ def foo3 [A ] = ???
12
+ }
13
+
14
+ implicit class TrailingFooOps (x : Any )(using Foo ) {
15
+ def foo4 [A ] = ???
16
+ }
17
+
18
+ def a1 = " " .foo1[Any ]
19
+ def a2 : Any = " " .foo2[Any ]
20
+ def a3 = " " .foo3[Any ]
21
+ def a4 = " " .foo4[Any ]
22
+
23
+ def b2 = " " .foo2(using foo)[Any ]
24
+
25
+ def c1 = foo1(" " )[Any ]
26
+ def c2 = foo2(" " )[Any ]
27
+
28
+ def d1 = foo1(using foo)(" " )[Any ]
29
+ def d2 = foo2(" " )(using foo)[Any ]
You can’t perform that action at this time.
0 commit comments