mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Style.
This commit is contained in:
parent
180344ab17
commit
fe35df4b78
@ -378,26 +378,25 @@ bool AsmAnalyzer::operator()(Switch const& _switch)
|
|||||||
if (!expectExpression(*_switch.expression))
|
if (!expectExpression(*_switch.expression))
|
||||||
success = false;
|
success = false;
|
||||||
|
|
||||||
{
|
YulString caseType;
|
||||||
YulString caseType;
|
bool mismatchingTypes = false;
|
||||||
bool mismatchingTypes = false;
|
for (auto const& _case: _switch.cases)
|
||||||
for (auto const& _case: _switch.cases)
|
if (_case.value)
|
||||||
if (_case.value)
|
{
|
||||||
|
if (caseType.empty())
|
||||||
|
caseType = _case.value->type;
|
||||||
|
else if (caseType != _case.value->type)
|
||||||
{
|
{
|
||||||
if (caseType.empty())
|
mismatchingTypes = true;
|
||||||
caseType = _case.value->type;
|
break;
|
||||||
else if (caseType != _case.value->type)
|
|
||||||
{
|
|
||||||
mismatchingTypes = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (mismatchingTypes)
|
}
|
||||||
m_errorReporter.typeError(
|
|
||||||
_switch.location,
|
if (mismatchingTypes)
|
||||||
"Switch cases have non-matching types."
|
m_errorReporter.typeError(
|
||||||
);
|
_switch.location,
|
||||||
}
|
"Switch cases have non-matching types."
|
||||||
|
);
|
||||||
|
|
||||||
set<u256> cases;
|
set<u256> cases;
|
||||||
for (auto const& _case: _switch.cases)
|
for (auto const& _case: _switch.cases)
|
||||||
|
Loading…
Reference in New Issue
Block a user