diff options
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 2 | ||||
-rw-r--r-- | libsolidity/ast/AST.cpp | 6 | ||||
-rw-r--r-- | libsolidity/ast/AST.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 436d960b..1563467c 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1886,7 +1886,7 @@ void TypeChecker::expectType(Expression const& _expression, Type const& _expecte { auto literal = dynamic_cast<Literal const*>(&_expression); - if (literal && !literal->hasHexPrefix()) + if (literal && !literal->isHexNumber()) m_errorReporter.warning( _expression.location(), "Decimal literal assigned to bytesXX variable will be left-aligned. " diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 54ded609..2df31eed 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -530,7 +530,7 @@ IdentifierAnnotation& Identifier::annotation() const return dynamic_cast<IdentifierAnnotation&>(*m_annotation); } -bool Literal::hasHexPrefix() const +bool Literal::isHexNumber() const { if (token() != Token::Number) return false; @@ -542,7 +542,7 @@ bool Literal::looksLikeAddress() const if (subDenomination() != SubDenomination::None) return false; - if (!hasHexPrefix()) + if (!isHexNumber()) return false; return abs(int(value().length()) - 42) <= 1; @@ -550,6 +550,6 @@ bool Literal::looksLikeAddress() const bool Literal::passesAddressChecksum() const { - solAssert(hasHexPrefix(), "Expected hex prefix"); + solAssert(isHexNumber(), "Expected hex number"); return dev::passesAddressChecksum(value(), true); } diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 24b16176..e8831dc0 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -1591,7 +1591,7 @@ public: SubDenomination subDenomination() const { return m_subDenomination; } /// @returns true if this is a number with a hex prefix. - bool hasHexPrefix() const; + bool isHexNumber() const; /// @returns true if this looks like a checksummed address. bool looksLikeAddress() const; |