|
|
@ -494,20 +494,31 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) |
|
|
|
EnumType const& type = dynamic_cast<EnumType const&>(*_memberAccess.getExpression().getType()); |
|
|
|
EnumDefinition const& enumDef = type.getEnumDefinition(); |
|
|
|
m_context << enumDef.getMemberValue(_memberAccess.getMemberName()); |
|
|
|
break; |
|
|
|
} |
|
|
|
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)) |
|
|
|
{ |
|
|
|
ContractDefinition const& contract = dynamic_cast<ContractType const&>(*type.getActualType()) |
|
|
|
.getContractDefinition(); |
|
|
|
for (ASTPointer<FunctionDefinition> const& function: contract.getDefinedFunctions()) |
|
|
|
if (function->getName() == member) |
|
|
|
{ |
|
|
|
m_context << m_context.getFunctionEntryLabel(*function).pushTag(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if ((contractType = dynamic_cast<ContractType const*>(type.getActualType().get()))) |
|
|
|
{ |
|
|
|
ContractDefinition const& contract = contractType->getContractDefinition(); |
|
|
|
for (ASTPointer<FunctionDefinition> const& function: contract.getDefinedFunctions()) |
|
|
|
if (function->getName() == member) |
|
|
|
{ |
|
|
|
m_context << m_context.getFunctionEntryLabel(*function).pushTag(); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
else if ((enumType = dynamic_cast<EnumType const*>(type.getActualType().get()))) |
|
|
|
{ |
|
|
|
EnumDefinition const &enumDef = enumType->getEnumDefinition(); |
|
|
|
m_context << enumDef.getMemberValue(_memberAccess.getMemberName()); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid member access to " + type.toString())); |
|
|
|
} |
|
|
|