From e5bfc1c097e8dea9e0643e4a43743196209e9ba8 Mon Sep 17 00:00:00 2001 From: Simon Ochsenreither Date: Sat, 29 Nov 2014 03:44:05 +0100 Subject: Deprecations: Use of isPackage, hasSymbol, getter, setter... ... replaced by hasPackageFlag, hasSymbolIn, getterIn, setterIn. --- src/reflect/scala/reflect/internal/Printers.scala | 4 ++-- src/reflect/scala/reflect/internal/Symbols.scala | 26 +++++++++++------------ src/reflect/scala/reflect/internal/Types.scala | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) (limited to 'src/reflect') diff --git a/src/reflect/scala/reflect/internal/Printers.scala b/src/reflect/scala/reflect/internal/Printers.scala index 98b2c48379..b44c4022f6 100644 --- a/src/reflect/scala/reflect/internal/Printers.scala +++ b/src/reflect/scala/reflect/internal/Printers.scala @@ -1006,7 +1006,7 @@ trait Printers extends api.Printers { self: SymbolTable => printSuper(st, printedName(qual), checkSymbol = false) case th @ This(qual) => - if (tree.hasExistingSymbol && tree.symbol.isPackage) print(tree.symbol.fullName) + if (tree.hasExistingSymbol && tree.symbol.hasPackageFlag) print(tree.symbol.fullName) else printThis(th, printedName(qual)) // remove this prefix from constructor invocation in typechecked trees: this.this -> this @@ -1023,7 +1023,7 @@ trait Printers extends api.Printers { self: SymbolTable => }) && (tr match { // check that Select contains package case Select(q, _) => checkRootPackage(q) case _: Ident | _: This => val sym = tr.symbol - tr.hasExistingSymbol && sym.isPackage && sym.name != nme.ROOTPKG + tr.hasExistingSymbol && sym.hasPackageFlag && sym.name != nme.ROOTPKG case _ => false }) diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index d23a102b28..5e47f127d4 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -155,11 +155,11 @@ trait Symbols extends api.Symbols { self: SymbolTable => def toTypeConstructor: Type = typeConstructor def setAnnotations(annots: AnnotationInfo*): this.type = { setAnnotations(annots.toList); this } - def getter: Symbol = getter(owner) - def setter: Symbol = setter(owner) + def getter: Symbol = getterIn(owner) + def setter: Symbol = setterIn(owner) def companion: Symbol = { - if (isModule && !isPackage) companionSymbol + if (isModule && !hasPackageFlag) companionSymbol else if (isModuleClass && !isPackageClass) sourceModule.companionSymbol else if (isClass && !isModuleClass && !isPackageClass) companionSymbol else NoSymbol @@ -1047,7 +1047,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => final def isIncompleteIn(base: Symbol): Boolean = this.isDeferred || (this hasFlag ABSOVERRIDE) && { - val supersym = superSymbol(base) + val supersym = superSymbolIn(base) supersym == NoSymbol || supersym.isIncompleteIn(base) } @@ -2375,13 +2375,13 @@ trait Symbols extends api.Symbols { self: SymbolTable => Nil ) + @deprecated("Use `superSymbolIn` instead", "2.11.0") + final def superSymbol(base: Symbol): Symbol = superSymbolIn(base) + /** The symbol accessed by a super in the definition of this symbol when * seen from class `base`. This symbol is always concrete. * pre: `this.owner` is in the base class sequence of `base`. */ - @deprecated("Use `superSymbolIn` instead", "2.11.0") - final def superSymbol(base: Symbol): Symbol = superSymbolIn(base) - final def superSymbolIn(base: Symbol): Symbol = { var bcs = base.info.baseClasses dropWhile (owner != _) drop 1 var sym: Symbol = NoSymbol @@ -2393,12 +2393,10 @@ trait Symbols extends api.Symbols { self: SymbolTable => sym } - /** The getter of this value or setter definition in class `base`, or NoSymbol if - * none exists. - */ @deprecated("Use `getterIn` instead", "2.11.0") final def getter(base: Symbol): Symbol = getterIn(base) + /** The getter of this value or setter definition in class `base`, or NoSymbol if none exists. */ final def getterIn(base: Symbol): Symbol = base.info decl getterName filter (_.hasAccessorFlag) @@ -2406,11 +2404,11 @@ trait Symbols extends api.Symbols { self: SymbolTable => def setterName: TermName = name.setterName def localName: TermName = name.localName - /** The setter of this value or getter definition, or NoSymbol if none exists */ @deprecated("Use `setterIn` instead", "2.11.0") final def setter(base: Symbol, hasExpandedName: Boolean = needsExpandedSetterName): Symbol = setterIn(base, hasExpandedName) + /** The setter of this value or getter definition, or NoSymbol if none exists. */ final def setterIn(base: Symbol, hasExpandedName: Boolean = needsExpandedSetterName): Symbol = base.info decl setterNameInBase(base, hasExpandedName) filter (_.hasAccessorFlag) @@ -2538,7 +2536,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => else if (isInstanceOf[FreeTermSymbol]) ("free term", "free term", "FTE") else if (isInstanceOf[FreeTypeSymbol]) ("free type", "free type", "FTY") else if (isPackageClass) ("package class", "package", "PKC") - else if (isPackage) ("package", "package", "PK") + else if (hasPackageFlag) ("package", "package", "PK") else if (isPackageObject) ("package object", "package", "PKO") else if (isPackageObjectClass) ("package object class", "package", "PKOC") else if (isAnonymousClass) ("anonymous class", "anonymous class", "AC") @@ -2852,8 +2850,8 @@ trait Symbols extends api.Symbols { self: SymbolTable => accessed.expandName(base) } else if (hasGetter) { - getter(owner).expandName(base) - setter(owner).expandName(base) + getterIn(owner).expandName(base) + setterIn(owner).expandName(base) } name = nme.expandedName(name.toTermName, base) } diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 8f114caac0..ad2a545587 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -247,7 +247,7 @@ trait Types def companion = { val sym = typeSymbolDirect - if (sym.isModule && !sym.isPackage) sym.companionSymbol.tpe + if (sym.isModule && !sym.hasPackageFlag) sym.companionSymbol.tpe else if (sym.isModuleClass && !sym.isPackageClass) sym.sourceModule.companionSymbol.tpe else if (sym.isClass && !sym.isModuleClass && !sym.isPackageClass) sym.companionSymbol.info else NoType -- cgit v1.2.3