Skip to content

Commit e783d37

Browse files
committed
Adjust info if paramss during overloading
1 parent 225eaec commit e783d37

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ object SymDenotations {
350350

351351
ensureCompleted()
352352
if rawParamss.isEmpty then recurWithoutParamss(info)
353+
else if symbol.hasAnnotation(defn.MappedAlternativeAnnot) then recurWithParamss(info.stripPoly, rawParamss)
353354
else recurWithParamss(info, rawParamss)
354355
end paramSymss
355356

tests/neg/i19077.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ def f(@deprecatedName("x") x: Int, @deprecatedName y: Int, @deprecatedName("w")
66
f(1, 2, 3, w = 42) // error
77
f(1, 2, w = 42, z = 27) // error
88
f(1, 2, z = 42, w = 27) // error
9+
10+
object X { def m[T](i: Int)(s: String) = s*i; def m[T](i: Int)(d: Double) = d*i }
11+
12+
object Y:
13+
def f = X.m(42)(s = "") // overloading resolution objects to methRef.symbol.paramSymss

0 commit comments

Comments
 (0)