keep_on_resolving.sol 875 B

123456789101112131415161718192021222324252627282930
  1. import "./type_decl_broken.sol";
  2. struct S {
  3. in f1;
  4. }
  5. function f(S s) returns (int) {
  6. return s.f1;
  7. }
  8. function g(S s) {
  9. s.f1 = "bla";
  10. s = S({f1: 2});
  11. s = S("feh");
  12. s = 1;
  13. }
  14. // ---- Expect: diagnostics ----
  15. // error: 4:2-4: type 'in' not found
  16. // error: 15:6-7: expected 'struct S', found integer
  17. // error: 5:7-10: foo is already defined as a struct
  18. // note 4:9-12: location of previous definition
  19. // error: 5:14-20: 'int256[2]' is not an elementary value type
  20. // error: 6:7-10: foo is already defined as a struct
  21. // note 4:9-12: location of previous definition
  22. // warning: 7:9-18: GlobalFoo is already defined as an user type
  23. // note 1:6-15: location of previous definition
  24. // error: 10:9-14: Value is already defined as an user type
  25. // note 9:7-12: location of previous definition
  26. // error: 13:21-26: implicit conversion would change sign from int136 to uint128