using_08.sol 510 B

123456789101112131415161718192021222324
  1. function foo(int) {}
  2. struct S { int f1; }
  3. function bar(S memory) {}
  4. using {foo} for *;
  5. using {foo} for int global;
  6. using {foo} for int;
  7. using {bar} for S meh;
  8. function test(int a) {
  9. a.foo();
  10. }
  11. contract c {
  12. function f(S memory s) public {
  13. s.bar();
  14. }
  15. }
  16. // ---- Expect: diagnostics ----
  17. // error: 5:1-18: using must be bound to specific type, '*' cannot be used on file scope
  18. // error: 6:21-27: 'global' only permitted on user defined types
  19. // error: 8:19-22: 'meh' not expected, did you mean 'global'?