mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4352 from D-Nice/develop
Fixes storage ref var typo error from 'prefix' to 'suffix'
This commit is contained in:
commit
d469df45d8
@ -929,7 +929,7 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
|
|||||||
}
|
}
|
||||||
else if (var->type()->dataStoredIn(DataLocation::Storage))
|
else if (var->type()->dataStoredIn(DataLocation::Storage))
|
||||||
{
|
{
|
||||||
m_errorReporter.typeError(_identifier.location, "You have to use the _slot or _offset prefix to access storage reference variables.");
|
m_errorReporter.typeError(_identifier.location, "You have to use the _slot or _offset suffix to access storage reference variables.");
|
||||||
return size_t(-1);
|
return size_t(-1);
|
||||||
}
|
}
|
||||||
else if (var->type()->sizeOnStack() != 1)
|
else if (var->type()->sizeOnStack() != 1)
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
contract C {
|
||||||
|
uint[] x;
|
||||||
|
function() public {
|
||||||
|
uint[] storage y = x;
|
||||||
|
assembly {
|
||||||
|
pop(y)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError: (117-118): You have to use the _slot or _offset suffix to access storage reference variables.
|
@ -0,0 +1,11 @@
|
|||||||
|
contract C {
|
||||||
|
uint[] x;
|
||||||
|
function() public {
|
||||||
|
uint[] storage y = x;
|
||||||
|
assembly {
|
||||||
|
pop(y_slot)
|
||||||
|
pop(y_offset)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
Loading…
Reference in New Issue
Block a user