summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/transform/Constructors.scala15
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
}