Merge pull request #8480 from a3d4/fix-8418-astutils-compiler-error

Replaced "assert" with "if"
This commit is contained in:
chriseth
2020-03-12 15:19:54 +01:00
committed by GitHub
7 changed files with 40 additions and 8 deletions
@@ -0,0 +1,12 @@
contract C {
bool nc = false;
bool constant c = nc;
function f() public {
assembly {
let t := c
}
}
}
// ----
// TypeError: (52-54): Initial value for constant variable has to be compile-time constant.
// TypeError: (112-113): Only direct number constants and references to such constants are supported by inline assembly.
@@ -0,0 +1,12 @@
contract C {
bool constant c = this;
function f() public {
assembly {
let t := c
}
}
}
// ----
// TypeError: (33-37): Type contract C is not implicitly convertible to expected type bool.
// TypeError: (33-37): Initial value for constant variable has to be compile-time constant.
// TypeError: (95-96): Only direct number constants and references to such constants are supported by inline assembly.