Skip to content

Commit d469df4

Browse files
authored
Merge pull request #4352 from D-Nice/develop
Fixes storage ref var typo error from 'prefix' to 'suffix'
2 parents 2a9d54a + 3cad417 commit d469df4

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

libsolidity/analysis/TypeChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
929929
}
930930
else if (var->type()->dataStoredIn(DataLocation::Storage))
931931
{
932-
m_errorReporter.typeError(_identifier.location, "You have to use the _slot or _offset prefix to access storage reference variables.");
932+
m_errorReporter.typeError(_identifier.location, "You have to use the _slot or _offset suffix to access storage reference variables.");
933933
return size_t(-1);
934934
}
935935
else if (var->type()->sizeOnStack() != 1)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
contract C {
2+
uint[] x;
3+
function() public {
4+
uint[] storage y = x;
5+
assembly {
6+
pop(y)
7+
}
8+
}
9+
}
10+
// ----
11+
// TypeError: (117-118): You have to use the _slot or _offset suffix to access storage reference variables.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
contract C {
2+
uint[] x;
3+
function() public {
4+
uint[] storage y = x;
5+
assembly {
6+
pop(y_slot)
7+
pop(y_offset)
8+
}
9+
}
10+
}
11+
// ----

0 commit comments

Comments
 (0)