Skip to content

Commit 37e667e

Browse files
committed
Rewrite nested unique names
1 parent 4581e95 commit 37e667e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/src/dotty/tools/dotc/transform/RenameLifted.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ class RenameLifted extends MiniPhaseTransform with SymTransformer { thisTransfor
3131

3232
/** Refreshes the number of the name based on the full name of the symbol */
3333
private def refreshedName(sym: Symbol)(implicit ctx: Context): Name = {
34-
sym.name.rewrite {
34+
lazy val rewriteUnique: PartialFunction[Name, Name] = {
3535
case name: DerivedName if name.info.kind == UniqueName =>
3636
val fullName = (sym.owner.fullName.toString + name.underlying).toTermName
3737
val freshName = UniqueName.fresh(fullName)
3838
val info = freshName.asInstanceOf[DerivedName].info
39-
DerivedName(name.underlying, info)
39+
DerivedName(name.underlying.rewrite(rewriteUnique), info)
40+
case DerivedName(underlying, info: QualifiedInfo) =>
41+
underlying.rewrite(rewriteUnique).derived(info)
4042
}
43+
44+
sym.name.rewrite(rewriteUnique)
4145
}
4246
}

0 commit comments

Comments
 (0)