external_call_02.sol 836 B

123456789101112131415161718192021222324252627
  1. contract c {
  2. b x;
  3. constructor() public {
  4. x = new b(102);
  5. }
  6. function test() public returns (int32) {
  7. return x.get_x({ t: 10, t: false });
  8. }
  9. }
  10. contract b {
  11. int32 x;
  12. constructor(int32 a) public {
  13. x = a;
  14. }
  15. function get_x(int32 t) public returns (int32) {
  16. return x * t;
  17. }
  18. }
  19. // ---- Expect: diagnostics ----
  20. // warning: 4:27-33: 'public': visibility for constructors is ignored
  21. // error: 8:24-52: function expects 1 arguments, 2 provided
  22. // error: 8:41-42: duplicate argument with name 't'
  23. // error: 8:44-49: conversion from bool to int32 not possible
  24. // warning: 14:34-40: 'public': visibility for constructors is ignored