mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix tests
This commit is contained in:
parent
1a1db1ec96
commit
c83768c426
@ -292,12 +292,15 @@ void ViewPureChecker::endVisit(MemberAccess const& _memberAccess)
|
|||||||
|
|
||||||
void ViewPureChecker::endVisit(IndexAccess const& _indexAccess)
|
void ViewPureChecker::endVisit(IndexAccess const& _indexAccess)
|
||||||
{
|
{
|
||||||
solAssert(_indexAccess.indexExpression(), "");
|
if (!_indexAccess.indexExpression())
|
||||||
|
solAssert(_indexAccess.annotation().type->category() == Type::Category::TypeType, "");
|
||||||
|
else
|
||||||
|
{
|
||||||
bool writes = _indexAccess.annotation().lValueRequested;
|
bool writes = _indexAccess.annotation().lValueRequested;
|
||||||
if (_indexAccess.baseExpression().annotation().type->dataStoredIn(DataLocation::Storage))
|
if (_indexAccess.baseExpression().annotation().type->dataStoredIn(DataLocation::Storage))
|
||||||
reportMutability(writes ? StateMutability::NonPayable : StateMutability::View, _indexAccess.location());
|
reportMutability(writes ? StateMutability::NonPayable : StateMutability::View, _indexAccess.location());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ViewPureChecker::endVisit(ModifierInvocation const& _modifier)
|
void ViewPureChecker::endVisit(ModifierInvocation const& _modifier)
|
||||||
{
|
{
|
||||||
|
@ -6820,7 +6820,7 @@ BOOST_AUTO_TEST_CASE(internal_types_in_library)
|
|||||||
{
|
{
|
||||||
char const* sourceCode = R"(
|
char const* sourceCode = R"(
|
||||||
library Lib {
|
library Lib {
|
||||||
function find(uint16[] storage _haystack, uint16 _needle) pure returns (uint)
|
function find(uint16[] storage _haystack, uint16 _needle) view returns (uint)
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < _haystack.length; ++i)
|
for (uint i = 0; i < _haystack.length; ++i)
|
||||||
if (_haystack[i] == _needle)
|
if (_haystack[i] == _needle)
|
||||||
|
Loading…
Reference in New Issue
Block a user