Improve cyclic constant error message

This commit is contained in:
Alex Beregszaszi
2017-11-22 02:11:22 +00:00
parent d102deaec9
commit 455e51a608
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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)