Turn non-constant constants error into warning.

This commit is contained in:
chriseth
2017-03-14 19:25:16 +01:00
parent c65d506811
commit 9f328ff749
3 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -484,9 +484,10 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
if (!_variable.value())
typeError(_variable.location(), "Uninitialized \"constant\" variable.");
else if (!_variable.value()->annotation().isPure)
typeError(
warning(
_variable.value()->location(),
"Initial value for constant variable has to be compile-time constant."
"Initial value for constant variable has to be compile-time constant. "
"This will fail to compile with the next breaking version change."
);
}
if (!_variable.isStateVariable())