diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-09-03 23:45:58 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-09-05 18:19:14 +0800 |
commit | 87804b6419a5894601441efe511015adda5fb119 (patch) | |
tree | 72fc5334d21933570c8b94ec6a22879c98a692ca /libsolidity/analysis | |
parent | a996ea266c4542b37503c1d2261a17f3d5a55dbb (diff) | |
download | dexon-solidity-87804b6419a5894601441efe511015adda5fb119.tar.gz dexon-solidity-87804b6419a5894601441efe511015adda5fb119.tar.zst dexon-solidity-87804b6419a5894601441efe511015adda5fb119.zip |
Split IntegerType into IntegerType and AddressType.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 4 | ||||
-rw-r--r-- | libsolidity/analysis/ViewPureChecker.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index a2b72896..a3f4459e 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -2103,7 +2103,7 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess) "after argument-dependent lookup in " + exprType->toString() + (memberName == "value" ? " - did you forget the \"payable\" modifier?" : "."); if (exprType->category() == Type::Category::Contract) - for (auto const& addressMember: IntegerType(160, IntegerType::Modifier::Address).nativeMembers(nullptr)) + for (auto const& addressMember: AddressType().nativeMembers(nullptr)) if (addressMember.name == memberName) { Identifier const* var = dynamic_cast<Identifier const*>(&_memberAccess.expression()); @@ -2353,7 +2353,7 @@ void TypeChecker::endVisit(Literal const& _literal) if (_literal.looksLikeAddress()) { // Assign type here if it even looks like an address. This prevents double errors for invalid addresses - _literal.annotation().type = make_shared<IntegerType>(160, IntegerType::Modifier::Address); + _literal.annotation().type = make_shared<AddressType>(); string msg; if (_literal.value().length() != 42) // "0x" + 40 hex digits diff --git a/libsolidity/analysis/ViewPureChecker.cpp b/libsolidity/analysis/ViewPureChecker.cpp index be6b7ef7..113a3177 100644 --- a/libsolidity/analysis/ViewPureChecker.cpp +++ b/libsolidity/analysis/ViewPureChecker.cpp @@ -323,7 +323,7 @@ void ViewPureChecker::endVisit(MemberAccess const& _memberAccess) ASTString const& member = _memberAccess.memberName(); switch (_memberAccess.expression().annotation().type->category()) { - case Type::Category::Integer: + case Type::Category::Address: if (member == "balance") mutability = StateMutability::View; break; |