mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Simplify interface of RationalNumber.
This commit is contained in:
1 parent
cf226f0607
commit
656405240e
5 files changed
+25
-24
No files matched your search
@@ -104,7 +104,7 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
|
||||
if (!length->annotation().type)
|
||||
ConstantEvaluator e(*length);
|
||||
auto const* lengthType = dynamic_cast<RationalNumberType const*>(length->annotation().type.get());
|
||||
if (!lengthType || lengthType->denominator() != 1)
|
||||
if (!lengthType || lengthType->isFractional())
|
||||
fatalTypeError(length->location(), "Invalid array length, expected integer literal.");
|
||||
else
|
||||
_typeName.annotation().type = make_shared<ArrayType>(DataLocation::Storage, baseType, lengthType->literalValue(nullptr));
|
||||
|
||||
Reference in new issue
Block a user