Use the proper error reporting interface in ConstantEvaluator

This commit is contained in:
Alex Beregszaszi committed 2017-10-05 20:17:54 +01:00
1 parent c28ed2a619
commit ed62b2583c
3 files changed
+13 -7

No files matched your search

+1 -1
View File
@@ -147,7 +147,7 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
if (Expression const* length = _typeName.length())
{
if (!length->annotation().type)
ConstantEvaluator e(*length);
ConstantEvaluator e(*length, m_errorReporter);
auto const* lengthType = dynamic_cast<RationalNumberType const*>(length->annotation().type.get());
if (!lengthType || !lengthType->mobileType())
fatalTypeError(length->location(), "Invalid array length, expected integer literal.");