mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Emit NameBindingDecl after the initializer (if any) (#7467)
In some cases the pattern block can depend on the initializer, so it must be sequenced after it. See #7469 for a more detailed explanation of why this is necessary.
This commit is contained in:
+4
-4
@@ -159,10 +159,6 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: %pattern_type.771 = ref_binding_pattern arr [concrete = constants.%arr.patt]
|
||||
// CHECK:STDOUT: %arr.var_patt: %pattern_type.771 = var_pattern %arr.patt [concrete = constants.%arr.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr.var: ref %array_type = var_storage %arr.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc23_40: type = splice_block %array_type [concrete = constants.%array_type] {
|
||||
// CHECK:STDOUT: %i32.loc23_16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
@@ -200,6 +196,10 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT: %array_type: type = array_type %.loc23_39.4, %i32.loc23_16 [concrete = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr: ref %array_type = wrapper_binding arr, %arr.var [concrete = %arr.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: %pattern_type.771 = ref_binding_pattern arr [concrete = constants.%arr.patt]
|
||||
// CHECK:STDOUT: %arr.var_patt: %pattern_type.771 = var_pattern %arr.patt [concrete = constants.%arr.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
|
||||
Reference in New Issue
Block a user