File tree 5 files changed +26
-3
lines changed
compiler/src/dotty/tools/dotc/typer 5 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -1824,7 +1824,7 @@ trait Applications extends Compatibility {
1824
1824
skip(alt.widen)
1825
1825
1826
1826
def resultIsMethod (tp : Type ): Boolean = tp.widen.stripPoly match
1827
- case tp : MethodType => tp.resultType.isInstanceOf [MethodType ]
1827
+ case tp : MethodType => stripImplicit( tp.resultType) .isInstanceOf [MethodType ]
1828
1828
case _ => false
1829
1829
1830
1830
val found = narrowMostSpecific(candidates)
Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ class Test(val tb: Toolbox) {
21
21
implicit val cap : Cap = null
22
22
23
23
def foo (tree : Tree ): Int = (tree : Any ) match {
24
- case tb.Apply (fun, args) => 3
24
+ case tb.Apply (fun, args) => 3 // error: ambiguous overload of unapply
25
25
}
26
26
27
27
def bar (tree : tpd.Tree ): Int = (tree : Any ) match {
28
- case Apply (fun, args) => 3
28
+ case Apply (fun, args) => 3 // error: ambiguous overload of unapply
29
29
}
30
30
}
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ extension StrDeco on (tree : String ) {
3
+ def show (using DummyImplicit ): String = ???
4
+ def show (color : Boolean )(using DummyImplicit ): String = ???
5
+ }
6
+
7
+ val a : String = " foo" .show
8
+ val b : String = " foo" .show(true )
9
+ val c : Any = " foo" .show
10
+ val d : Any = " foo" .show(true )
11
+ }
Original file line number Diff line number Diff line change
1
+ class Foo {
2
+ def f (x : String )(using DummyImplicit ): String = x * 2
3
+ def f (x : String )(color : Boolean )(using DummyImplicit ): String = x * 3
4
+ }
5
+
6
+ @ main def Test = println(new Foo ().f(" foo" ))
Original file line number Diff line number Diff line change
1
+ class Foo {
2
+ def f (x : String )(using DummyImplicit ): String = x * 2
3
+ def f (x : String )(using DummyImplicit )(color : Boolean ): String = x * 3
4
+ }
5
+
6
+ @ main def Test = println(new Foo ().f(" foo" ))
You can’t perform that action at this time.
0 commit comments