Skip to content

Commit d97734b

Browse files
committed
Adress reviewers comments
1 parent c6b6b30 commit d97734b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ object SymDenotations {
135135
def name = myName
136136

137137
/** Update the name; only called when unpickling top-level classes */
138-
def name_=(n: Name) = myName = n
138+
protected[dotc] def name_=(n: Name) = myName = n
139139

140140
/** The owner of the symbol; overridden in NoDenotation */
141141
def owner: Symbol = ownerIfExists

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ class SymbolLoaders {
186186

187187
private[core] val currentDecls: MutableScope = new PackageScope()
188188

189-
def isFlatName(name: SimpleTermName) = name.lastIndexOf('$', name.length - 2) >= 0
189+
/** A name is a flat name if it contains a `$` which is not its last character */
190+
def isFlatName(name: SimpleTermName) =
191+
name.lastIndexOf('$', name.length - 2) >= 0
190192

191-
def isFlatName(classRep: ClassPath#ClassRep) = {
192-
val idx = classRep.name.indexOf('$')
193-
idx >= 0 && idx < classRep.name.length - 1
194-
}
193+
def isFlatName(classRep: ClassPath#ClassRep) =
194+
classRep.name.lastIndexOf('$', classRep.name.length - 2) >= 0
195195

196196
def maybeModuleClass(classRep: ClassPath#ClassRep) = classRep.name.last == '$'
197197

0 commit comments

Comments
 (0)