Support referencing other constants in inline assembly

This commit is contained in:
Gaith Hallak
2019-12-05 13:27:17 +03:00
parent 2a1b6f55af
commit 4d90180e24
10 changed files with 119 additions and 3 deletions
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
// TypeError: (115-116): Only direct number constants are supported by inline assembly.
// TypeError: (115-116): Only direct number constants and references to such constants are supported by inline assembly.
@@ -0,0 +1,11 @@
contract C {
bytes32 constant x = keccak256("abc");
bytes32 constant y = x;
function f() public pure returns (uint t) {
assembly {
t := y
}
}
}
// ----
// TypeError: (168-169): Only direct number constants and references to such constants are supported by inline assembly.
@@ -8,4 +8,3 @@ contract C {
}
}
// ----
// TypeError: (134-135): Only direct number constants are supported by inline assembly.