Style improvements.

This commit is contained in:
Daniel Kirchner 2018-03-05 17:00:37 +01:00
parent b8589fbe0f
commit 3340053fd9
2 changed files with 7 additions and 4 deletions

View File

@ -3000,7 +3000,7 @@ bool MagicType::operator==(Type const& _other) const
return other.m_kind == m_kind; return other.m_kind == m_kind;
} }
MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const *_contract) const MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const* _contract) const
{ {
solAssert(_contract, ""); solAssert(_contract, "");
const bool v050 = _contract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050); const bool v050 = _contract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050);
@ -3025,7 +3025,7 @@ MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const *_contra
}; };
if (!v050) if (!v050)
members.emplace_back("gas", make_shared<IntegerType>(256)); members.emplace_back("gas", make_shared<IntegerType>(256));
return MemberList::MemberMap(members); return members;
} }
case Kind::Transaction: case Kind::Transaction:
return MemberList::MemberMap({ return MemberList::MemberMap({

View File

@ -924,7 +924,7 @@ bool ExpressionCompiler::visit(NewExpression const&)
bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
{ {
const bool v050 = m_context.experimentalFeatureActive(ExperimentalFeature::V050); bool const v050 = m_context.experimentalFeatureActive(ExperimentalFeature::V050);
CompilerContext::LocationSetter locationSetter(m_context, _memberAccess); CompilerContext::LocationSetter locationSetter(m_context, _memberAccess);
// Check whether the member is a bound function. // Check whether the member is a bound function.
@ -1140,8 +1140,11 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
m_context << Instruction::CALLVALUE; m_context << Instruction::CALLVALUE;
else if (member == "origin") else if (member == "origin")
m_context << Instruction::ORIGIN; m_context << Instruction::ORIGIN;
else if (!v050 && member == "gas") else if (member == "gas")
{
solAssert(!v050, "");
m_context << Instruction::GAS; m_context << Instruction::GAS;
}
else if (member == "gasprice") else if (member == "gasprice")
m_context << Instruction::GASPRICE; m_context << Instruction::GASPRICE;
else if (member == "data") else if (member == "data")