Skip to content

Commit ae776ff

Browse files
committed
Remove TraitSetter exceptional case from fullNameSeparated
Move the logic to traitSetterName.
1 parent 8253eb1 commit ae776ff

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,9 @@ object SymDenotations {
489489
def expand(name: Name): Name = name.replace {
490490
case name: SimpleName => qualify(name)
491491
case name @ DerivedName(qual, info: QualifiedInfo) =>
492-
if kind == TraitSetterName then
493-
qualify(name.toSimpleName)
494-
// TODO: Find out why TraitSetterNames can't be kept as QualifiedNames
495-
else
496-
expand(qual).derived(info)
497-
// In all other cases, keep the qualified name, so that it can be recovered later.
498-
// An example where this matters is run/i15702.scala
492+
expand(qual).derived(info)
493+
// Keep the qualified name, so that it can be recovered later.
494+
// An example where this matters is run/i15702.scala
499495
}
500496
val fn = expand(name)
501497
if (name.isTypeName) fn.toTypeName else fn.toTermName

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ object Mixin {
2323
val description: String = "expand trait fields and trait initializers"
2424

2525
def traitSetterName(getter: TermSymbol)(using Context): TermName =
26-
getter.ensureNotPrivate.name
26+
val origName = getter.ensureNotPrivate.name match
27+
case n @ AnyQualifiedName(_, _) =>
28+
n.toSimpleName // TODO: Find out why TraitSetterNames can't be defined over QualifiedNames
29+
case n => n
30+
origName
2731
.expandedName(getter.owner, TraitSetterName)
2832
.asTermName.syntheticSetterName
2933
}

0 commit comments

Comments
 (0)