diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-28 21:57:47 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-28 21:57:47 +0000 |
commit | b3889b68af7aa2bcc31a4d6b9e1e6fba5d4e1757 (patch) | |
tree | a67498e8a31daac9919836755d5a9b56b285514a | |
parent | c1efef726cb2d9b4b116d06290b15d42408f359f (diff) | |
download | scala-b3889b68af7aa2bcc31a4d6b9e1e6fba5d4e1757.tar.gz scala-b3889b68af7aa2bcc31a4d6b9e1e6fba5d4e1757.tar.bz2 scala-b3889b68af7aa2bcc31a4d6b9e1e6fba5d4e1757.zip |
Eliminated option -Xwarninit, which is warning ...
Eliminated option -Xwarninit, which is warning about a change which took
place 2.5 years ago and is only likely to add to option confusion at
this point. No review. (But let me know if we still need this for some
reason: many more of our options should be culled.)
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/ScalaSettings.scala | 1 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Constructors.scala | 20 |
2 files changed, 2 insertions, 19 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala index 14915da9ba..0ba0e59fea 100644 --- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala @@ -79,7 +79,6 @@ trait ScalaSettings extends AbsScalaSettings with StandardScalaSettings { val sourceReader = StringSetting ("-Xsource-reader", "classname", "Specify a custom method for reading source files.", "") val Xwarnfatal = BooleanSetting ("-Xfatal-warnings", "Fail the compilation if there are any warnings.") - val Xwarninit = BooleanSetting ("-Xwarninit", "Warn about possible changes in initialization semantics.") val Xchecknull = BooleanSetting ("-Xcheck-null", "Emit warning on selection of nullable reference.") // Experimental Extensions diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala index a9e4c01d9f..75c35ffb49 100644 --- a/src/compiler/scala/tools/nsc/transform/Constructors.scala +++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala @@ -70,7 +70,6 @@ abstract class Constructors extends Transform with ast.TreeDSL { } } - var thisRefSeen: Boolean = false var usesSpecializedField: Boolean = false // A transformer for expressions that go into the constructor @@ -95,16 +94,9 @@ abstract class Constructors extends Transform with ast.TreeDSL { // references to parameter accessor field of own class become references to parameters gen.mkAttributedIdent(parameter(tree.symbol)) setPos tree.pos case Select(_, _) => - thisRefSeen = true if (specializeTypes.specializedTypeVars(tree.symbol).nonEmpty) usesSpecializedField = true super.transform(tree) - case This(_) => - thisRefSeen = true - super.transform(tree) - case Super(_, _) => - thisRefSeen = true - super.transform(tree) case _ => super.transform(tree) } @@ -117,16 +109,8 @@ abstract class Constructors extends Transform with ast.TreeDSL { // Should tree be moved in front of super constructor call? def canBeMoved(tree: Tree) = tree match { - //todo: eliminate thisRefSeen - case ValDef(mods, _, _, _) => - if (settings.Xwarninit.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.future.value && !settings.checkInit.value) - case _ => false + case ValDef(mods, _, _, _) => (mods hasFlag PRESUPER | PARAMACCESSOR) + case _ => false } // Create an assignment to class field `to' with rhs `from' |