diff options
author | chriseth <c@ethdev.com> | 2015-12-18 22:56:26 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-12-18 23:50:14 +0800 |
commit | 54e3637d234653e0f0e282220e3a628766a86adb (patch) | |
tree | 24673c46220072ed53017d15215507e200273778 /libsolidity/codegen | |
parent | 938ed70935a434babb8c52e6a2985b98216b37c6 (diff) | |
download | dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.tar dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.tar.gz dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.tar.bz2 dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.tar.lz dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.tar.xz dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.tar.zst dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.zip |
Add structs and enums to contract types.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index dcdab2a7..2fd0b2c4 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -913,14 +913,16 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) if (dynamic_cast<ContractType const*>(type.actualType().get())) { - auto const& funType = dynamic_cast<FunctionType const&>(*_memberAccess.annotation().type); - if (funType.location() != FunctionType::Location::Internal) - m_context << funType.externalIdentifier(); - else + if (auto funType = dynamic_cast<FunctionType const*>(_memberAccess.annotation().type.get())) { - auto const* function = dynamic_cast<FunctionDefinition const*>(_memberAccess.annotation().referencedDeclaration); - solAssert(!!function, "Function not found in member access"); - m_context << m_context.functionEntryLabel(*function).pushTag(); + if (funType->location() != FunctionType::Location::Internal) + m_context << funType->externalIdentifier(); + else + { + auto const* function = dynamic_cast<FunctionDefinition const*>(_memberAccess.annotation().referencedDeclaration); + solAssert(!!function, "Function not found in member access"); + m_context << m_context.functionEntryLabel(*function).pushTag(); + } } } else if (auto enumType = dynamic_cast<EnumType const*>(type.actualType().get())) |