Improve error message for constant evaluator

This commit is contained in:
Alex Beregszaszi
2017-12-12 09:39:26 +00:00
parent 45d0992ce8
commit 5226d54ed1
3 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
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.");
fatalTypeError(length->location(), "Invalid array length, expected integer literal or constant expression.");
else if (lengthType->isFractional())
fatalTypeError(length->location(), "Array with fractional length specified.");
else if (lengthType->isNegative())
+1 -1
View File
@@ -257,7 +257,7 @@ public:
}
virtual u256 literalValue(Literal const*) const
{
solAssert(false, "Literal value requested for type without literals.");
solAssert(false, "Literal value requested for type without literals: " + toString(false));
}
/// @returns a (simpler) type that is encoded in the same way for external function calls.