mutability_12.sol 322 B

1234567891011121314
  1. contract c {
  2. // private functions cannot be payable and solc checks msg.value as
  3. // state read in them
  4. function foo() private view returns (uint) {
  5. return msg.value;
  6. }
  7. function bar() public returns (uint) {
  8. return foo();
  9. }
  10. }
  11. // ---- Expect: diagnostics ----
  12. // warning: 8:2-38: function can be declared 'view'