solidity/test/libsolidity/syntaxTests/inlineAssembly/invalid/const_forward_reference.sol
2022-04-01 23:41:18 -05:00

13 lines
407 B
Solidity

contract C {
function f() {
assembly {
c := add(add(1, 2), c)
}
}
int constant c = 0 + 1;
}
// ----
// SyntaxError 4937: (15-83): No visibility specified. Did you intend to add "public"?
// TypeError 2249: (71-72='c'): Constant variables with non-literal values cannot be forward referenced from inline assembly.
// TypeError 6252: (51-52='c'): Constant variables cannot be assigned to.