File tree 3 files changed +29
-1
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -2226,7 +2226,8 @@ trait Applications extends Compatibility {
2226
2226
}
2227
2227
val mapped = reverseMapping.map(_._1)
2228
2228
overload.println(i " resolve mapped: ${mapped.map(_.widen)}%, % with $pt" )
2229
- resolveOverloaded(mapped, pt).map(reverseMapping.toMap)
2229
+ resolveOverloaded(mapped, pt)(using ctx.retractMode(Mode .SynthesizeExtMethodReceiver ))
2230
+ .map(reverseMapping.toMap)
2230
2231
2231
2232
/** Try to typecheck any arguments in `pt` that are function values missing a
2232
2233
* parameter type. If the formal parameter types corresponding to a closure argument
Original file line number Diff line number Diff line change
1
+ package dotty .tools .dotc .typer
2
+
3
+ object Color :
4
+ def apply (): Int = ???
5
+
6
+ extension (u : Unit )
7
+ def foo (that : String , f : Int => Int ): Int = ???
8
+ def foo (that : Long , f : Int => Int ): Int = ???
9
+
10
+ def test =
11
+ val c = Color ()
12
+ ().foo(" " , (_ : Int ) => c)
13
+ ().foo(" " , (_ : Int ) => Color ())
Original file line number Diff line number Diff line change
1
+ object Color :
2
+ def apply (i : Int ): Int = i
3
+
4
+ type Plane
5
+
6
+ object Plane :
7
+ extension (plane : Plane )
8
+ def zipWith (that : String , f : Int => Int ): Int = ???
9
+ def zipWith (that : Int , f : Int => Int ): Int = ???
10
+
11
+ import Plane .zipWith
12
+
13
+ def test (p : Plane ) =
14
+ p.zipWith(" " , (_ : Int ) => Color (25 ))
You can’t perform that action at this time.
0 commit comments