Proper error message for missing variables in inline assembly

This commit is contained in:
Alex Beregszaszi
2019-02-20 10:36:55 +00:00
parent c5577145d3
commit 52496ea719
4 changed files with 23 additions and 1 deletions
@@ -0,0 +1,10 @@
contract C {
function f() public pure {
assembly {
jump(xy)
}
}
}
// ----
// DeclarationError: (68-70): Identifier not found.
// SyntaxError: (63-71): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
@@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
x := 1
}
}
}
// ----
// DeclarationError: (63-64): Variable not found or variable not lvalue.