|
@ -489,6 +489,12 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) |
|
|
m_currentLValue.retrieveValueIfLValueNotRequested(_memberAccess); |
|
|
m_currentLValue.retrieveValueIfLValueNotRequested(_memberAccess); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
case Type::Category::Enum: |
|
|
|
|
|
{ |
|
|
|
|
|
EnumType const& type = dynamic_cast<EnumType const&>(*_memberAccess.getExpression().getType()); |
|
|
|
|
|
EnumDefinition const& enumDef = type.getEnumDefinition(); |
|
|
|
|
|
m_context << enumDef.getMemberValue(_memberAccess.getMemberName()); |
|
|
|
|
|
} |
|
|
case Type::Category::TypeType: |
|
|
case Type::Category::TypeType: |
|
|
{ |
|
|
{ |
|
|
TypeType const& type = dynamic_cast<TypeType const&>(*_memberAccess.getExpression().getType()); |
|
|
TypeType const& type = dynamic_cast<TypeType const&>(*_memberAccess.getExpression().getType()); |
|
@ -562,6 +568,10 @@ void ExpressionCompiler::endVisit(Identifier const& _identifier) |
|
|
{ |
|
|
{ |
|
|
// no-op
|
|
|
// no-op
|
|
|
} |
|
|
} |
|
|
|
|
|
else if (dynamic_cast<EnumDefinition const*>(declaration)) |
|
|
|
|
|
{ |
|
|
|
|
|
// no-op
|
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Identifier type not expected in expression context.")); |
|
|
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Identifier type not expected in expression context.")); |
|
@ -746,7 +756,7 @@ void ExpressionCompiler::appendTypeConversion(Type const& _typeOnStack, Type con |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else if (stackTypeCategory == Type::Category::Integer || stackTypeCategory == Type::Category::Contract || |
|
|
else if (stackTypeCategory == Type::Category::Integer || stackTypeCategory == Type::Category::Contract || |
|
|
stackTypeCategory == Type::Category::IntegerConstant) |
|
|
stackTypeCategory == Type::Category::IntegerConstant || stackTypeCategory == Type::Category::Enum) |
|
|
{ |
|
|
{ |
|
|
if (targetTypeCategory == Type::Category::String && stackTypeCategory == Type::Category::Integer) |
|
|
if (targetTypeCategory == Type::Category::String && stackTypeCategory == Type::Category::Integer) |
|
|
{ |
|
|
{ |
|
|