File tree 2 files changed +18
-0
lines changed
compiler/src/dotty/tools/dotc/typer 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2447,10 +2447,12 @@ trait Applications extends Compatibility {
2447
2447
deepPt match
2448
2448
case pt @ FunProto (_, PolyProto (targs, resType)) =>
2449
2449
// try to narrow further with snd argument list and following type params
2450
+ pretypeArgs(candidates, pt)
2450
2451
resolveMapped(candidates,
2451
2452
skipParamClause(pt.typedArgs().tpes, targs.tpes), resType)
2452
2453
case pt @ FunProto (_, resType : FunOrPolyProto ) =>
2453
2454
// try to narrow further with snd argument list
2455
+ pretypeArgs(candidates, pt)
2454
2456
resolveMapped(candidates,
2455
2457
skipParamClause(pt.typedArgs().tpes, Nil ), resType)
2456
2458
case _ =>
Original file line number Diff line number Diff line change
1
+
2
+ type X = Double => Unit
3
+ def g (x : Double ): Unit = ???
4
+ def g (x : String ): Unit = ???
5
+
6
+ def f1 (x : X ) = ???
7
+
8
+ def f2 (x : X , y : Int ) = ???
9
+ def f2 (x : X , y : Boolean ) = ???
10
+
11
+ def f3 (x : X )(y : Int ) = ???
12
+ def f3 (x : X )(y : Boolean ) = ???
13
+
14
+ val r1 = f1(g) // ok
15
+ val r2 = f2(g, 1 ) // ok
16
+ val r3 = f3(g)(1 ) // was error: ambiguous overload for g
You can’t perform that action at this time.
0 commit comments