From c83768c4260979b6d30185ef19352d27b161c3b0 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 1 Sep 2017 12:31:24 +0200 Subject: Fix tests --- libsolidity/analysis/ViewPureChecker.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libsolidity/analysis/ViewPureChecker.cpp') diff --git a/libsolidity/analysis/ViewPureChecker.cpp b/libsolidity/analysis/ViewPureChecker.cpp index e5b433c2..705d61e8 100644 --- a/libsolidity/analysis/ViewPureChecker.cpp +++ b/libsolidity/analysis/ViewPureChecker.cpp @@ -292,11 +292,14 @@ void ViewPureChecker::endVisit(MemberAccess const& _memberAccess) void ViewPureChecker::endVisit(IndexAccess const& _indexAccess) { - solAssert(_indexAccess.indexExpression(), ""); - - bool writes = _indexAccess.annotation().lValueRequested; - if (_indexAccess.baseExpression().annotation().type->dataStoredIn(DataLocation::Storage)) - reportMutability(writes ? StateMutability::NonPayable : StateMutability::View, _indexAccess.location()); + if (!_indexAccess.indexExpression()) + solAssert(_indexAccess.annotation().type->category() == Type::Category::TypeType, ""); + else + { + bool writes = _indexAccess.annotation().lValueRequested; + if (_indexAccess.baseExpression().annotation().type->dataStoredIn(DataLocation::Storage)) + reportMutability(writes ? StateMutability::NonPayable : StateMutability::View, _indexAccess.location()); + } } void ViewPureChecker::endVisit(ModifierInvocation const& _modifier) -- cgit