diff options
author | chriseth <c@ethdev.com> | 2017-03-15 02:25:16 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-03-15 02:25:16 +0800 |
commit | 9f328ff749477106a569e679e5eeed5c7e78d29d (patch) | |
tree | 4ed950ef68eb3e0b4a0810f80b3951124d9ee6d7 /libsolidity | |
parent | c65d50681117edb96f6b1387f5a88de160811d38 (diff) | |
download | dexon-solidity-9f328ff749477106a569e679e5eeed5c7e78d29d.tar dexon-solidity-9f328ff749477106a569e679e5eeed5c7e78d29d.tar.gz dexon-solidity-9f328ff749477106a569e679e5eeed5c7e78d29d.tar.bz2 dexon-solidity-9f328ff749477106a569e679e5eeed5c7e78d29d.tar.lz dexon-solidity-9f328ff749477106a569e679e5eeed5c7e78d29d.tar.xz dexon-solidity-9f328ff749477106a569e679e5eeed5c7e78d29d.tar.zst dexon-solidity-9f328ff749477106a569e679e5eeed5c7e78d29d.zip |
Turn non-constant constants error into warning.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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()) |