From 9f328ff749477106a569e679e5eeed5c7e78d29d Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 14 Mar 2017 19:25:16 +0100 Subject: Turn non-constant constants error into warning. --- libsolidity/analysis/TypeChecker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libsolidity/analysis') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 41636db7..8e7ec29b 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -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()) -- cgit