self.carbon 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. //
  5. // AUTOUPDATE
  6. interface UseSelf {
  7. fn F[self: Self]() -> Self;
  8. }
  9. // CHECK:STDOUT: --- self.carbon
  10. // CHECK:STDOUT:
  11. // CHECK:STDOUT: constants {
  12. // CHECK:STDOUT: %.1: type = interface_type @UseSelf [template]
  13. // CHECK:STDOUT: %.2: type = assoc_entity_type @UseSelf, <function> [template]
  14. // CHECK:STDOUT: %.3: <associated <function> in UseSelf> = assoc_entity element0, @UseSelf.%F [template]
  15. // CHECK:STDOUT: }
  16. // CHECK:STDOUT:
  17. // CHECK:STDOUT: file {
  18. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  19. // CHECK:STDOUT: .UseSelf = %UseSelf.decl
  20. // CHECK:STDOUT: }
  21. // CHECK:STDOUT: %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {}
  22. // CHECK:STDOUT: }
  23. // CHECK:STDOUT:
  24. // CHECK:STDOUT: interface @UseSelf {
  25. // CHECK:STDOUT: %Self: UseSelf = bind_symbolic_name Self [symbolic]
  26. // CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
  27. // CHECK:STDOUT: %Self.ref.loc8_14: UseSelf = name_ref Self, %Self [symbolic = %Self]
  28. // CHECK:STDOUT: %.loc8_14.1: type = facet_type_access %Self.ref.loc8_14 [symbolic = %Self]
  29. // CHECK:STDOUT: %.loc8_14.2: type = converted %Self.ref.loc8_14, %.loc8_14.1 [symbolic = %Self]
  30. // CHECK:STDOUT: %self.loc8_8.1: Self = param self
  31. // CHECK:STDOUT: %self.loc8_8.2: Self = bind_name self, %self.loc8_8.1
  32. // CHECK:STDOUT: %Self.ref.loc8_25: UseSelf = name_ref Self, %Self [symbolic = %Self]
  33. // CHECK:STDOUT: %.loc8_25.1: type = facet_type_access %Self.ref.loc8_25 [symbolic = %Self]
  34. // CHECK:STDOUT: %.loc8_25.2: type = converted %Self.ref.loc8_25, %.loc8_25.1 [symbolic = %Self]
  35. // CHECK:STDOUT: %return.var: ref Self = var <return slot>
  36. // CHECK:STDOUT: }
  37. // CHECK:STDOUT: %.loc8_29: <associated <function> in UseSelf> = assoc_entity element0, %F [template = constants.%.3]
  38. // CHECK:STDOUT:
  39. // CHECK:STDOUT: !members:
  40. // CHECK:STDOUT: .Self = %Self
  41. // CHECK:STDOUT: .F = %.loc8_29
  42. // CHECK:STDOUT: witness = (%F)
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT:
  45. // CHECK:STDOUT: fn @F[@UseSelf.%self.loc8_8.2: Self]() -> Self;
  46. // CHECK:STDOUT: