abstract_constructor.sol 524 B

1234567891011121314151617181920212223
  1. abstract contract Foo2 {
  2. uint b;
  3. constructor(uint a) {
  4. b = a;
  5. }
  6. }
  7. contract Other2 {
  8. uint c;
  9. constructor(uint d) {
  10. c = d;
  11. }
  12. function call_foo(address id) external {
  13. Foo2.new{program_id: id}(5);
  14. }
  15. function call_foo2(address id) external {
  16. Foo2.new{program_id: id}({a: 5});
  17. }
  18. }
  19. // ---- Expect: diagnostics ----
  20. // error: 14:9-36: cannot construct 'Foo2' of type 'abstract contract'
  21. // error: 17:9-41: cannot construct 'Foo2' of type 'abstract contract'