diff options
author | Martin Odersky <odersky@gmail.com> | 2014-10-21 16:32:08 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-10-26 16:24:01 +0100 |
commit | f590cb3564e47f212ba0b8c6d69c2d0f86108de9 (patch) | |
tree | 357f5f2448c7859cf5ba0735089f04e98fe29e84 | |
parent | 7167c225841a8261086e42e3e8721a4059a484bb (diff) | |
download | dotty-f590cb3564e47f212ba0b8c6d69c2d0f86108de9.tar.gz dotty-f590cb3564e47f212ba0b8c6d69c2d0f86108de9.tar.bz2 dotty-f590cb3564e47f212ba0b8c6d69c2d0f86108de9.zip |
Rename flag Static -> JavaStatic
Static has two meanings: In the Java sense, and in the Scala sense, where it means
a member of a package or static module. The change makes it clear that the flag means
Static in the Java sense.
5 files changed, 12 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/core/Flags.scala b/src/dotty/tools/dotc/core/Flags.scala index a27dd6614..e5bf27eae 100644 --- a/src/dotty/tools/dotc/core/Flags.scala +++ b/src/dotty/tools/dotc/core/Flags.scala @@ -331,7 +331,9 @@ object Flags { final val JavaDefined = commonFlag(30, "<java>") /** Symbol is implemented as a Java static */ - final val Static = commonFlag(31, "<static>") + final val JavaStatic = commonFlag(31, "<static>") + final val JavaStaticTerm = JavaStatic.toTermFlags + final val JavaStaticType = JavaStatic.toTypeFlags /** Variable is accessed from nested function. */ final val Captured = termFlag(32, "<captured>") @@ -421,7 +423,7 @@ object Flags { /** Flags representing source modifiers */ final val SourceModifierFlags = commonFlags(Private, Protected, Abstract, Final, - Sealed, Case, Implicit, Override, AbsOverride, Lazy, Static) + Sealed, Case, Implicit, Override, AbsOverride, Lazy, JavaStatic) /** Flags representing modifiers that can appear in trees */ final val ModifierFlags = @@ -436,7 +438,7 @@ object Flags { /** Flags guaranteed to be set upon symbol creation */ final val FromStartFlags = AccessFlags | Module | Package | Deferred | MethodOrHKCommon | Param | ParamAccessor | Scala2ExistentialCommon | - InSuperCall | Touched | Static | CovariantOrOuter | ContravariantOrLabel | ExpandedName | AccessorOrSealed | + InSuperCall | Touched | JavaStatic | CovariantOrOuter | ContravariantOrLabel | ExpandedName | AccessorOrSealed | CaseAccessorOrTypeArgument | Fresh | Frozen | Erroneous | ImplicitCommon | Permanent | SelfNameOrImplClass @@ -473,7 +475,7 @@ object Flags { */ final val RetainedModuleValAndClassFlags: FlagSet = AccessFlags | Package | Case | - Synthetic | ExpandedName | JavaDefined | Static | Artifact | + Synthetic | ExpandedName | JavaDefined | JavaStatic | Artifact | Erroneous | Lifted | MixedIn | Specialized /** Flags that can apply to a module val */ @@ -487,7 +489,7 @@ object Flags { /** Packages and package classes always have these flags set */ final val PackageCreationFlags = - Module | Package | Final | JavaDefined | Static + Module | Package | Final | JavaDefined /** These flags are pickled */ final val PickledFlags = flagRange(FirstFlag, FirstNotPickledFlag) @@ -562,7 +564,7 @@ object Flags { final val ProtectedLocal = allOf(Protected, Local) /** Java symbol which is `protected` and `static` */ - final val StaticProtected = allOf(JavaDefined, Protected, Static) + final val StaticProtected = allOf(JavaDefined, Protected, JavaStatic) final val AbstractFinal = allOf(Abstract, Final) final val AbstractSealed = allOf(Abstract, Sealed) diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index ae37ab87c..9a5be70d1 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -390,7 +390,7 @@ object SymDenotations { /** Is this denotation static (i.e. with no outer instance)? */ final def isStatic(implicit ctx: Context) = - (this is Static) || this.exists && owner.isStaticOwner + (this is JavaStatic) || this.exists && owner.isStaticOwner /** Is this a package class or module class that defines static symbols? */ final def isStaticOwner(implicit ctx: Context): Boolean = diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileConstants.scala b/src/dotty/tools/dotc/core/pickling/ClassfileConstants.scala index c3850d0fd..c35b9ca47 100644 --- a/src/dotty/tools/dotc/core/pickling/ClassfileConstants.scala +++ b/src/dotty/tools/dotc/core/pickling/ClassfileConstants.scala @@ -343,7 +343,7 @@ object ClassfileConstants { case JAVA_ACC_PROTECTED => Protected case JAVA_ACC_FINAL => Final case JAVA_ACC_SYNTHETIC => Synthetic - case JAVA_ACC_STATIC => Static + case JAVA_ACC_STATIC => JavaStatic case JAVA_ACC_ABSTRACT => if (isAnnotation) EmptyFlags else if (isClass) Abstract else Deferred case JAVA_ACC_INTERFACE => if (isAnnotation) EmptyFlags else JavaInterface case _ => EmptyFlags diff --git a/src/dotty/tools/dotc/core/pickling/PickleBuffer.scala b/src/dotty/tools/dotc/core/pickling/PickleBuffer.scala index ef2b4acb2..d2a05bf3a 100644 --- a/src/dotty/tools/dotc/core/pickling/PickleBuffer.scala +++ b/src/dotty/tools/dotc/core/pickling/PickleBuffer.scala @@ -236,7 +236,7 @@ object PickleBuffer { JAVA -> JavaDefined, SYNTHETIC -> Synthetic, STABLE -> Stable, - STATIC -> Static, + STATIC -> JavaStatic, CASEACCESSOR -> CaseAccessor, DEFAULTPARAM -> (DefaultParameterized, Trait), BRIDGE -> Bridge, diff --git a/src/dotty/tools/dotc/transform/LambdaLift.scala b/src/dotty/tools/dotc/transform/LambdaLift.scala index a08df1c33..4a59be45a 100644 --- a/src/dotty/tools/dotc/transform/LambdaLift.scala +++ b/src/dotty/tools/dotc/transform/LambdaLift.scala @@ -257,7 +257,7 @@ class LambdaLift extends MiniPhaseTransform with IdentityDenotTransformer { this private def liftLocals()(implicit ctx: Context): Unit = { for ((local, lOwner) <- liftedOwner) { val (newOwner, maybeStatic) = - if (lOwner is Package) (local.topLevelClass, Static) + if (lOwner is Package) (local.topLevelClass, JavaStatic) else (lOwner, EmptyFlags) val maybeNotJavaPrivate = if (calledFromInner(local)) NotJavaPrivate else EmptyFlags local.copySymDenotation( |