diff options
author | chriseth <chris@ethereum.org> | 2018-04-24 18:12:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 18:12:03 +0800 |
commit | d1e1293fbd852149edfd03fd6b2e54c8c4c6e5f9 (patch) | |
tree | e389bf6c004e88917e91e6c93669b058ac129521 /libsolidity | |
parent | 258ae8927e21cddc18935e26b4184a833c85bda8 (diff) | |
parent | 1ac0090f31d12a720950991ab4e85710877effd1 (diff) | |
download | dexon-solidity-d1e1293fbd852149edfd03fd6b2e54c8c4c6e5f9.tar.gz dexon-solidity-d1e1293fbd852149edfd03fd6b2e54c8c4c6e5f9.tar.zst dexon-solidity-d1e1293fbd852149edfd03fd6b2e54c8c4c6e5f9.zip |
Merge pull request #3981 from ethereum/years-suffix
The "year" denomination is deprecated
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index ce98eb24..7ea10c5b 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -2233,6 +2233,7 @@ void TypeChecker::endVisit(Literal const& _literal) "For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals" ); } + if (_literal.isHexNumber() && _literal.subDenomination() != Literal::SubDenomination::None) { if (v050) @@ -2248,6 +2249,21 @@ void TypeChecker::endVisit(Literal const& _literal) "You can use an expression of the form \"0x1234 * 1 day\" instead." ); } + + if (_literal.subDenomination() == Literal::SubDenomination::Year) + { + if (v050) + m_errorReporter.typeError( + _literal.location(), + "Using \"years\" as a unit denomination is deprecated." + ); + else + m_errorReporter.warning( + _literal.location(), + "Using \"years\" as a unit denomination is deprecated." + ); + } + if (!_literal.annotation().type) _literal.annotation().type = Type::forLiteral(_literal); |