contract_no_init.sol 563 B

123456789101112131415161718
  1. contract other {
  2. int public a;
  3. }
  4. contract testing {
  5. function test(int x) public returns (int) {
  6. other o;
  7. do {
  8. x--;
  9. o = new other();
  10. }while(x > 0);
  11. return o.a();
  12. }
  13. }
  14. // ---- Expect: diagnostics ----
  15. // error: 11:25-36: 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