From 9a075458ad104921c9d747cd34d3e5c299638406 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Thu, 18 Feb 2016 16:39:11 -0600 Subject: initial work for fixed types...potentially needing a constant literal type for this notation Rational implemented...trying to figure out exponential fix for token bug, also quick fix for the wei and seconds fixed problem with var...probably a conversion problem for fixed in size capabilities adding fixed type tests Removing bitshift and regrouping fixed type tests together size capabilities functioning properly for fixed types got exponents up and working with their inverse, changed a few of the tests....something is working that likely shouldn't be slight changes to how to flip the rational negative around...still trying to figure it out tests added updated tests odd differences in trying soltest from solc binary, let me know if you can replicate test not working for odd reason fixed test problem with fixed literals...still need a way to log this error broken up the tests, added some, changed some things in types and began compiler work moar tests and prepping for rebuilding much of the types.cpp file further fixing initial work for fixed types...potentially needing a constant literal type for this --- libsolidity/analysis/ReferencesResolver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libsolidity/analysis/ReferencesResolver.cpp') diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index d7542bf3..3351c716 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -103,10 +103,11 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName) { if (!length->annotation().type) ConstantEvaluator e(*length); - - auto const* lengthType = dynamic_cast(length->annotation().type.get()); + auto const* lengthType = dynamic_cast(length->annotation().type.get()); if (!lengthType) fatalTypeError(length->location(), "Invalid array length."); + else if (lengthType->denominator() != 1) + fatalTypeError(length->location(), "Invalid input for array length, expected integer."); else _typeName.annotation().type = make_shared(DataLocation::Storage, baseType, lengthType->literalValue(nullptr)); } -- cgit v1.2.3