functions_variables.carbon 725 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. fn F;
  5. fn F1();
  6. fn Func(a: i32, b: A);
  7. fn Generic[T:! type, U:! I](a: T, b: U) -> U;
  8. fn Lambda(a: i32) -> i32 => return a + 5;
  9. fn
  10. MultiLine[
  11. A:! type,
  12. B:! C1,
  13. C:! C2
  14. ](a: A(B, C),
  15. b: B,
  16. c: i32);
  17. fn Invalid#+?Name();
  18. x.(I.F)();
  19. a: A;
  20. a: A = (b as A);
  21. a: i32;
  22. a: array(A, 5);
  23. a:! type;
  24. a:! T = b;
  25. a: A in some_list;
  26. var a: T;
  27. let b: T;
  28. binding: T;
  29. binding:! T;
  30. var
  31. multiline: T;
  32. fn F(ref a: A, const ref b:! B);
  33. fn F() -> T;
  34. fn F() -> T.U { return val; }
  35. fn F() -> i32 => return val;