enabled new initialization semantics for -Xexperimental

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@15593 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
odersky 2008-07-22 18:12:53 +00:00
parent 93fc722aff
commit e922965625
1 changed files with 7 additions and 8 deletions

View File

@ -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
}