diff options
author | Christian <c@ethdev.com> | 2015-02-14 10:06:50 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-02-14 20:35:57 +0800 |
commit | c944976d00de84d9cbe8e3e2388a21f0a323444c (patch) | |
tree | 6048622c579f366904a8f300dbc81c843ea97850 /ExpressionCompiler.cpp | |
parent | 41647fd75f3c131ecade223fc58a1f6eed2ee235 (diff) | |
download | dexon-solidity-c944976d00de84d9cbe8e3e2388a21f0a323444c.tar.gz dexon-solidity-c944976d00de84d9cbe8e3e2388a21f0a323444c.tar.zst dexon-solidity-c944976d00de84d9cbe8e3e2388a21f0a323444c.zip |
Some changes to enums.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index 63324fe5..29ec3d57 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -498,12 +498,10 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) case Type::Category::TypeType: { TypeType const& type = dynamic_cast<TypeType const&>(*_memberAccess.getExpression().getType()); - ContractType const* contractType; - EnumType const* enumType; if (!type.getMembers().getMemberType(member)) - BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid member access to " + type.toString())); + BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid member access to " + type.toString())); - if ((contractType = dynamic_cast<ContractType const*>(type.getActualType().get()))) + if (auto contractType = dynamic_cast<ContractType const*>(type.getActualType().get())) { ContractDefinition const& contract = contractType->getContractDefinition(); for (ASTPointer<FunctionDefinition> const& function: contract.getDefinedFunctions()) @@ -513,12 +511,9 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) return; } } - else if ((enumType = dynamic_cast<EnumType const*>(type.getActualType().get()))) - { + else if (auto enumType = dynamic_cast<EnumType const*>(type.getActualType().get())) m_context << enumType->getMemberValue(_memberAccess.getMemberName()); - return; - } - + break; } case Type::Category::ByteArray: { |