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:
parent
93fc722aff
commit
e922965625
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue