aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/ReferencesResolver.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-05-12 18:30:10 +0800
committerchriseth <c@ethdev.com>2016-05-12 18:30:10 +0800
commit1ab0f25dffe19f2cc9e1a0e2fa03a1091679f5a0 (patch)
tree267d5df3091710f7a1c3b54ddb8fcac5ab794015 /libsolidity/analysis/ReferencesResolver.cpp
parent9e36bdda8a9552f1885e0a63a85db588623b39b2 (diff)
parentd4206b7cd0bb0b8a3364c29fe097db035f308388 (diff)
downloaddexon-solidity-1ab0f25dffe19f2cc9e1a0e2fa03a1091679f5a0.tar
dexon-solidity-1ab0f25dffe19f2cc9e1a0e2fa03a1091679f5a0.tar.gz
dexon-solidity-1ab0f25dffe19f2cc9e1a0e2fa03a1091679f5a0.tar.bz2
dexon-solidity-1ab0f25dffe19f2cc9e1a0e2fa03a1091679f5a0.tar.lz
dexon-solidity-1ab0f25dffe19f2cc9e1a0e2fa03a1091679f5a0.tar.xz
dexon-solidity-1ab0f25dffe19f2cc9e1a0e2fa03a1091679f5a0.tar.zst
dexon-solidity-1ab0f25dffe19f2cc9e1a0e2fa03a1091679f5a0.zip
Merge pull request #402 from VoR0220/fixedDataType
Fixed Type initial PR
Diffstat (limited to 'libsolidity/analysis/ReferencesResolver.cpp')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index d7542bf3..a7b9e8b8 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -103,10 +103,9 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
{
if (!length->annotation().type)
ConstantEvaluator e(*length);
-
- auto const* lengthType = dynamic_cast<IntegerConstantType const*>(length->annotation().type.get());
- if (!lengthType)
- fatalTypeError(length->location(), "Invalid array length.");
+ auto const* lengthType = dynamic_cast<RationalNumberType const*>(length->annotation().type.get());
+ 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));
}