Support constant numbers in inline assembly.

This commit is contained in:
chriseth
2019-07-02 14:01:05 +02:00
parent b8dbf7d2a8
commit cdd137e3d1
11 changed files with 122 additions and 10 deletions
@@ -1,10 +1,9 @@
contract test {
uint constant x = 1;
function f() public {
function f() public pure {
assembly {
let y := x
}
}
}
// ----
// TypeError: (107-108): Constant variables not supported by inline assembly.
@@ -7,4 +7,4 @@ contract test {
}
}
// ----
// TypeError: (98-99): Constant variables not supported by inline assembly.
// TypeError: (98-99): Constant variables cannot be assigned to.
@@ -7,4 +7,4 @@ contract test {
}
}
// ----
// TypeError: (112-120): Constant variables not supported by inline assembly.
// TypeError: (112-120): The suffixes _offset and _slot can only be used on non-constant storage variables.