aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/tasty
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-25 16:14:50 +0100
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:10 +0200
commit624b4eb59862644646dec685833c67c64756a8bd (patch)
treefd9b747a48be37b8ad6d32d5b909a1e68d1ca849 /compiler/src/dotty/tools/dotc/core/tasty
parentf9a9ddb879e9de4730a463f28c8b6602e0e60bbc (diff)
downloaddotty-624b4eb59862644646dec685833c67c64756a8bd.tar.gz
dotty-624b4eb59862644646dec685833c67c64756a8bd.tar.bz2
dotty-624b4eb59862644646dec685833c67c64756a8bd.zip
Semantic SuperAccessor and Initializer names
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/tasty')
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala29
2 files changed, 19 insertions, 12 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala b/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala
index 19eb731c7..61a2c7fc5 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala
@@ -29,6 +29,8 @@ class NameBuffer extends TastyBuffer(10000) {
val tname = name.toTermName match {
case DerivedTermName(name1, NameInfo.ModuleClass) =>
ModuleClass(nameIndex(name1, toTasty))
+ case DerivedTermName(name1, NameInfo.SuperAccessor) =>
+ SuperAccessor(nameIndex(name1, toTasty))
case DerivedTermName(prefix, qual: NameInfo.Qualified) =>
val tcon: (NameRef, NameRef) => TastyName = qual match {
case _: NameInfo.Select => Qualified
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
index d81bd3ea8..34ce40cb0 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
@@ -60,19 +60,24 @@ class TreePickler(pickler: TastyPickler) {
}
private def pickleName(sym: Symbol)(implicit ctx: Context): Unit = {
- def encodeSuper(name: Name): TastyName.NameRef =
- if (sym is Flags.SuperAccessor) {
- val SuperAccessorName(n) = name
- nameIndex(TastyName.SuperAccessor(nameIndex(n)))
- }
- else nameIndex(name)
val nameRef =
- if (sym is Flags.ExpandedName)
- nameIndex(
- TastyName.Expanded(
- nameIndex(sym.name.expandedPrefix),
- encodeSuper(sym.name.unexpandedName)))
- else encodeSuper(sym.name)
+ if (Config.semanticNames) {
+ if (sym is Flags.ExpandedName) assert(sym.name.is(NameInfo.QualifiedKind))
+ nameIndex(sym.name)
+ }
+ else {
+ def encodeSuper(name: Name): TastyName.NameRef =
+ if (sym is Flags.SuperAccessor) {
+ val SuperAccessorName(n) = name
+ nameIndex(TastyName.SuperAccessor(nameIndex(n)))
+ } else nameIndex(name)
+ if (sym is Flags.ExpandedName)
+ nameIndex(
+ TastyName.Expanded(
+ nameIndex(sym.name.expandedPrefix),
+ encodeSuper(sym.name.unexpandedName)))
+ else encodeSuper(sym.name)
+ }
writeNat(nameRef.index)
}