Skip to content

Commit 4a3747a

Browse files
authored
Fix curried overloading resolution for polymorphic methods (#16485)
Fixes #16484
2 parents 49c73ed + 43a77e9 commit 4a3747a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ trait Applications extends Compatibility {
21662166
val reverseMapping = alts.flatMap { alt =>
21672167
val t = f(alt)
21682168
if t.exists then
2169-
val (trimmed, skipped) = trimParamss(t, alt.symbol.rawParamss)
2169+
val (trimmed, skipped) = trimParamss(t.stripPoly, alt.symbol.rawParamss)
21702170
val mappedSym = alt.symbol.asTerm.copy(info = t)
21712171
mappedSym.rawParamss = trimmed
21722172
val (pre, totalSkipped) = mappedAltInfo(alt.symbol) match

tests/pos/i16484.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait JWTEncoder:
2+
def encode[P](arg: String)(opt: Option[String] = None): String
3+
def encode[P](arg: String): String = encode(arg)()

0 commit comments

Comments
 (0)