Skip to content

Commit

Permalink
Remove TraitSetter exceptional case from fullNameSeparated
Browse files Browse the repository at this point in the history
Move the logic to traitSetterName.
  • Loading branch information
odersky committed Jul 21, 2022
1 parent 8253eb1 commit 57fb5d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 3 additions & 7 deletions compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,9 @@ object SymDenotations {
def expand(name: Name): Name = name.replace {
case name: SimpleName => qualify(name)
case name @ DerivedName(qual, info: QualifiedInfo) =>
if kind == TraitSetterName then
qualify(name.toSimpleName)
// TODO: Find out why TraitSetterNames can't be kept as QualifiedNames
else
expand(qual).derived(info)
// In all other cases, keep the qualified name, so that it can be recovered later.
// An example where this matters is run/i15702.scala
expand(qual).derived(info)
// Keep the qualified name, so that it can be recovered later.
// An example where this matters is run/i15702.scala
}
val fn = expand(name)
if (name.isTypeName) fn.toTypeName else fn.toTermName
Expand Down
4 changes: 4 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/Mixin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ object Mixin {
val description: String = "expand trait fields and trait initializers"

def traitSetterName(getter: TermSymbol)(using Context): TermName =
extension (name: Name) def qualifiedToSimple = name.replace {
case n @ AnyQualifiedName(_, _) => n.toSimpleName
}
getter.ensureNotPrivate.name
.qualifiedToSimple // TODO: Find out why TraitSetterNames can't be defined over QualifiedNames
.expandedName(getter.owner, TraitSetterName)
.asTermName.syntheticSetterName
}
Expand Down

0 comments on commit 57fb5d4

Please sign in to comment.