From aeaa6bb5b1da4764c9d8d403365dfb42f3fafea3 Mon Sep 17 00:00:00 2001 From: Kwang Yul Seo Date: Fri, 17 Nov 2017 01:41:22 +0900 Subject: [PATCH] Allow constants access through contract names (issue #1290) --- libsolidity/ast/Types.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 21daac2cd9fe..31536f0bc864 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -2891,6 +2891,13 @@ MemberList::MemberMap TypeType::nativeMembers(ContractDefinition const* _current } else { + for (VariableDeclaration const* variable: contract.stateVariables()) + if (variable->isConstant()) + members.push_back(MemberList::Member( + variable->name(), + variable->annotation().type, + variable + )); for (auto const& stru: contract.definedStructs()) members.push_back(MemberList::Member(stru->name(), stru->type(), stru)); for (auto const& enu: contract.definedEnums())