solidity/test/libsolidity/syntaxTests/viewPureChecker/assembly_chainid_not_pure.sol

14 lines
516 B
Solidity
Raw Normal View History

2020-12-09 15:00:02 +00:00
contract C {
function f() public pure {
assembly { pop(chainid()) }
}
2020-09-22 17:12:01 +00:00
function g() public pure returns (uint) {
return block.chainid;
}
2020-12-09 15:00:02 +00:00
}
// ====
// EVMVersion: >=istanbul
// ----
// TypeError 2527: (67-76): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
2020-09-22 17:12:01 +00:00
// TypeError 2527: (147-160): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".