not_constant.sol 458 B

1234567891011121314
  1. contract C {
  2. uint256 public constant STATIC = 42;
  3. }
  4. contract foo {
  5. function f() public returns (uint) {
  6. uint a = C.STATIC();
  7. return a;
  8. }
  9. }
  10. // ---- Expect: diagnostics ----
  11. // error: 8:26-36: a contract needs a program id to be called. Either a '@program_id' must be declared above a contract or the {program_id: ...} call argument must be present