From a7ee8dc999f415dbbed9c4e60bf4ade1cf8a94eb Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 1 Apr 2017 20:14:19 +0200 Subject: Avoid setter in Name and fix a bug in TreeUnpickler --- compiler/src/dotty/tools/dotc/core/Names.scala | 2 +- compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala index 6caba33ec..cef55a482 100644 --- a/compiler/src/dotty/tools/dotc/core/Names.scala +++ b/compiler/src/dotty/tools/dotc/core/Names.scala @@ -346,7 +346,7 @@ object Names { def isSimple = false def asSimpleName = throw new UnsupportedOperationException(s"$debugString is not a simple name") - private var simpleName: SimpleTermName = null + private[this] var simpleName: SimpleTermName = null def toSimpleName = { if (simpleName == null) simpleName = termName(toString) simpleName diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 7d08c958c..2908c541e 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -416,8 +416,8 @@ class TreeUnpickler(reader: TastyReader, nameAtRef: NameRef => TermName, posUnpi val tag = readByte() val end = readEnd() var name: Name = readName() - val mname = name.mangled if (tag == TYPEDEF || tag == TYPEPARAM) name = name.toTypeName + val mname = name.mangled skipParams() val ttag = nextUnsharedTag val isAbsType = isAbstractType(ttag) -- cgit v1.2.3