aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing/PlainPrinter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-11-07 12:58:33 +0100
committerMartin Odersky <odersky@gmail.com>2015-11-09 15:45:37 +0100
commit8978ae6dfabae562fb5dcf4c7f66983d4d865892 (patch)
tree999cd971a10b46ec307c550a5af464329495c6c9 /src/dotty/tools/dotc/printing/PlainPrinter.scala
parentf2b61ce055fccf96e305ef43fca8abef8a912f33 (diff)
downloaddotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.tar.gz
dotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.tar.bz2
dotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.zip
First versions of Definitions based on TypeRefs not Symbols.
Symbols are not stable between runs, so if some symbol referred to from Definitions gets recompiled, there are then two Symbols that are both visible, one referenced from Definitions, the other the one that got compiled. Thos led to a crash when e.g. compiling scala.Short, because the newly compiled symbol was not recognized as a primitive value class. The present commit tries to make systematic changes without regard to simplicity or aesthetics. This will be polished in future commits. // ### comments signal areas that need further attention.
Diffstat (limited to 'src/dotty/tools/dotc/printing/PlainPrinter.scala')
-rw-r--r--src/dotty/tools/dotc/printing/PlainPrinter.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala
index 5daef9fb8..8b2d68570 100644
--- a/src/dotty/tools/dotc/printing/PlainPrinter.scala
+++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -245,10 +245,10 @@ class PlainPrinter(_ctx: Context) extends Printer {
}
}
- protected def isOmittablePrefix(sym: Symbol) =
- (defn.UnqualifiedOwners contains sym) || isEmptyPrefix(sym)
+ protected def isOmittablePrefix(sym: Symbol): Boolean =
+ defn.UnqualifiedOwnerTypes.exists(_.symbol == sym) || isEmptyPrefix(sym)
- protected def isEmptyPrefix(sym: Symbol) =
+ protected def isEmptyPrefix(sym: Symbol): Boolean =
sym.isEffectiveRoot || sym.isAnonymousClass || sym.name.isReplWrapperName
/** String representation of a definition's type following its name,