contract_no_init.sol 538 B

1234567891011121314151617
  1. contract other {
  2. int public a;
  3. }
  4. contract testing {
  5. function test(int x) public returns (int) {
  6. do {
  7. x--;
  8. other.new();
  9. }while(x > 0);
  10. return other.a();
  11. }
  12. }
  13. // ---- Expect: diagnostics ----
  14. // error: 10:21-32: accounts are required for calling a contract. You can either provide the accounts with the {accounts: ...} call argument or change this function's visibility to external