fail_modifiers.carbon 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/let/fail_modifiers.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_modifiers.carbon
  14. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed]
  15. // CHECK:STDERR: protected let b: i32 = 1;
  16. // CHECK:STDERR: ^~~~~~~~~
  17. // CHECK:STDERR:
  18. protected let b: i32 = 1;
  19. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
  20. // CHECK:STDERR: default let c: i32 = 1;
  21. // CHECK:STDERR: ^~~~~~~
  22. // CHECK:STDERR:
  23. default let c: i32 = 1;
  24. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `final` not allowed; requires interface scope [ModifierRequiresInterface]
  25. // CHECK:STDERR: final let d: i32 = 1;
  26. // CHECK:STDERR: ^~~~~
  27. // CHECK:STDERR:
  28. final let d: i32 = 1;
  29. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `virtual` not allowed on `let` declaration [ModifierNotAllowedOnDeclaration]
  30. // CHECK:STDERR: virtual let e: i32 = 1;
  31. // CHECK:STDERR: ^~~~~~~
  32. // CHECK:STDERR:
  33. virtual let e: i32 = 1;
  34. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:9: error: `final` not allowed on declaration with `default` [ModifierNotAllowedWith]
  35. // CHECK:STDERR: default final let f: i32 = 1;
  36. // CHECK:STDERR: ^~~~~
  37. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `default` previously appeared here [ModifierPrevious]
  38. // CHECK:STDERR: default final let f: i32 = 1;
  39. // CHECK:STDERR: ^~~~~~~
  40. // CHECK:STDERR:
  41. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
  42. // CHECK:STDERR: default final let f: i32 = 1;
  43. // CHECK:STDERR: ^~~~~~~
  44. // CHECK:STDERR:
  45. default final let f: i32 = 1;
  46. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:9: error: `default` repeated on declaration [ModifierRepeated]
  47. // CHECK:STDERR: default default let g: i32 = 1;
  48. // CHECK:STDERR: ^~~~~~~
  49. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `default` previously appeared here [ModifierPrevious]
  50. // CHECK:STDERR: default default let g: i32 = 1;
  51. // CHECK:STDERR: ^~~~~~~
  52. // CHECK:STDERR:
  53. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
  54. // CHECK:STDERR: default default let g: i32 = 1;
  55. // CHECK:STDERR: ^~~~~~~
  56. // CHECK:STDERR:
  57. default default let g: i32 = 1;
  58. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:11: error: `private` not allowed on declaration with `protected` [ModifierNotAllowedWith]
  59. // CHECK:STDERR: protected private let h: i32 = 1;
  60. // CHECK:STDERR: ^~~~~~~
  61. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `protected` previously appeared here [ModifierPrevious]
  62. // CHECK:STDERR: protected private let h: i32 = 1;
  63. // CHECK:STDERR: ^~~~~~~~~
  64. // CHECK:STDERR:
  65. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed]
  66. // CHECK:STDERR: protected private let h: i32 = 1;
  67. // CHECK:STDERR: ^~~~~~~~~
  68. // CHECK:STDERR:
  69. protected private let h: i32 = 1;
  70. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:11: error: `protected` repeated on declaration [ModifierRepeated]
  71. // CHECK:STDERR: protected protected let i: i32 = 1;
  72. // CHECK:STDERR: ^~~~~~~~~
  73. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `protected` previously appeared here [ModifierPrevious]
  74. // CHECK:STDERR: protected protected let i: i32 = 1;
  75. // CHECK:STDERR: ^~~~~~~~~
  76. // CHECK:STDERR:
  77. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed]
  78. // CHECK:STDERR: protected protected let i: i32 = 1;
  79. // CHECK:STDERR: ^~~~~~~~~
  80. // CHECK:STDERR:
  81. protected protected let i: i32 = 1;
  82. // CHECK:STDOUT: --- fail_modifiers.carbon
  83. // CHECK:STDOUT:
  84. // CHECK:STDOUT: constants {
  85. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  86. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  87. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  88. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  89. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  90. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  91. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  92. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  93. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  94. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  95. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  96. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  97. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51 = struct_value () [symbolic]
  98. // CHECK:STDOUT: %ImplicitAs.impl_witness.bc9: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.132, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  99. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  100. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e = struct_value () [concrete]
  101. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.bc9) [concrete]
  102. // CHECK:STDOUT: %.322: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  103. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [concrete]
  104. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  105. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  106. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  107. // CHECK:STDOUT: }
  108. // CHECK:STDOUT:
  109. // CHECK:STDOUT: imports {
  110. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  111. // CHECK:STDOUT: .Int = %Core.Int
  112. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  113. // CHECK:STDOUT: import Core//prelude
  114. // CHECK:STDOUT: import Core//prelude/...
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  117. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  118. // CHECK:STDOUT: %Core.import_ref.e24: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1)]
  119. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.132 = impl_witness_table (%Core.import_ref.e24), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  120. // CHECK:STDOUT: }
  121. // CHECK:STDOUT:
  122. // CHECK:STDOUT: file {
  123. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  124. // CHECK:STDOUT: .Core = imports.%Core
  125. // CHECK:STDOUT: .b [protected] = %b
  126. // CHECK:STDOUT: .c = %c
  127. // CHECK:STDOUT: .d = %d
  128. // CHECK:STDOUT: .e = %e
  129. // CHECK:STDOUT: .f = %f
  130. // CHECK:STDOUT: .g = %g
  131. // CHECK:STDOUT: .h [protected] = %h
  132. // CHECK:STDOUT: .i [protected] = %i
  133. // CHECK:STDOUT: }
  134. // CHECK:STDOUT: %Core.import = import Core
  135. // CHECK:STDOUT: name_binding_decl {
  136. // CHECK:STDOUT: %b.patt: %pattern_type.7ce = value_binding_pattern b [concrete]
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT: %.loc19_18: type = splice_block %i32.loc19 [concrete = constants.%i32] {
  139. // CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  140. // CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  141. // CHECK:STDOUT: }
  142. // CHECK:STDOUT: %impl.elem0.loc19: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  143. // CHECK:STDOUT: %bound_method.loc19_24.1: <bound method> = bound_method @__global_init.%int_1.loc19, %impl.elem0.loc19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  144. // CHECK:STDOUT: %specific_fn.loc19: <specific function> = specific_function %impl.elem0.loc19, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  145. // CHECK:STDOUT: %bound_method.loc19_24.2: <bound method> = bound_method @__global_init.%int_1.loc19, %specific_fn.loc19 [concrete = constants.%bound_method]
  146. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19: init %i32 = call %bound_method.loc19_24.2(@__global_init.%int_1.loc19) [concrete = constants.%int_1.5d2]
  147. // CHECK:STDOUT: %.loc19_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19 [concrete = constants.%int_1.5d2]
  148. // CHECK:STDOUT: %.loc19_24.2: %i32 = converted @__global_init.%int_1.loc19, %.loc19_24.1 [concrete = constants.%int_1.5d2]
  149. // CHECK:STDOUT: %b: %i32 = value_binding b, %.loc19_24.2
  150. // CHECK:STDOUT: name_binding_decl {
  151. // CHECK:STDOUT: %c.patt: %pattern_type.7ce = value_binding_pattern c [concrete]
  152. // CHECK:STDOUT: }
  153. // CHECK:STDOUT: %.loc25_16: type = splice_block %i32.loc25 [concrete = constants.%i32] {
  154. // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  155. // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT: %impl.elem0.loc25: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  158. // CHECK:STDOUT: %bound_method.loc25_22.1: <bound method> = bound_method @__global_init.%int_1.loc25, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  159. // CHECK:STDOUT: %specific_fn.loc25: <specific function> = specific_function %impl.elem0.loc25, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  160. // CHECK:STDOUT: %bound_method.loc25_22.2: <bound method> = bound_method @__global_init.%int_1.loc25, %specific_fn.loc25 [concrete = constants.%bound_method]
  161. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i32 = call %bound_method.loc25_22.2(@__global_init.%int_1.loc25) [concrete = constants.%int_1.5d2]
  162. // CHECK:STDOUT: %.loc25_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_1.5d2]
  163. // CHECK:STDOUT: %.loc25_22.2: %i32 = converted @__global_init.%int_1.loc25, %.loc25_22.1 [concrete = constants.%int_1.5d2]
  164. // CHECK:STDOUT: %c: %i32 = value_binding c, %.loc25_22.2
  165. // CHECK:STDOUT: name_binding_decl {
  166. // CHECK:STDOUT: %d.patt: %pattern_type.7ce = value_binding_pattern d [concrete]
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT: %.loc31_14: type = splice_block %i32.loc31 [concrete = constants.%i32] {
  169. // CHECK:STDOUT: %int_32.loc31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  170. // CHECK:STDOUT: %i32.loc31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT: %impl.elem0.loc31: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  173. // CHECK:STDOUT: %bound_method.loc31_20.1: <bound method> = bound_method @__global_init.%int_1.loc31, %impl.elem0.loc31 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  174. // CHECK:STDOUT: %specific_fn.loc31: <specific function> = specific_function %impl.elem0.loc31, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  175. // CHECK:STDOUT: %bound_method.loc31_20.2: <bound method> = bound_method @__global_init.%int_1.loc31, %specific_fn.loc31 [concrete = constants.%bound_method]
  176. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc31: init %i32 = call %bound_method.loc31_20.2(@__global_init.%int_1.loc31) [concrete = constants.%int_1.5d2]
  177. // CHECK:STDOUT: %.loc31_20.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc31 [concrete = constants.%int_1.5d2]
  178. // CHECK:STDOUT: %.loc31_20.2: %i32 = converted @__global_init.%int_1.loc31, %.loc31_20.1 [concrete = constants.%int_1.5d2]
  179. // CHECK:STDOUT: %d: %i32 = value_binding d, %.loc31_20.2
  180. // CHECK:STDOUT: name_binding_decl {
  181. // CHECK:STDOUT: %e.patt: %pattern_type.7ce = value_binding_pattern e [concrete]
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT: %.loc37_16: type = splice_block %i32.loc37 [concrete = constants.%i32] {
  184. // CHECK:STDOUT: %int_32.loc37: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  185. // CHECK:STDOUT: %i32.loc37: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT: %impl.elem0.loc37: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  188. // CHECK:STDOUT: %bound_method.loc37_22.1: <bound method> = bound_method @__global_init.%int_1.loc37, %impl.elem0.loc37 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  189. // CHECK:STDOUT: %specific_fn.loc37: <specific function> = specific_function %impl.elem0.loc37, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  190. // CHECK:STDOUT: %bound_method.loc37_22.2: <bound method> = bound_method @__global_init.%int_1.loc37, %specific_fn.loc37 [concrete = constants.%bound_method]
  191. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc37: init %i32 = call %bound_method.loc37_22.2(@__global_init.%int_1.loc37) [concrete = constants.%int_1.5d2]
  192. // CHECK:STDOUT: %.loc37_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc37 [concrete = constants.%int_1.5d2]
  193. // CHECK:STDOUT: %.loc37_22.2: %i32 = converted @__global_init.%int_1.loc37, %.loc37_22.1 [concrete = constants.%int_1.5d2]
  194. // CHECK:STDOUT: %e: %i32 = value_binding e, %.loc37_22.2
  195. // CHECK:STDOUT: name_binding_decl {
  196. // CHECK:STDOUT: %f.patt: %pattern_type.7ce = value_binding_pattern f [concrete]
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT: %.loc50_22: type = splice_block %i32.loc50 [concrete = constants.%i32] {
  199. // CHECK:STDOUT: %int_32.loc50: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  200. // CHECK:STDOUT: %i32.loc50: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  201. // CHECK:STDOUT: }
  202. // CHECK:STDOUT: %impl.elem0.loc50: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  203. // CHECK:STDOUT: %bound_method.loc50_28.1: <bound method> = bound_method @__global_init.%int_1.loc50, %impl.elem0.loc50 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  204. // CHECK:STDOUT: %specific_fn.loc50: <specific function> = specific_function %impl.elem0.loc50, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  205. // CHECK:STDOUT: %bound_method.loc50_28.2: <bound method> = bound_method @__global_init.%int_1.loc50, %specific_fn.loc50 [concrete = constants.%bound_method]
  206. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc50: init %i32 = call %bound_method.loc50_28.2(@__global_init.%int_1.loc50) [concrete = constants.%int_1.5d2]
  207. // CHECK:STDOUT: %.loc50_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc50 [concrete = constants.%int_1.5d2]
  208. // CHECK:STDOUT: %.loc50_28.2: %i32 = converted @__global_init.%int_1.loc50, %.loc50_28.1 [concrete = constants.%int_1.5d2]
  209. // CHECK:STDOUT: %f: %i32 = value_binding f, %.loc50_28.2
  210. // CHECK:STDOUT: name_binding_decl {
  211. // CHECK:STDOUT: %g.patt: %pattern_type.7ce = value_binding_pattern g [concrete]
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT: %.loc63_24: type = splice_block %i32.loc63 [concrete = constants.%i32] {
  214. // CHECK:STDOUT: %int_32.loc63: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  215. // CHECK:STDOUT: %i32.loc63: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  216. // CHECK:STDOUT: }
  217. // CHECK:STDOUT: %impl.elem0.loc63: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  218. // CHECK:STDOUT: %bound_method.loc63_30.1: <bound method> = bound_method @__global_init.%int_1.loc63, %impl.elem0.loc63 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  219. // CHECK:STDOUT: %specific_fn.loc63: <specific function> = specific_function %impl.elem0.loc63, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  220. // CHECK:STDOUT: %bound_method.loc63_30.2: <bound method> = bound_method @__global_init.%int_1.loc63, %specific_fn.loc63 [concrete = constants.%bound_method]
  221. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc63: init %i32 = call %bound_method.loc63_30.2(@__global_init.%int_1.loc63) [concrete = constants.%int_1.5d2]
  222. // CHECK:STDOUT: %.loc63_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc63 [concrete = constants.%int_1.5d2]
  223. // CHECK:STDOUT: %.loc63_30.2: %i32 = converted @__global_init.%int_1.loc63, %.loc63_30.1 [concrete = constants.%int_1.5d2]
  224. // CHECK:STDOUT: %g: %i32 = value_binding g, %.loc63_30.2
  225. // CHECK:STDOUT: name_binding_decl {
  226. // CHECK:STDOUT: %h.patt: %pattern_type.7ce = value_binding_pattern h [concrete]
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT: %.loc76_26: type = splice_block %i32.loc76 [concrete = constants.%i32] {
  229. // CHECK:STDOUT: %int_32.loc76: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  230. // CHECK:STDOUT: %i32.loc76: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT: %impl.elem0.loc76: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  233. // CHECK:STDOUT: %bound_method.loc76_32.1: <bound method> = bound_method @__global_init.%int_1.loc76, %impl.elem0.loc76 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  234. // CHECK:STDOUT: %specific_fn.loc76: <specific function> = specific_function %impl.elem0.loc76, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  235. // CHECK:STDOUT: %bound_method.loc76_32.2: <bound method> = bound_method @__global_init.%int_1.loc76, %specific_fn.loc76 [concrete = constants.%bound_method]
  236. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc76: init %i32 = call %bound_method.loc76_32.2(@__global_init.%int_1.loc76) [concrete = constants.%int_1.5d2]
  237. // CHECK:STDOUT: %.loc76_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc76 [concrete = constants.%int_1.5d2]
  238. // CHECK:STDOUT: %.loc76_32.2: %i32 = converted @__global_init.%int_1.loc76, %.loc76_32.1 [concrete = constants.%int_1.5d2]
  239. // CHECK:STDOUT: %h: %i32 = value_binding h, %.loc76_32.2
  240. // CHECK:STDOUT: name_binding_decl {
  241. // CHECK:STDOUT: %i.patt: %pattern_type.7ce = value_binding_pattern i [concrete]
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT: %.loc89_28: type = splice_block %i32.loc89 [concrete = constants.%i32] {
  244. // CHECK:STDOUT: %int_32.loc89: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  245. // CHECK:STDOUT: %i32.loc89: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT: %impl.elem0.loc89: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  248. // CHECK:STDOUT: %bound_method.loc89_34.1: <bound method> = bound_method @__global_init.%int_1.loc89, %impl.elem0.loc89 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  249. // CHECK:STDOUT: %specific_fn.loc89: <specific function> = specific_function %impl.elem0.loc89, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  250. // CHECK:STDOUT: %bound_method.loc89_34.2: <bound method> = bound_method @__global_init.%int_1.loc89, %specific_fn.loc89 [concrete = constants.%bound_method]
  251. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc89: init %i32 = call %bound_method.loc89_34.2(@__global_init.%int_1.loc89) [concrete = constants.%int_1.5d2]
  252. // CHECK:STDOUT: %.loc89_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc89 [concrete = constants.%int_1.5d2]
  253. // CHECK:STDOUT: %.loc89_34.2: %i32 = converted @__global_init.%int_1.loc89, %.loc89_34.1 [concrete = constants.%int_1.5d2]
  254. // CHECK:STDOUT: %i: %i32 = value_binding i, %.loc89_34.2
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: fn @__global_init() {
  258. // CHECK:STDOUT: !entry:
  259. // CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  260. // CHECK:STDOUT: %int_1.loc25: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  261. // CHECK:STDOUT: %int_1.loc31: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  262. // CHECK:STDOUT: %int_1.loc37: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  263. // CHECK:STDOUT: %int_1.loc50: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  264. // CHECK:STDOUT: %int_1.loc63: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  265. // CHECK:STDOUT: %int_1.loc76: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  266. // CHECK:STDOUT: %int_1.loc89: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  267. // CHECK:STDOUT: return
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT: