diff options
author | Martin Odersky <odersky@gmail.com> | 2008-07-22 18:12:53 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-07-22 18:12:53 +0000 |
commit | fe07aac5bbd19485134bef22d78b29690d5f8e8e (patch) | |
tree | 76273d58b481c7cac2f3a78af3cf56f71e63d47e /src | |
parent | cca42c1c3b29089a3fb626a1846c1efefeeef159 (diff) | |
download | scala-fe07aac5bbd19485134bef22d78b29690d5f8e8e.tar.gz scala-fe07aac5bbd19485134bef22d78b29690d5f8e8e.tar.bz2 scala-fe07aac5bbd19485134bef22d78b29690d5f8e8e.zip |
enabled new initialization semantics for -Xexpe...
enabled new initialization semantics for -Xexperimental
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Constructors.scala | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala index 5cb86b61fc..78ecd9a158 100644 --- a/src/compiler/scala/tools/nsc/transform/Constructors.scala +++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala @@ -108,14 +108,13 @@ abstract class Constructors extends Transform { def canBeMoved(tree: Tree) = tree match { //todo: eliminate thisRefSeen case ValDef(mods, _, _, _) => -/* - if (!(mods hasFlag PRESUPER | PARAMACCESSOR) && !thisRefSeen && - { val g = tree.symbol.getter(tree.symbol.owner); - g != NoSymbol && !g.allOverriddenSymbols.isEmpty - }) - unit.warning(tree.pos, "the semantics of this definition will change; the initialization will no longer be executed before the superclass is called") -*/ - (mods hasFlag PRESUPER | PARAMACCESSOR) || !thisRefSeen + if (settings.Xexperimental.value) + if (!(mods hasFlag PRESUPER | PARAMACCESSOR) && !thisRefSeen && + { val g = tree.symbol.getter(tree.symbol.owner); + g != NoSymbol && !g.allOverriddenSymbols.isEmpty + }) + unit.warning(tree.pos, "the semantics of this definition has changed;\nthe initialization is no longer be executed before the superclass is called") + (mods hasFlag PRESUPER | PARAMACCESSOR) || !thisRefSeen && !settings.Xexperimental.value case _ => false } |