File tree Expand file tree Collapse file tree 5 files changed +26
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 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 {
18241824 skip(alt.widen)
18251825
18261826 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 ]
18281828 case _ => false
18291829
18301830 val found = narrowMostSpecific(candidates)
Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ class Test(val tb: Toolbox) {
2121 implicit val cap : Cap = null
2222
2323 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
2525 }
2626
2727 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
2929 }
3030}
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