dup1.sol 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. contract C {
  2. function foo(int8 a, int8 b) public {}
  3. function foo(int64 a, int8 b) public {}
  4. function bar() public {
  5. foo(1, 2);
  6. }
  7. }
  8. contract D is C {
  9. function test1() public {
  10. C.foo(1, 2);
  11. }
  12. function test2(C c) public {
  13. c.foo(1, 2);
  14. }
  15. function test3(C c) public {
  16. c.foo(1);
  17. }
  18. function test4(C c) public {
  19. c.foo(x, y);
  20. }
  21. }
  22. // ---- Expect: diagnostics ----
  23. // warning: 2:20-21: function parameter 'a' is unused
  24. // warning: 2:28-29: function parameter 'b' is unused
  25. // warning: 3:21-22: function parameter 'a' is unused
  26. // warning: 3:29-30: function parameter 'b' is unused
  27. // error: 5:3-12: function call can be resolved to multiple functions
  28. // note 2:2-40: candidate function
  29. // note 3:2-41: candidate function
  30. // error: 11:3-14: function call can be resolved to multiple functions
  31. // note 2:2-40: candidate function
  32. // note 3:2-41: candidate function
  33. // error: 15:3-14: function call can be resolved to multiple functions
  34. // note 2:2-40: candidate function
  35. // note 3:2-41: candidate function
  36. // error: 19:3-11: cannot find overloaded function which matches signature
  37. // error: 19:3-11: function expects 2 arguments, 1 provided
  38. // note 2:2-37: candidate function
  39. // error: 19:3-11: function expects 2 arguments, 1 provided
  40. // note 3:2-38: candidate function
  41. // error: 23:9-10: 'x' not found
  42. // error: 23:12-13: 'y' not found