diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-10-21 16:05:36 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-10-24 21:30:26 +0800 |
commit | 7cee39fc17a94bb14ccf60dee6209162e21a7b97 (patch) | |
tree | 6a098b408e0b2702dc7c66cb7c5dbc901edbcb9c /libsolidity/codegen | |
parent | df900c558396ed4a33905eea730964a4ecc087ea (diff) | |
download | dexon-solidity-7cee39fc17a94bb14ccf60dee6209162e21a7b97.tar.gz dexon-solidity-7cee39fc17a94bb14ccf60dee6209162e21a7b97.tar.zst dexon-solidity-7cee39fc17a94bb14ccf60dee6209162e21a7b97.zip |
codegen: skip contract L for L.Foo where Foo is a type
Fixes #1116
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 3d05edd3..da3e56cc 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -861,11 +861,12 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) } // Special processing for TypeType because we do not want to visit the library itself - // for internal functions. + // for internal functions, or enum/struct definitions. if (TypeType const* type = dynamic_cast<TypeType const*>(_memberAccess.expression().annotation().type.get())) { if (dynamic_cast<ContractType const*>(type->actualType().get())) { + solAssert(_memberAccess.annotation().type, "_memberAccess has no type"); if (auto funType = dynamic_cast<FunctionType const*>(_memberAccess.annotation().type.get())) { if (funType->location() != FunctionType::Location::Internal) @@ -883,6 +884,10 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) m_context << m_context.functionEntryLabel(*function).pushTag(); } } + else if (dynamic_cast<TypeType const*>(_memberAccess.annotation().type.get())) + { + // no-op + } else _memberAccess.expression().accept(*this); } |