diff options
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/ConstantEvaluator.cpp | 6 | ||||
-rw-r--r-- | libsolidity/analysis/ReferencesResolver.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/analysis/ConstantEvaluator.cpp b/libsolidity/analysis/ConstantEvaluator.cpp index a86e3967..bdd8f61e 100644 --- a/libsolidity/analysis/ConstantEvaluator.cpp +++ b/libsolidity/analysis/ConstantEvaluator.cpp @@ -31,7 +31,7 @@ using namespace dev::solidity; void ConstantEvaluator::endVisit(UnaryOperation const& _operation) { TypePointer const& subType = _operation.subExpression().annotation().type; - if (!dynamic_cast<ConstantNumberType const*>(subType.get())) + if (!dynamic_cast<RationalNumberType const*>(subType.get())) BOOST_THROW_EXCEPTION(_operation.subExpression().createTypeError("Invalid constant expression.")); TypePointer t = subType->unaryOperatorResult(_operation.getOperator()); _operation.annotation().type = t; @@ -41,9 +41,9 @@ void ConstantEvaluator::endVisit(BinaryOperation const& _operation) { TypePointer const& leftType = _operation.leftExpression().annotation().type; TypePointer const& rightType = _operation.rightExpression().annotation().type; - if (!dynamic_cast<ConstantNumberType const*>(leftType.get())) + if (!dynamic_cast<RationalNumberType const*>(leftType.get())) BOOST_THROW_EXCEPTION(_operation.leftExpression().createTypeError("Invalid constant expression.")); - if (!dynamic_cast<ConstantNumberType const*>(rightType.get())) + if (!dynamic_cast<RationalNumberType const*>(rightType.get())) BOOST_THROW_EXCEPTION(_operation.rightExpression().createTypeError("Invalid constant expression.")); TypePointer commonType = leftType->binaryOperatorResult(_operation.getOperator(), rightType); if (Token::isCompareOp(_operation.getOperator())) diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index 3351c716..f4e0f838 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -103,7 +103,7 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName) { if (!length->annotation().type) ConstantEvaluator e(*length); - auto const* lengthType = dynamic_cast<ConstantNumberType const*>(length->annotation().type.get()); + auto const* lengthType = dynamic_cast<RationalNumberType const*>(length->annotation().type.get()); if (!lengthType) fatalTypeError(length->location(), "Invalid array length."); else if (lengthType->denominator() != 1) |