Skip to content

Commit e307755

Browse files
authored
Merge pull request #5030 from dotty-staging/improve-namer-5004
Improve robustness of Namer for #5004
2 parents d397946 + 9963d33 commit e307755

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
@@ -1155,8 +1155,9 @@ class Namer { typer: Typer =>
11551155

11561156
/** The type signature of a DefDef with given symbol */
11571157
def defDefSig(ddef: DefDef, sym: Symbol)(implicit ctx: Context) = {
1158-
val DefDef(name, tparams, vparamss, _, _) = ddef
1159-
val isConstructor = name == nme.CONSTRUCTOR
1158+
// Beware: ddef.name need not match sym.name if sym was freshened!
1159+
val DefDef(_, tparams, vparamss, _, _) = ddef
1160+
val isConstructor = sym.name == nme.CONSTRUCTOR
11601161

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

0 commit comments

Comments
 (0)