Skip to content

Commit 9963d33

Browse files
committed
Improve robustness of Namer for #5004
But this isn't a full fix and might be a bad idea.
1 parent 28ddeac commit 9963d33

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,8 +1158,9 @@ class Namer { typer: Typer =>
11581158

11591159
/** The type signature of a DefDef with given symbol */
11601160
def defDefSig(ddef: DefDef, sym: Symbol)(implicit ctx: Context) = {
1161-
val DefDef(name, tparams, vparamss, _, _) = ddef
1162-
val isConstructor = name == nme.CONSTRUCTOR
1161+
// Beware: ddef.name need not match sym.name if sym was freshened!
1162+
val DefDef(_, tparams, vparamss, _, _) = ddef
1163+
val isConstructor = sym.name == nme.CONSTRUCTOR
11631164

11641165
// The following 3 lines replace what was previously just completeParams(tparams).
11651166
// But that can cause bad bounds being computed, as witnessed by

0 commit comments

Comments
 (0)