From 8978ae6dfabae562fb5dcf4c7f66983d4d865892 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 7 Nov 2015 12:58:33 +0100 Subject: 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. --- src/dotty/tools/dotc/printing/PlainPrinter.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/printing/PlainPrinter.scala') 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, -- cgit v1.2.3