Skip to content

Commit 19431fb

Browse files
committed
Avoid setter in Name
and fix a bug in TreeUnpickler
1 parent 59824d9 commit 19431fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ object Names {
346346
def isSimple = false
347347
def asSimpleName = throw new UnsupportedOperationException(s"$debugString is not a simple name")
348348

349-
private var simpleName: SimpleTermName = null
349+
private[this] var simpleName: SimpleTermName = null
350350
def toSimpleName = {
351351
if (simpleName == null) simpleName = termName(toString)
352352
simpleName

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,8 @@ class TreeUnpickler(reader: TastyReader, nameAtRef: NameRef => TermName, posUnpi
421421
val tag = readByte()
422422
val end = readEnd()
423423
var name: Name = readName()
424-
val mname = name.mangled
425424
if (tag == TYPEDEF || tag == TYPEPARAM) name = name.toTypeName
425+
val mname = name.mangled
426426
skipParams()
427427
val ttag = nextUnsharedTag
428428
val isAbsType = isAbstractType(ttag)

0 commit comments

Comments
 (0)