fail_todo_assoc_const_default.carbon 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 I {
  7. // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `interface modifier`.
  8. // CHECK:STDERR: default let T:! type = (i32, i32);
  9. // CHECK:STDERR: ^~~~~~~
  10. default let T:! type = (i32, i32);
  11. // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `interface modifier`.
  12. // CHECK:STDERR: default let N:! i32 = 42;
  13. // CHECK:STDERR: ^~~~~~~
  14. default let N:! i32 = 42;
  15. }
  16. // CHECK:STDOUT: --- fail_todo_assoc_const_default.carbon
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: constants {
  19. // CHECK:STDOUT: %.1: type = interface_type @I [template]
  20. // CHECK:STDOUT: %.2: type = tuple_type (type, type) [template]
  21. // CHECK:STDOUT: %.3: type = tuple_type (i32, i32) [template]
  22. // CHECK:STDOUT: %.4: type = assoc_entity_type @I, type [template]
  23. // CHECK:STDOUT: %.5: <associated type in I> = assoc_entity element0, @I.%T [template]
  24. // CHECK:STDOUT: %.6: i32 = int_literal 42 [template]
  25. // CHECK:STDOUT: %.7: type = assoc_entity_type @I, i32 [template]
  26. // CHECK:STDOUT: %.8: <associated i32 in I> = assoc_entity element1, @I.%N [template]
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT:
  29. // CHECK:STDOUT: file {
  30. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  31. // CHECK:STDOUT: .I = %I.decl
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: interface @I {
  37. // CHECK:STDOUT: %Self: I = bind_symbolic_name Self [symbolic]
  38. // CHECK:STDOUT: %.loc11_35.1: (type, type) = tuple_literal (i32, i32)
  39. // CHECK:STDOUT: %.loc11_35.2: type = converted %.loc11_35.1, constants.%.3 [template = constants.%.3]
  40. // CHECK:STDOUT: %T: type = assoc_const_decl T [template]
  41. // CHECK:STDOUT: %.loc11_36: <associated type in I> = assoc_entity element0, %T [template = constants.%.5]
  42. // CHECK:STDOUT: %.loc15_25: i32 = int_literal 42 [template = constants.%.6]
  43. // CHECK:STDOUT: %N: i32 = assoc_const_decl N [template]
  44. // CHECK:STDOUT: %.loc15_27: <associated i32 in I> = assoc_entity element1, %N [template = constants.%.8]
  45. // CHECK:STDOUT:
  46. // CHECK:STDOUT: !members:
  47. // CHECK:STDOUT: .Self = %Self
  48. // CHECK:STDOUT: .T = %.loc11_36
  49. // CHECK:STDOUT: .N = %.loc15_27
  50. // CHECK:STDOUT: witness = (%T, %N)
  51. // CHECK:STDOUT: }
  52. // CHECK:STDOUT: