mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improve cyclic constant error message
This commit is contained in:
parent
d102deaec9
commit
455e51a608
@ -90,7 +90,7 @@ void ConstantEvaluator::endVisit(Identifier const& _identifier)
|
||||
if (!value->annotation().type)
|
||||
{
|
||||
if (m_depth > 32)
|
||||
m_errorReporter.fatalTypeError(_identifier.location(), "Cyclic constant definition.");
|
||||
m_errorReporter.fatalTypeError(_identifier.location(), "Cyclic constant definition (or maximum recursion depth exhausted).");
|
||||
ConstantEvaluator e(*value, m_errorReporter, m_depth + 1);
|
||||
}
|
||||
|
||||
|
@ -7379,7 +7379,7 @@ BOOST_AUTO_TEST_CASE(array_length_with_cyclic_constant)
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Cyclic constant definition.");
|
||||
CHECK_ERROR(text, TypeError, "Cyclic constant definition (or maximum recursion depth exhausted).");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(array_length_with_complex_cyclic_constant)
|
||||
@ -7394,7 +7394,7 @@ BOOST_AUTO_TEST_CASE(array_length_with_complex_cyclic_constant)
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Cyclic constant definition.");
|
||||
CHECK_ERROR(text, TypeError, "Cyclic constant definition (or maximum recursion depth exhausted).");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(array_length_with_pure_functions)
|
||||
|
Loading…
Reference in New Issue
Block a user