test_abstract.sol 511 B

12345678910111213141516171819
  1. abstract contract foo {
  2. constructor(int arg1) public {
  3. }
  4. function f1() public {
  5. }
  6. }
  7. contract bar {
  8. function test() public {
  9. foo x = new foo(1);
  10. }
  11. }
  12. // ---- Expect: diagnostics ----
  13. // warning: 3:29-33: function parameter 'arg1' is unused
  14. // warning: 3:35-41: 'public': visibility for constructors is ignored
  15. // error: 12:25-35: cannot construct 'foo' of type 'abstract contract'