fail_todo_assoc_const_default.carbon 2.7 KB

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