diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-09-14 10:45:46 +0200 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-09-17 20:26:08 +0200 |
commit | 585069c0b65070d5fef0a58e455ad0ffe4390215 (patch) | |
tree | bed317852a187865d0dbfc0e7de648030b69bd45 /src/compiler/scala/tools/nsc/transform/CleanUp.scala | |
parent | 6b9e1a0747159128da1e84795c1be6698e16ee43 (diff) | |
download | scala-585069c0b65070d5fef0a58e455ad0ffe4390215.tar.gz scala-585069c0b65070d5fef0a58e455ad0ffe4390215.tar.bz2 scala-585069c0b65070d5fef0a58e455ad0ffe4390215.zip |
Revert "WIP add private/lazy checks and a few tests."
This reverts commit 227239018b38ab7218ee6b30493c9c8e1836c8c9.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/CleanUp.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index a705e85310..f71a55bf91 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -557,23 +557,12 @@ abstract class CleanUp extends Transform with ast.TreeDSL { val owner = sym.owner val staticBeforeLifting = atPhase(currentRun.erasurePhase) { owner.isStatic } - val isPrivate = atPhase(currentRun.typerPhase) { sym.getter(owner).hasFlag(PRIVATE) } - val isProtected = atPhase(currentRun.typerPhase) { sym.getter(owner).hasFlag(PROTECTED) } - val isLazy = atPhase(currentRun.typerPhase) { sym.getter(owner).hasFlag(LAZY) } if (!owner.isModuleClass || !staticBeforeLifting) { if (!sym.isSynthetic) { reporter.error(tree.pos, "Only members of top-level objects and their nested objects can be annotated with @static.") tree.symbol.removeAnnotation(StaticClass) } super.transform(tree) - } else if (isPrivate || isProtected) { - reporter.error(tree.pos, "The @static annotation is only allowed on public members.") - tree.symbol.removeAnnotation(StaticClass) - super.transform(tree) - } else if (isLazy) { - reporter.error(tree.pos, "The @static annotation is not allowed on lazy members.") - tree.symbol.removeAnnotation(StaticClass) - super.transform(tree) } else if (owner.isModuleClass) { val linkedClass = owner.companionClass match { case NoSymbol => |