mutability_14.sol 368 B

123456789101112131415
  1. contract Foo {
  2. address a;
  3. function r() internal view returns (address) {
  4. return msg.sender;
  5. }
  6. function foo() public pure {
  7. a = r();
  8. }
  9. }
  10. // ---- Expect: diagnostics ----
  11. // error: 9:9-10: function declared 'pure' but this expression writes to state
  12. // error: 9:13-16: function declared 'pure' but this expression reads from state