diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-01-30 00:58:26 +0300 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-14 23:51:21 +0100 |
commit | da09331324d302d0b85a89cdcfe32ded2587b39a (patch) | |
tree | 378d9c217e92e6c47af057a4c7bf85b91408c855 | |
parent | 465e538ef59171ac7d9e811dbdaec776f8a64ac7 (diff) | |
download | scala-da09331324d302d0b85a89cdcfe32ded2587b39a.tar.gz scala-da09331324d302d0b85a89cdcfe32ded2587b39a.tar.bz2 scala-da09331324d302d0b85a89cdcfe32ded2587b39a.zip |
SI-6732 deprecates internal#Symbol.isPackage
This is the first step in disentangling api#Symbol.isPackage, which is
supposed to return false for package classes, and internal#Symbol.isPackage,
which has traditionally being used as a synonym for hasPackageFlag and
hence returned true for package classes (unlike isModule which is false
for module classes).
21 files changed, 57 insertions, 41 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index a82407ea42..5ce0238b3b 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1353,7 +1353,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) val toReload = mutable.Set[String]() for (sym <- root.info.decls) { if (sym.isInitialized && clearOnNextRun(sym)) - if (sym.isPackage) { + if (sym.hasPackageFlag) { resetProjectClasses(sym.moduleClass) openPackageModule(sym.moduleClass) } else { diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index b650cdfa09..81fbbfcabf 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -869,7 +869,7 @@ abstract class GenICode extends SubComponent { case Ident(name) => def genLoadIdent = { val sym = tree.symbol - if (!sym.isPackage) { + if (!sym.hasPackageFlag) { if (sym.isModule) { genLoadModule(ctx, tree) generatedType = toTypeKind(sym.info) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala index c8845344e9..53142fbd87 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala @@ -350,7 +350,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { case Ident(name) => val sym = tree.symbol - if (!sym.isPackage) { + if (!sym.hasPackageFlag) { val tk = symInfoTK(sym) if (sym.isModule) { genLoadModule(tree) } else { locals.load(sym) } diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 2f9cc01c0b..ea600bc586 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -561,14 +561,14 @@ abstract class ClassfileParser { // if this is a non-static inner class, remove the explicit outer parameter val paramsNoOuter = innerClasses getEntry currentClass match { case Some(entry) if !isScalaRaw && !entry.jflags.isStatic => - /* About `clazz.owner.isPackage` below: SI-5957 + /* About `clazz.owner.hasPackageFlag` below: SI-5957 * For every nested java class A$B, there are two symbols in the scala compiler. * 1. created by SymbolLoader, because of the existence of the A$B.class file, owner: package * 2. created by ClassfileParser of A when reading the inner classes, owner: A * If symbol 1 gets completed (e.g. because the compiled source mentions `A$B`, not `A#B`), the * ClassfileParser for 1 executes, and clazz.owner is the package. */ - assert(params.head.tpe.typeSymbol == clazz.owner || clazz.owner.isPackage, params.head.tpe.typeSymbol + ": " + clazz.owner) + assert(params.head.tpe.typeSymbol == clazz.owner || clazz.owner.hasPackageFlag, params.head.tpe.typeSymbol + ": " + clazz.owner) params.tail case _ => params diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index a66925b948..6e9e16ffc9 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -977,7 +977,7 @@ trait Contexts { self: Analyzer => // 2) sym.owner is inherited by the correct package object class // We try to establish 1) by inspecting the owners directly, and then we try // to rule out 2), and only if both those fail do we resort to looking in the info. - !sym.isPackage && sym.owner.exists && ( + !sym.hasPackageFlag && sym.owner.exists && ( if (sym.owner.isPackageObjectClass) sym.owner.owner == pkgClass else diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 0977e8cd4d..d3b5564f60 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -402,8 +402,8 @@ trait Implicits { } def complexity(tp: Type): Int = tp.dealias match { case NoPrefix => 0 - case SingleType(pre, sym) => if (sym.isPackage) 0 else complexity(tp.dealiasWiden) - case ThisType(sym) => if (sym.isPackage) 0 else 1 + case SingleType(pre, sym) => if (sym.hasPackageFlag) 0 else complexity(tp.dealiasWiden) + case ThisType(sym) => if (sym.hasPackageFlag) 0 else 1 case TypeRef(pre, sym, args) => complexity(pre) + (args map complexity).sum + 1 case RefinedType(parents, _) => (parents map complexity).sum + 1 case _ => 1 diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 9b5b0e1f37..23dc57d5b9 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -374,7 +374,7 @@ trait Namers extends MethodSynthesis { } val existing = pkgOwner.info.decls.lookup(pid.name) - if (existing.isPackage && pkgOwner == existing.owner) + if (existing.hasPackageFlag && pkgOwner == existing.owner) existing else { val pkg = pkgOwner.newPackage(pid.name.toTermName, pos) diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index 06f9667ef0..87da565142 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -71,7 +71,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT acc setInfoAndEnter (tpe cloneInfo acc) // Diagnostic for SI-7091 if (!accDefs.contains(clazz)) - reporter.error(sel.pos, s"Internal error: unable to store accessor definition in ${clazz}. clazz.isPackage=${clazz.isPackage}. Accessor required for ${sel} (${showRaw(sel)})") + reporter.error(sel.pos, s"Internal error: unable to store accessor definition in ${clazz}. clazz.hasPackageFlag=${clazz.hasPackageFlag}. Accessor required for ${sel} (${showRaw(sel)})") else storeAccessorDefinition(clazz, DefDef(acc, EmptyTree)) acc } diff --git a/src/reflect/scala/reflect/api/Symbols.scala b/src/reflect/scala/reflect/api/Symbols.scala index 663eb97c58..9831420749 100644 --- a/src/reflect/scala/reflect/api/Symbols.scala +++ b/src/reflect/scala/reflect/api/Symbols.scala @@ -457,7 +457,7 @@ trait Symbols { self: Universe => def privateWithin: Symbol /** Does this symbol represent the definition of a package? - * If yes, `isTerm` is also guaranteed to be true. + * Known issues: [[https://issues.scala-lang.org/browse/SI-6732]]. * * @group Tests */ diff --git a/src/reflect/scala/reflect/internal/HasFlags.scala b/src/reflect/scala/reflect/internal/HasFlags.scala index 8915524bde..aa8f4c532e 100644 --- a/src/reflect/scala/reflect/internal/HasFlags.scala +++ b/src/reflect/scala/reflect/internal/HasFlags.scala @@ -108,6 +108,7 @@ trait HasFlags { def isOverride = hasFlag(OVERRIDE) def isParamAccessor = hasFlag(PARAMACCESSOR) def isPrivate = hasFlag(PRIVATE) + @deprecated ("Use `hasPackageFlag` instead", "2.11.0") def isPackage = hasFlag(PACKAGE) def isPrivateLocal = hasAllFlags(PrivateLocal) def isProtected = hasFlag(PROTECTED) diff --git a/src/reflect/scala/reflect/internal/Mirrors.scala b/src/reflect/scala/reflect/internal/Mirrors.scala index 6cf4944d18..aef99b0ed4 100644 --- a/src/reflect/scala/reflect/internal/Mirrors.scala +++ b/src/reflect/scala/reflect/internal/Mirrors.scala @@ -123,8 +123,8 @@ trait Mirrors extends api.Mirrors { private def ensureModuleSymbol(fullname: String, sym: Symbol, allowPackages: Boolean): ModuleSymbol = sym match { - case x: ModuleSymbol if allowPackages || !x.isPackage => x - case _ => MissingRequirementError.notFound("object " + fullname) + case x: ModuleSymbol if allowPackages || !x.hasPackageFlag => x + case _ => MissingRequirementError.notFound("object " + fullname) } def getModuleByName(fullname: Name): ModuleSymbol = @@ -161,8 +161,8 @@ trait Mirrors extends api.Mirrors { private def ensurePackageSymbol(fullname: String, sym: Symbol, allowModules: Boolean): ModuleSymbol = sym match { - case x: ModuleSymbol if allowModules || x.isPackage => x - case _ => MissingRequirementError.notFound("package " + fullname) + case x: ModuleSymbol if allowModules || x.hasPackageFlag => x + case _ => MissingRequirementError.notFound("package " + fullname) } def getPackage(fullname: TermName): ModuleSymbol = @@ -186,13 +186,13 @@ trait Mirrors extends api.Mirrors { def getPackageObjectIfDefined(fullname: TermName): Symbol = wrapMissing(getPackageObject(fullname)) - + final def getPackageObjectWithMember(pre: Type, sym: Symbol): Symbol = { // The owner of a symbol which requires package qualification may be the // package object iself, but it also could be any superclass of the package // object. In the latter case, we must go through the qualifier's info // to obtain the right symbol. - if (sym.owner.isModuleClass) sym.owner.sourceModule // fast path, if the member is owned by a module class, that must be linked to the package object + if (sym.owner.isModuleClass) sym.owner.sourceModule // fast path, if the member is owned by a module class, that must be linked to the package object else pre member nme.PACKAGE // otherwise we have to findMember } diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index f8f9dbb7ef..63a69e2797 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -2424,7 +2424,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => else if (isClass) "class" else if (isType && !isParameter) "type" else if (isVariable) "var" - else if (isPackage) "package" + else if (hasPackageFlag) "package" else if (isModule) "object" else if (isSourceMethod) "def" else if (isTerm && (!isParameter || isParamAccessor)) "val" @@ -2435,8 +2435,8 @@ trait Symbols extends api.Symbols { self: SymbolTable => if (isTermMacro) ("term macro", "macro method", "MACM") else if (isInstanceOf[FreeTermSymbol]) ("free term", "free term", "FTE") else if (isInstanceOf[FreeTypeSymbol]) ("free type", "free type", "FTY") - else if (isPackage) ("package", "package", "PK") else if (isPackageClass) ("package class", "package", "PKC") + else if (isPackage) ("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") @@ -2660,7 +2660,6 @@ trait Symbols extends api.Symbols { self: SymbolTable => (infos ne null) && infos.info.isInstanceOf[OverloadedType] ) ***/ - override def isPackage = this hasFlag PACKAGE override def isValueParameter = this hasFlag PARAM override def isSetterParameter = isValueParameter && owner.isSetter diff --git a/src/reflect/scala/reflect/internal/TreeGen.scala b/src/reflect/scala/reflect/internal/TreeGen.scala index 29fdba2781..9de5c1a7ea 100644 --- a/src/reflect/scala/reflect/internal/TreeGen.scala +++ b/src/reflect/scala/reflect/internal/TreeGen.scala @@ -186,7 +186,7 @@ abstract class TreeGen extends macros.TreeBuilder { ) val needsPackageQualifier = ( (sym ne null) - && qualsym.isPackage + && qualsym.hasPackageFlag && !(sym.isDefinedInPackage || sym.moduleClass.isDefinedInPackage) // SI-7817 work around strangeness in post-flatten `Symbol#owner` ) val pkgQualifier = diff --git a/src/reflect/scala/reflect/internal/Variances.scala b/src/reflect/scala/reflect/internal/Variances.scala index ea301fba1c..ca43fdcb63 100644 --- a/src/reflect/scala/reflect/internal/Variances.scala +++ b/src/reflect/scala/reflect/internal/Variances.scala @@ -36,7 +36,7 @@ trait Variances { * @pre sym.isLocalToThis */ @tailrec final def checkForEscape(sym: Symbol, site: Symbol) { - if (site == sym.owner || site == sym.owner.moduleClass || site.isPackage) () // done + if (site == sym.owner || site == sym.owner.moduleClass || site.hasPackageFlag) () // done else if (site.isTerm || site.isPrivateLocal) checkForEscape(sym, site.owner) // ok - recurse to owner else escapedLocals += sym } diff --git a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala index 07c9242bf3..6d83032c2d 100644 --- a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala +++ b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala @@ -1099,7 +1099,7 @@ private[internal] trait TypeMaps { tp } case SingleType(pre, sym) => - if (sym.isPackage) tp + if (sym.hasPackageFlag) tp else { val pre1 = this(pre) try { diff --git a/src/reflect/scala/reflect/runtime/JavaMirrors.scala b/src/reflect/scala/reflect/runtime/JavaMirrors.scala index 1e64b805e9..963e4dd3be 100644 --- a/src/reflect/scala/reflect/runtime/JavaMirrors.scala +++ b/src/reflect/scala/reflect/runtime/JavaMirrors.scala @@ -935,7 +935,7 @@ private[scala] trait JavaMirrors extends internal.SymbolTable with api.JavaUnive val owner = ownerModule.moduleClass val name = (fullname: TermName) drop split + 1 val opkg = owner.info decl name - if (opkg.isPackage) + if (opkg.hasPackageFlag) opkg.asModule else if (opkg == NoSymbol) { val pkg = owner.newPackage(name) diff --git a/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala index 53c7c82e89..c1122d4223 100644 --- a/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala +++ b/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala @@ -48,7 +48,7 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput // compiler to crash for reasons not yet known. def members = exitingTyper((effectiveTp.nonPrivateMembers.toList ++ anyMembers) filter (_.isPublic)) def methods = members.toList filter (_.isMethod) - def packages = members.toList filter (_.isPackage) + def packages = members.toList filter (_.hasPackageFlag) def aliases = members.toList filter (_.isAliasType) def memberNames = members map tos diff --git a/test/files/run/reflection-companiontype.check b/test/files/run/reflection-companiontype.check index e25605618f..f87bc04480 100644 --- a/test/files/run/reflection-companiontype.check +++ b/test/files/run/reflection-companiontype.check @@ -1,11 +1,11 @@ TypeRefs -TypeRef(ThisType(<empty>#PK), C#MODC, List()) -TypeRef(ThisType(<empty>#PK), C#CLS, List()) -TypeRef(ThisType(<empty>#PK), C#CLS, List()) +TypeRef(ThisType(<empty>#PKC), C#MODC, List()) +TypeRef(ThisType(<empty>#PKC), C#CLS, List()) +TypeRef(ThisType(<empty>#PKC), C#CLS, List()) ClassInfoTypes -TypeRef(ThisType(<empty>#PK), C#MODC, List()) -TypeRef(ThisType(<empty>#PK), C#CLS, List()) -TypeRef(ThisType(<empty>#PK), C#CLS, List()) +TypeRef(ThisType(<empty>#PKC), C#MODC, List()) +TypeRef(ThisType(<empty>#PKC), C#CLS, List()) +TypeRef(ThisType(<empty>#PKC), C#CLS, List()) Unrelated NoType NoType diff --git a/test/files/run/showraw_tree_ultimate.check b/test/files/run/showraw_tree_ultimate.check index 63f72de50b..ea64d5a7d2 100644 --- a/test/files/run/showraw_tree_ultimate.check +++ b/test/files/run/showraw_tree_ultimate.check @@ -1,12 +1,12 @@ Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap#<id>#CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE)))))), nme.CONSTRUCTOR#<id>#PCTOR), List()) -[1] TypeRef(ThisType(scala.collection.immutable#<id>#PK), scala.collection.immutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()))) -[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable#<id>#PK), scala.collection.immutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List())))) -[3] TypeRef(ThisType(scala.collection.immutable#<id>#PK), scala.collection.immutable.HashMap#<id>#CLS, List()) -[4] TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()) -[5] SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD) +[1] TypeRef(ThisType(scala.collection.immutable#<id>#PKC), scala.collection.immutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable#<id>#PKC), scala.collection.immutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List())))) +[3] TypeRef(ThisType(scala.collection.immutable#<id>#PKC), scala.collection.immutable.HashMap#<id>#CLS, List()) +[4] TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()) +[5] SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD) Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap#<id>#CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE)))))), nme.CONSTRUCTOR#<id>#CTOR), List()) -[4] TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()) -[5] SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD) -[6] TypeRef(ThisType(scala.collection.mutable#<id>#PK), scala.collection.mutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()))) -[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#<id>#PK), scala.collection.mutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PK), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List())))) -[8] TypeRef(ThisType(scala.collection.mutable#<id>#PK), scala.collection.mutable.HashMap#<id>#CLS, List()) +[4] TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()) +[5] SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD) +[6] TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()))) +[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List(TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List()), TypeRef(SingleType(ThisType(scala#<id>#PKC), scala.Predef#<id>#MOD), TypeName("String")#<id>#TPE, List())))) +[8] TypeRef(ThisType(scala.collection.mutable#<id>#PKC), scala.collection.mutable.HashMap#<id>#CLS, List()) diff --git a/test/files/run/t6732.check b/test/files/run/t6732.check new file mode 100644 index 0000000000..016c6e50c0 --- /dev/null +++ b/test/files/run/t6732.check @@ -0,0 +1,4 @@ +scala#PK: true, false, true, false +scala#PKC: false, true, true, true +scala.collection.immutable.List#MOD: true, false, false, false +scala.collection.immutable.List#MODC: false, true, false, false diff --git a/test/files/run/t6732.scala b/test/files/run/t6732.scala new file mode 100644 index 0000000000..fdc1ab04e6 --- /dev/null +++ b/test/files/run/t6732.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import definitions._ + +object Test extends App { + def test(sym: Symbol): Unit = { + println(s"${showRaw(sym, printKinds = true)}: ${sym.isModule}, ${sym.isModuleClass}, ${sym.isPackage}, ${sym.isPackageClass}") + } + test(ScalaPackage) + test(ScalaPackageClass) + test(ListModule) + test(ListModule.moduleClass) +}
\ No newline at end of file |