types.carbon 853 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. class C1;
  5. class C2(T1:! type, T2:! C1) {}
  6. class C3 {
  7. extend base: C1;
  8. }
  9. class
  10. (C4(
  11. (T1:! type),
  12. T2:!
  13. (A.(B(E, F(G)).C)
  14. .D))) ;
  15. class C5 {
  16. impl as I;
  17. extend impl as I;
  18. }
  19. alias a1 = C1;
  20. alias a2 = i32;
  21. adapt SomeClass;
  22. adapt {.a: SomeClass, .b: i32};
  23. adapt i32;
  24. interface I;
  25. impl C as (I(A, B, C.(D.E(F, G)).H)) {}
  26. impl C as I where .A = (B where .Self = {}) {}
  27. impl C as I where .A = {} and .B = C {}
  28. impl Self as I;
  29. impl as I;
  30. constraint Constraint {
  31. require T impls I;
  32. require Self impls I;
  33. require impls I;
  34. extern require impls I;
  35. }