Explorar o código

Attempt to complete the source type in a conversion. (#5984)

This is necessary if the source type is an adapter, as we would not
otherwise be able to determine what type it adapts and hence could be
converted to.
Richard Smith hai 8 meses
pai
achega
1331ade57f

+ 8 - 0
toolchain/check/convert.cpp

@@ -1303,6 +1303,14 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id,
     return SemIR::ErrorInst::InstId;
     return SemIR::ErrorInst::InstId;
   }
   }
 
 
+  // The source type doesn't need to be complete, but its completeness can
+  // affect the result. For example, we don't know what type it adapts or
+  // derives from unless it's complete.
+  // TODO: Is there a risk of coherence problems if the source type is
+  // incomplete, but a conversion would have been possible or would have behaved
+  // differently if it were complete?
+  TryToCompleteType(context, context.insts().Get(expr_id).type_id(), loc_id);
+
   // Check whether any builtin conversion applies.
   // Check whether any builtin conversion applies.
   expr_id = PerformBuiltinConversion(context, loc_id, expr_id, target,
   expr_id = PerformBuiltinConversion(context, loc_id, expr_id, target,
                                      vtable_class_type);
                                      vtable_class_type);

+ 3 - 3
toolchain/check/testdata/as/basics.carbon

@@ -175,7 +175,7 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %pattern_type: type = pattern_type type [concrete]
 // CHECK:STDOUT:   %pattern_type: type = pattern_type type [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
+// CHECK:STDOUT:   %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
 // CHECK:STDOUT: imports {
@@ -192,10 +192,10 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc5_17: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc5_17: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc5_21: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc5_21: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %.loc5_22: %tuple.type = tuple_literal (%.loc5_17, %.loc5_21)
+// CHECK:STDOUT:   %.loc5_22: %tuple.type.b6b = tuple_literal (%.loc5_17, %.loc5_21)
 // CHECK:STDOUT:   %.loc5_24.1: type = converted %.loc5_17, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
 // CHECK:STDOUT:   %.loc5_24.1: type = converted %.loc5_17, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
 // CHECK:STDOUT:   %.loc5_24.2: type = converted %.loc5_21, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
 // CHECK:STDOUT:   %.loc5_24.2: type = converted %.loc5_21, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %.loc5_24.3: type = converted %.loc5_22, constants.%tuple.type [concrete = constants.%tuple.type]
+// CHECK:STDOUT:   %.loc5_24.3: type = converted %.loc5_22, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
 // CHECK:STDOUT:   <elided>
 // CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:

+ 109 - 103
toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon

@@ -25,16 +25,16 @@ fn Foo[T:! type](n: T) -> (T, ()) {
 // CHECK:STDOUT:     ir1:             {decl_id: inst<none>, is_export: false}
 // CHECK:STDOUT:     ir1:             {decl_id: inst<none>, is_export: false}
 // CHECK:STDOUT:   import_ir_insts: {}
 // CHECK:STDOUT:   import_ir_insts: {}
 // CHECK:STDOUT:   name_scopes:
 // CHECK:STDOUT:   name_scopes:
-// CHECK:STDOUT:     name_scope0:     {inst: inst14, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst44}}
+// CHECK:STDOUT:     name_scope0:     {inst: inst14, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst45}}
 // CHECK:STDOUT:   entity_names:
 // CHECK:STDOUT:   entity_names:
 // CHECK:STDOUT:     entity_name0:    {name: name(PeriodSelf), parent_scope: name_scope<none>, index: -1, is_template: 0}
 // CHECK:STDOUT:     entity_name0:    {name: name(PeriodSelf), parent_scope: name_scope<none>, index: -1, is_template: 0}
 // CHECK:STDOUT:     entity_name1:    {name: name1, parent_scope: name_scope<none>, index: 0, is_template: 0}
 // CHECK:STDOUT:     entity_name1:    {name: name1, parent_scope: name_scope<none>, index: 0, is_template: 0}
 // CHECK:STDOUT:     entity_name2:    {name: name2, parent_scope: name_scope<none>, index: -1, is_template: 0}
 // CHECK:STDOUT:     entity_name2:    {name: name2, parent_scope: name_scope<none>, index: -1, is_template: 0}
 // CHECK:STDOUT:   functions:
 // CHECK:STDOUT:   functions:
-// CHECK:STDOUT:     function0:       {name: name0, parent_scope: name_scope0, call_params_id: inst_block13, return_slot_pattern: inst40, body: [inst_block20]}
+// CHECK:STDOUT:     function0:       {name: name0, parent_scope: name_scope0, call_params_id: inst_block13, return_slot_pattern: inst41, body: [inst_block20]}
 // CHECK:STDOUT:   classes:         {}
 // CHECK:STDOUT:   classes:         {}
 // CHECK:STDOUT:   generics:
 // CHECK:STDOUT:   generics:
-// CHECK:STDOUT:     generic0:        {decl: inst44, bindings: inst_block16}
+// CHECK:STDOUT:     generic0:        {decl: inst45, bindings: inst_block16}
 // CHECK:STDOUT:   specifics:
 // CHECK:STDOUT:   specifics:
 // CHECK:STDOUT:     specific0:       {generic: generic0, args: inst_block17}
 // CHECK:STDOUT:     specific0:       {generic: generic0, args: inst_block17}
 // CHECK:STDOUT:   struct_type_fields:
 // CHECK:STDOUT:   struct_type_fields:
@@ -46,10 +46,14 @@ fn Foo[T:! type](n: T) -> (T, ()) {
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(Error)}
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(Error)}
 // CHECK:STDOUT:     'type(inst(NamespaceType))':
 // CHECK:STDOUT:     'type(inst(NamespaceType))':
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(inst(NamespaceType))}
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(inst(NamespaceType))}
-// CHECK:STDOUT:     'type(inst45)':
-// CHECK:STDOUT:       value_repr:      {kind: none, type: type(inst29)}
 // CHECK:STDOUT:     'type(inst29)':
 // CHECK:STDOUT:     'type(inst29)':
 // CHECK:STDOUT:       value_repr:      {kind: none, type: type(inst29)}
 // CHECK:STDOUT:       value_repr:      {kind: none, type: type(inst29)}
+// CHECK:STDOUT:     'type(inst31)':
+// CHECK:STDOUT:       value_repr:      {kind: pointer, type: type(inst33)}
+// CHECK:STDOUT:     'type(inst33)':
+// CHECK:STDOUT:       value_repr:      {kind: copy, type: type(inst33)}
+// CHECK:STDOUT:     'type(inst46)':
+// CHECK:STDOUT:       value_repr:      {kind: none, type: type(inst29)}
 // CHECK:STDOUT:     'type(symbolic_constant1)':
 // CHECK:STDOUT:     'type(symbolic_constant1)':
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(symbolic_constant1)}
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(symbolic_constant1)}
 // CHECK:STDOUT:     'type(symbolic_constant5)':
 // CHECK:STDOUT:     'type(symbolic_constant5)':
@@ -72,7 +76,7 @@ fn Foo[T:! type](n: T) -> (T, ()) {
 // CHECK:STDOUT:     inst20:          {kind: PatternType, arg0: inst(TypeType), type: type(TypeType)}
 // CHECK:STDOUT:     inst20:          {kind: PatternType, arg0: inst(TypeType), type: type(TypeType)}
 // CHECK:STDOUT:     inst21:          {kind: SymbolicBindingPattern, arg0: entity_name1, type: type(inst20)}
 // CHECK:STDOUT:     inst21:          {kind: SymbolicBindingPattern, arg0: entity_name1, type: type(inst20)}
 // CHECK:STDOUT:     inst22:          {kind: NameRef, arg0: name1, arg1: inst17, type: type(TypeType)}
 // CHECK:STDOUT:     inst22:          {kind: NameRef, arg0: name1, arg1: inst17, type: type(TypeType)}
-// CHECK:STDOUT:     inst23:          {kind: BindName, arg0: entity_name2, arg1: inst41, type: type(symbolic_constant2)}
+// CHECK:STDOUT:     inst23:          {kind: BindName, arg0: entity_name2, arg1: inst42, type: type(symbolic_constant2)}
 // CHECK:STDOUT:     inst24:          {kind: PatternType, arg0: inst18, type: type(TypeType)}
 // CHECK:STDOUT:     inst24:          {kind: PatternType, arg0: inst18, type: type(TypeType)}
 // CHECK:STDOUT:     inst25:          {kind: BindingPattern, arg0: entity_name2, type: type(symbolic_constant4)}
 // CHECK:STDOUT:     inst25:          {kind: BindingPattern, arg0: entity_name2, type: type(symbolic_constant4)}
 // CHECK:STDOUT:     inst26:          {kind: PatternType, arg0: inst19, type: type(TypeType)}
 // CHECK:STDOUT:     inst26:          {kind: PatternType, arg0: inst19, type: type(TypeType)}
@@ -82,41 +86,42 @@ fn Foo[T:! type](n: T) -> (T, ()) {
 // CHECK:STDOUT:     inst30:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst29)}
 // CHECK:STDOUT:     inst30:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst29)}
 // CHECK:STDOUT:     inst31:          {kind: TupleType, arg0: inst_block9, type: type(TypeType)}
 // CHECK:STDOUT:     inst31:          {kind: TupleType, arg0: inst_block9, type: type(TypeType)}
 // CHECK:STDOUT:     inst32:          {kind: TupleLiteral, arg0: inst_block8, type: type(inst31)}
 // CHECK:STDOUT:     inst32:          {kind: TupleLiteral, arg0: inst_block8, type: type(inst31)}
-// CHECK:STDOUT:     inst33:          {kind: Converted, arg0: inst30, arg1: inst29, type: type(TypeType)}
-// CHECK:STDOUT:     inst34:          {kind: TupleType, arg0: inst_block11, type: type(TypeType)}
-// CHECK:STDOUT:     inst35:          {kind: Converted, arg0: inst32, arg1: inst34, type: type(TypeType)}
-// CHECK:STDOUT:     inst36:          {kind: TupleType, arg0: inst_block12, type: type(TypeType)}
-// CHECK:STDOUT:     inst37:          {kind: PatternType, arg0: inst34, type: type(TypeType)}
-// CHECK:STDOUT:     inst38:          {kind: ReturnSlotPattern, arg0: inst35, type: type(symbolic_constant8)}
-// CHECK:STDOUT:     inst39:          {kind: PatternType, arg0: inst36, type: type(TypeType)}
-// CHECK:STDOUT:     inst40:          {kind: OutParamPattern, arg0: inst38, arg1: call_param1, type: type(symbolic_constant8)}
-// CHECK:STDOUT:     inst41:          {kind: ValueParam, arg0: call_param0, arg1: name2, type: type(symbolic_constant2)}
-// CHECK:STDOUT:     inst42:          {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(symbolic_constant6)}
-// CHECK:STDOUT:     inst43:          {kind: ReturnSlot, arg0: inst34, arg1: inst42, type: type(symbolic_constant6)}
-// CHECK:STDOUT:     inst44:          {kind: FunctionDecl, arg0: function0, arg1: inst_block15, type: type(inst45)}
-// CHECK:STDOUT:     inst45:          {kind: FunctionType, arg0: function0, arg1: specific<none>, type: type(TypeType)}
-// CHECK:STDOUT:     inst46:          {kind: StructValue, arg0: inst_block_empty, type: type(inst45)}
-// CHECK:STDOUT:     inst47:          {kind: PointerType, arg0: inst34, type: type(TypeType)}
-// CHECK:STDOUT:     inst48:          {kind: RequireCompleteType, arg0: inst34, type: type(inst(WitnessType))}
-// CHECK:STDOUT:     inst49:          {kind: RequireCompleteType, arg0: inst34, type: type(inst(WitnessType))}
-// CHECK:STDOUT:     inst50:          {kind: RequireCompleteType, arg0: inst36, type: type(inst(WitnessType))}
-// CHECK:STDOUT:     inst51:          {kind: RequireCompleteType, arg0: inst18, type: type(inst(WitnessType))}
+// CHECK:STDOUT:     inst33:          {kind: PointerType, arg0: inst31, type: type(TypeType)}
+// CHECK:STDOUT:     inst34:          {kind: Converted, arg0: inst30, arg1: inst29, type: type(TypeType)}
+// CHECK:STDOUT:     inst35:          {kind: TupleType, arg0: inst_block11, type: type(TypeType)}
+// CHECK:STDOUT:     inst36:          {kind: Converted, arg0: inst32, arg1: inst35, type: type(TypeType)}
+// CHECK:STDOUT:     inst37:          {kind: TupleType, arg0: inst_block12, type: type(TypeType)}
+// CHECK:STDOUT:     inst38:          {kind: PatternType, arg0: inst35, type: type(TypeType)}
+// CHECK:STDOUT:     inst39:          {kind: ReturnSlotPattern, arg0: inst36, type: type(symbolic_constant8)}
+// CHECK:STDOUT:     inst40:          {kind: PatternType, arg0: inst37, type: type(TypeType)}
+// CHECK:STDOUT:     inst41:          {kind: OutParamPattern, arg0: inst39, arg1: call_param1, type: type(symbolic_constant8)}
+// CHECK:STDOUT:     inst42:          {kind: ValueParam, arg0: call_param0, arg1: name2, type: type(symbolic_constant2)}
+// CHECK:STDOUT:     inst43:          {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(symbolic_constant6)}
+// CHECK:STDOUT:     inst44:          {kind: ReturnSlot, arg0: inst35, arg1: inst43, type: type(symbolic_constant6)}
+// CHECK:STDOUT:     inst45:          {kind: FunctionDecl, arg0: function0, arg1: inst_block15, type: type(inst46)}
+// CHECK:STDOUT:     inst46:          {kind: FunctionType, arg0: function0, arg1: specific<none>, type: type(TypeType)}
+// CHECK:STDOUT:     inst47:          {kind: StructValue, arg0: inst_block_empty, type: type(inst46)}
+// CHECK:STDOUT:     inst48:          {kind: PointerType, arg0: inst35, type: type(TypeType)}
+// CHECK:STDOUT:     inst49:          {kind: RequireCompleteType, arg0: inst35, type: type(inst(WitnessType))}
+// CHECK:STDOUT:     inst50:          {kind: RequireCompleteType, arg0: inst35, type: type(inst(WitnessType))}
+// CHECK:STDOUT:     inst51:          {kind: RequireCompleteType, arg0: inst37, type: type(inst(WitnessType))}
 // CHECK:STDOUT:     inst52:          {kind: RequireCompleteType, arg0: inst18, type: type(inst(WitnessType))}
 // CHECK:STDOUT:     inst52:          {kind: RequireCompleteType, arg0: inst18, type: type(inst(WitnessType))}
-// CHECK:STDOUT:     inst53:          {kind: RequireCompleteType, arg0: inst19, type: type(inst(WitnessType))}
-// CHECK:STDOUT:     inst54:          {kind: NameRef, arg0: name2, arg1: inst23, type: type(symbolic_constant2)}
-// CHECK:STDOUT:     inst55:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst29)}
-// CHECK:STDOUT:     inst56:          {kind: TupleLiteral, arg0: inst_block21, type: type(symbolic_constant6)}
-// CHECK:STDOUT:     inst57:          {kind: RequireCompleteType, arg0: inst34, type: type(inst(WitnessType))}
-// CHECK:STDOUT:     inst58:          {kind: TupleAccess, arg0: inst43, arg1: element0, type: type(symbolic_constant2)}
-// CHECK:STDOUT:     inst59:          {kind: RequireCompleteType, arg0: inst18, type: type(inst(WitnessType))}
-// CHECK:STDOUT:     inst60:          {kind: InitializeFrom, arg0: inst54, arg1: inst58, type: type(symbolic_constant2)}
-// CHECK:STDOUT:     inst61:          {kind: TupleAccess, arg0: inst43, arg1: element1, type: type(inst29)}
-// CHECK:STDOUT:     inst62:          {kind: TupleInit, arg0: inst_block_empty, arg1: inst61, type: type(inst29)}
-// CHECK:STDOUT:     inst63:          {kind: TupleValue, arg0: inst_block_empty, type: type(inst29)}
-// CHECK:STDOUT:     inst64:          {kind: Converted, arg0: inst55, arg1: inst62, type: type(inst29)}
-// CHECK:STDOUT:     inst65:          {kind: TupleInit, arg0: inst_block22, arg1: inst43, type: type(symbolic_constant6)}
-// CHECK:STDOUT:     inst66:          {kind: Converted, arg0: inst56, arg1: inst65, type: type(symbolic_constant6)}
-// CHECK:STDOUT:     inst67:          {kind: ReturnExpr, arg0: inst66, arg1: inst43}
+// CHECK:STDOUT:     inst53:          {kind: RequireCompleteType, arg0: inst18, type: type(inst(WitnessType))}
+// CHECK:STDOUT:     inst54:          {kind: RequireCompleteType, arg0: inst19, type: type(inst(WitnessType))}
+// CHECK:STDOUT:     inst55:          {kind: NameRef, arg0: name2, arg1: inst23, type: type(symbolic_constant2)}
+// CHECK:STDOUT:     inst56:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst29)}
+// CHECK:STDOUT:     inst57:          {kind: TupleLiteral, arg0: inst_block21, type: type(symbolic_constant6)}
+// CHECK:STDOUT:     inst58:          {kind: RequireCompleteType, arg0: inst35, type: type(inst(WitnessType))}
+// CHECK:STDOUT:     inst59:          {kind: TupleAccess, arg0: inst44, arg1: element0, type: type(symbolic_constant2)}
+// CHECK:STDOUT:     inst60:          {kind: RequireCompleteType, arg0: inst18, type: type(inst(WitnessType))}
+// CHECK:STDOUT:     inst61:          {kind: InitializeFrom, arg0: inst55, arg1: inst59, type: type(symbolic_constant2)}
+// CHECK:STDOUT:     inst62:          {kind: TupleAccess, arg0: inst44, arg1: element1, type: type(inst29)}
+// CHECK:STDOUT:     inst63:          {kind: TupleInit, arg0: inst_block_empty, arg1: inst62, type: type(inst29)}
+// CHECK:STDOUT:     inst64:          {kind: TupleValue, arg0: inst_block_empty, type: type(inst29)}
+// CHECK:STDOUT:     inst65:          {kind: Converted, arg0: inst56, arg1: inst63, type: type(inst29)}
+// CHECK:STDOUT:     inst66:          {kind: TupleInit, arg0: inst_block22, arg1: inst44, type: type(symbolic_constant6)}
+// CHECK:STDOUT:     inst67:          {kind: Converted, arg0: inst57, arg1: inst66, type: type(symbolic_constant6)}
+// CHECK:STDOUT:     inst68:          {kind: ReturnExpr, arg0: inst67, arg1: inst44}
 // CHECK:STDOUT:   constant_values:
 // CHECK:STDOUT:   constant_values:
 // CHECK:STDOUT:     values:
 // CHECK:STDOUT:     values:
 // CHECK:STDOUT:       inst14:          concrete_constant(inst14)
 // CHECK:STDOUT:       inst14:          concrete_constant(inst14)
@@ -135,48 +140,49 @@ fn Foo[T:! type](n: T) -> (T, ()) {
 // CHECK:STDOUT:       inst28:          symbolic_constant2
 // CHECK:STDOUT:       inst28:          symbolic_constant2
 // CHECK:STDOUT:       inst29:          concrete_constant(inst29)
 // CHECK:STDOUT:       inst29:          concrete_constant(inst29)
 // CHECK:STDOUT:       inst31:          concrete_constant(inst31)
 // CHECK:STDOUT:       inst31:          concrete_constant(inst31)
-// CHECK:STDOUT:       inst33:          concrete_constant(inst29)
-// CHECK:STDOUT:       inst34:          symbolic_constant5
-// CHECK:STDOUT:       inst35:          symbolic_constant6
+// CHECK:STDOUT:       inst33:          concrete_constant(inst33)
+// CHECK:STDOUT:       inst34:          concrete_constant(inst29)
+// CHECK:STDOUT:       inst35:          symbolic_constant5
 // CHECK:STDOUT:       inst36:          symbolic_constant6
 // CHECK:STDOUT:       inst36:          symbolic_constant6
-// CHECK:STDOUT:       inst37:          symbolic_constant7
-// CHECK:STDOUT:       inst38:          concrete_constant(inst38)
-// CHECK:STDOUT:       inst39:          symbolic_constant8
-// CHECK:STDOUT:       inst40:          concrete_constant(inst40)
-// CHECK:STDOUT:       inst44:          concrete_constant(inst46)
-// CHECK:STDOUT:       inst45:          concrete_constant(inst45)
+// CHECK:STDOUT:       inst37:          symbolic_constant6
+// CHECK:STDOUT:       inst38:          symbolic_constant7
+// CHECK:STDOUT:       inst39:          concrete_constant(inst39)
+// CHECK:STDOUT:       inst40:          symbolic_constant8
+// CHECK:STDOUT:       inst41:          concrete_constant(inst41)
+// CHECK:STDOUT:       inst45:          concrete_constant(inst47)
 // CHECK:STDOUT:       inst46:          concrete_constant(inst46)
 // CHECK:STDOUT:       inst46:          concrete_constant(inst46)
-// CHECK:STDOUT:       inst47:          symbolic_constant9
-// CHECK:STDOUT:       inst48:          symbolic_constant11
-// CHECK:STDOUT:       inst49:          symbolic_constant10
-// CHECK:STDOUT:       inst50:          symbolic_constant11
-// CHECK:STDOUT:       inst51:          symbolic_constant13
-// CHECK:STDOUT:       inst52:          symbolic_constant12
-// CHECK:STDOUT:       inst53:          symbolic_constant13
-// CHECK:STDOUT:       inst57:          symbolic_constant11
-// CHECK:STDOUT:       inst59:          symbolic_constant13
-// CHECK:STDOUT:       inst62:          concrete_constant(inst63)
-// CHECK:STDOUT:       inst63:          concrete_constant(inst63)
-// CHECK:STDOUT:       inst64:          concrete_constant(inst63)
+// CHECK:STDOUT:       inst47:          concrete_constant(inst47)
+// CHECK:STDOUT:       inst48:          symbolic_constant9
+// CHECK:STDOUT:       inst49:          symbolic_constant11
+// CHECK:STDOUT:       inst50:          symbolic_constant10
+// CHECK:STDOUT:       inst51:          symbolic_constant11
+// CHECK:STDOUT:       inst52:          symbolic_constant13
+// CHECK:STDOUT:       inst53:          symbolic_constant12
+// CHECK:STDOUT:       inst54:          symbolic_constant13
+// CHECK:STDOUT:       inst58:          symbolic_constant11
+// CHECK:STDOUT:       inst60:          symbolic_constant13
+// CHECK:STDOUT:       inst63:          concrete_constant(inst64)
+// CHECK:STDOUT:       inst64:          concrete_constant(inst64)
+// CHECK:STDOUT:       inst65:          concrete_constant(inst64)
 // CHECK:STDOUT:     symbolic_constants:
 // CHECK:STDOUT:     symbolic_constants:
 // CHECK:STDOUT:       symbolic_constant0: {inst: inst16, generic: generic<none>, index: generic_inst<none>, kind: self}
 // CHECK:STDOUT:       symbolic_constant0: {inst: inst16, generic: generic<none>, index: generic_inst<none>, kind: self}
 // CHECK:STDOUT:       symbolic_constant1: {inst: inst18, generic: generic<none>, index: generic_inst<none>, kind: checked}
 // CHECK:STDOUT:       symbolic_constant1: {inst: inst18, generic: generic<none>, index: generic_inst<none>, kind: checked}
 // CHECK:STDOUT:       symbolic_constant2: {inst: inst18, generic: generic0, index: generic_inst_in_decl0, kind: checked}
 // CHECK:STDOUT:       symbolic_constant2: {inst: inst18, generic: generic0, index: generic_inst_in_decl0, kind: checked}
 // CHECK:STDOUT:       symbolic_constant3: {inst: inst24, generic: generic<none>, index: generic_inst<none>, kind: checked}
 // CHECK:STDOUT:       symbolic_constant3: {inst: inst24, generic: generic<none>, index: generic_inst<none>, kind: checked}
 // CHECK:STDOUT:       symbolic_constant4: {inst: inst24, generic: generic0, index: generic_inst_in_decl1, kind: checked}
 // CHECK:STDOUT:       symbolic_constant4: {inst: inst24, generic: generic0, index: generic_inst_in_decl1, kind: checked}
-// CHECK:STDOUT:       symbolic_constant5: {inst: inst34, generic: generic<none>, index: generic_inst<none>, kind: checked}
-// CHECK:STDOUT:       symbolic_constant6: {inst: inst34, generic: generic0, index: generic_inst_in_decl2, kind: checked}
-// CHECK:STDOUT:       symbolic_constant7: {inst: inst37, generic: generic<none>, index: generic_inst<none>, kind: checked}
-// CHECK:STDOUT:       symbolic_constant8: {inst: inst37, generic: generic0, index: generic_inst_in_decl3, kind: checked}
-// CHECK:STDOUT:       symbolic_constant9: {inst: inst47, generic: generic<none>, index: generic_inst<none>, kind: checked}
-// CHECK:STDOUT:       symbolic_constant10: {inst: inst49, generic: generic<none>, index: generic_inst<none>, kind: checked}
-// CHECK:STDOUT:       symbolic_constant11: {inst: inst49, generic: generic0, index: generic_inst_in_def0, kind: checked}
-// CHECK:STDOUT:       symbolic_constant12: {inst: inst52, generic: generic<none>, index: generic_inst<none>, kind: checked}
-// CHECK:STDOUT:       symbolic_constant13: {inst: inst52, generic: generic0, index: generic_inst_in_def1, kind: checked}
+// CHECK:STDOUT:       symbolic_constant5: {inst: inst35, generic: generic<none>, index: generic_inst<none>, kind: checked}
+// CHECK:STDOUT:       symbolic_constant6: {inst: inst35, generic: generic0, index: generic_inst_in_decl2, kind: checked}
+// CHECK:STDOUT:       symbolic_constant7: {inst: inst38, generic: generic<none>, index: generic_inst<none>, kind: checked}
+// CHECK:STDOUT:       symbolic_constant8: {inst: inst38, generic: generic0, index: generic_inst_in_decl3, kind: checked}
+// CHECK:STDOUT:       symbolic_constant9: {inst: inst48, generic: generic<none>, index: generic_inst<none>, kind: checked}
+// CHECK:STDOUT:       symbolic_constant10: {inst: inst50, generic: generic<none>, index: generic_inst<none>, kind: checked}
+// CHECK:STDOUT:       symbolic_constant11: {inst: inst50, generic: generic0, index: generic_inst_in_def0, kind: checked}
+// CHECK:STDOUT:       symbolic_constant12: {inst: inst53, generic: generic<none>, index: generic_inst<none>, kind: checked}
+// CHECK:STDOUT:       symbolic_constant13: {inst: inst53, generic: generic0, index: generic_inst_in_def1, kind: checked}
 // CHECK:STDOUT:   inst_blocks:
 // CHECK:STDOUT:   inst_blocks:
 // CHECK:STDOUT:     inst_block_empty: {}
 // CHECK:STDOUT:     inst_block_empty: {}
 // CHECK:STDOUT:     exports:
 // CHECK:STDOUT:     exports:
-// CHECK:STDOUT:       0:               inst44
+// CHECK:STDOUT:       0:               inst45
 // CHECK:STDOUT:     imports:         {}
 // CHECK:STDOUT:     imports:         {}
 // CHECK:STDOUT:     global_init:     {}
 // CHECK:STDOUT:     global_init:     {}
 // CHECK:STDOUT:     inst_block4:
 // CHECK:STDOUT:     inst_block4:
@@ -195,7 +201,7 @@ fn Foo[T:! type](n: T) -> (T, ()) {
 // CHECK:STDOUT:       1:               inst29
 // CHECK:STDOUT:       1:               inst29
 // CHECK:STDOUT:     inst_block10:
 // CHECK:STDOUT:     inst_block10:
 // CHECK:STDOUT:       0:               inst28
 // CHECK:STDOUT:       0:               inst28
-// CHECK:STDOUT:       1:               inst33
+// CHECK:STDOUT:       1:               inst34
 // CHECK:STDOUT:     inst_block11:
 // CHECK:STDOUT:     inst_block11:
 // CHECK:STDOUT:       0:               inst18
 // CHECK:STDOUT:       0:               inst18
 // CHECK:STDOUT:       1:               inst29
 // CHECK:STDOUT:       1:               inst29
@@ -203,27 +209,27 @@ fn Foo[T:! type](n: T) -> (T, ()) {
 // CHECK:STDOUT:       0:               inst19
 // CHECK:STDOUT:       0:               inst19
 // CHECK:STDOUT:       1:               inst29
 // CHECK:STDOUT:       1:               inst29
 // CHECK:STDOUT:     inst_block13:
 // CHECK:STDOUT:     inst_block13:
-// CHECK:STDOUT:       0:               inst41
-// CHECK:STDOUT:       1:               inst42
+// CHECK:STDOUT:       0:               inst42
+// CHECK:STDOUT:       1:               inst43
 // CHECK:STDOUT:     inst_block14:
 // CHECK:STDOUT:     inst_block14:
 // CHECK:STDOUT:       0:               inst21
 // CHECK:STDOUT:       0:               inst21
 // CHECK:STDOUT:       1:               inst25
 // CHECK:STDOUT:       1:               inst25
 // CHECK:STDOUT:       2:               inst27
 // CHECK:STDOUT:       2:               inst27
-// CHECK:STDOUT:       3:               inst38
-// CHECK:STDOUT:       4:               inst40
+// CHECK:STDOUT:       3:               inst39
+// CHECK:STDOUT:       4:               inst41
 // CHECK:STDOUT:     inst_block15:
 // CHECK:STDOUT:     inst_block15:
 // CHECK:STDOUT:       0:               inst28
 // CHECK:STDOUT:       0:               inst28
 // CHECK:STDOUT:       1:               inst30
 // CHECK:STDOUT:       1:               inst30
 // CHECK:STDOUT:       2:               inst32
 // CHECK:STDOUT:       2:               inst32
-// CHECK:STDOUT:       3:               inst33
-// CHECK:STDOUT:       4:               inst35
+// CHECK:STDOUT:       3:               inst34
+// CHECK:STDOUT:       4:               inst36
 // CHECK:STDOUT:       5:               inst15
 // CHECK:STDOUT:       5:               inst15
 // CHECK:STDOUT:       6:               inst17
 // CHECK:STDOUT:       6:               inst17
-// CHECK:STDOUT:       7:               inst41
+// CHECK:STDOUT:       7:               inst42
 // CHECK:STDOUT:       8:               inst22
 // CHECK:STDOUT:       8:               inst22
 // CHECK:STDOUT:       9:               inst23
 // CHECK:STDOUT:       9:               inst23
-// CHECK:STDOUT:       10:              inst42
-// CHECK:STDOUT:       11:              inst43
+// CHECK:STDOUT:       10:              inst43
+// CHECK:STDOUT:       11:              inst44
 // CHECK:STDOUT:     inst_block16:
 // CHECK:STDOUT:     inst_block16:
 // CHECK:STDOUT:       0:               inst17
 // CHECK:STDOUT:       0:               inst17
 // CHECK:STDOUT:     inst_block17:
 // CHECK:STDOUT:     inst_block17:
@@ -231,35 +237,35 @@ fn Foo[T:! type](n: T) -> (T, ()) {
 // CHECK:STDOUT:     inst_block18:
 // CHECK:STDOUT:     inst_block18:
 // CHECK:STDOUT:       0:               inst19
 // CHECK:STDOUT:       0:               inst19
 // CHECK:STDOUT:       1:               inst26
 // CHECK:STDOUT:       1:               inst26
-// CHECK:STDOUT:       2:               inst36
-// CHECK:STDOUT:       3:               inst39
+// CHECK:STDOUT:       2:               inst37
+// CHECK:STDOUT:       3:               inst40
 // CHECK:STDOUT:     inst_block19:
 // CHECK:STDOUT:     inst_block19:
 // CHECK:STDOUT:       0:               inst18
 // CHECK:STDOUT:       0:               inst18
 // CHECK:STDOUT:       1:               inst24
 // CHECK:STDOUT:       1:               inst24
-// CHECK:STDOUT:       2:               inst34
-// CHECK:STDOUT:       3:               inst37
+// CHECK:STDOUT:       2:               inst35
+// CHECK:STDOUT:       3:               inst38
 // CHECK:STDOUT:     inst_block20:
 // CHECK:STDOUT:     inst_block20:
-// CHECK:STDOUT:       0:               inst54
-// CHECK:STDOUT:       1:               inst55
-// CHECK:STDOUT:       2:               inst56
-// CHECK:STDOUT:       3:               inst58
-// CHECK:STDOUT:       4:               inst60
-// CHECK:STDOUT:       5:               inst61
-// CHECK:STDOUT:       6:               inst62
-// CHECK:STDOUT:       7:               inst64
-// CHECK:STDOUT:       8:               inst65
-// CHECK:STDOUT:       9:               inst66
-// CHECK:STDOUT:       10:              inst67
+// CHECK:STDOUT:       0:               inst55
+// CHECK:STDOUT:       1:               inst56
+// CHECK:STDOUT:       2:               inst57
+// CHECK:STDOUT:       3:               inst59
+// CHECK:STDOUT:       4:               inst61
+// CHECK:STDOUT:       5:               inst62
+// CHECK:STDOUT:       6:               inst63
+// CHECK:STDOUT:       7:               inst65
+// CHECK:STDOUT:       8:               inst66
+// CHECK:STDOUT:       9:               inst67
+// CHECK:STDOUT:       10:              inst68
 // CHECK:STDOUT:     inst_block21:
 // CHECK:STDOUT:     inst_block21:
-// CHECK:STDOUT:       0:               inst54
-// CHECK:STDOUT:       1:               inst55
+// CHECK:STDOUT:       0:               inst55
+// CHECK:STDOUT:       1:               inst56
 // CHECK:STDOUT:     inst_block22:
 // CHECK:STDOUT:     inst_block22:
-// CHECK:STDOUT:       0:               inst60
-// CHECK:STDOUT:       1:               inst64
+// CHECK:STDOUT:       0:               inst61
+// CHECK:STDOUT:       1:               inst65
 // CHECK:STDOUT:     inst_block23:
 // CHECK:STDOUT:     inst_block23:
-// CHECK:STDOUT:       0:               inst50
-// CHECK:STDOUT:       1:               inst53
+// CHECK:STDOUT:       0:               inst51
+// CHECK:STDOUT:       1:               inst54
 // CHECK:STDOUT:     inst_block24:
 // CHECK:STDOUT:     inst_block24:
 // CHECK:STDOUT:       0:               inst14
 // CHECK:STDOUT:       0:               inst14
-// CHECK:STDOUT:       1:               inst44
+// CHECK:STDOUT:       1:               inst45
 // CHECK:STDOUT: ...
 // CHECK:STDOUT: ...

+ 47 - 47
toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon

@@ -25,11 +25,11 @@ fn Foo(n: ()) -> ((), ()) {
 // CHECK:STDOUT:     ir1:             {decl_id: inst<none>, is_export: false}
 // CHECK:STDOUT:     ir1:             {decl_id: inst<none>, is_export: false}
 // CHECK:STDOUT:   import_ir_insts: {}
 // CHECK:STDOUT:   import_ir_insts: {}
 // CHECK:STDOUT:   name_scopes:
 // CHECK:STDOUT:   name_scopes:
-// CHECK:STDOUT:     name_scope0:     {inst: inst14, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst36}}
+// CHECK:STDOUT:     name_scope0:     {inst: inst14, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst37}}
 // CHECK:STDOUT:   entity_names:
 // CHECK:STDOUT:   entity_names:
 // CHECK:STDOUT:     entity_name0:    {name: name1, parent_scope: name_scope<none>, index: -1, is_template: 0}
 // CHECK:STDOUT:     entity_name0:    {name: name1, parent_scope: name_scope<none>, index: -1, is_template: 0}
 // CHECK:STDOUT:   functions:
 // CHECK:STDOUT:   functions:
-// CHECK:STDOUT:     function0:       {name: name0, parent_scope: name_scope0, call_params_id: inst_block9, return_slot_pattern: inst31, body: [inst_block12]}
+// CHECK:STDOUT:     function0:       {name: name0, parent_scope: name_scope0, call_params_id: inst_block9, return_slot_pattern: inst32, body: [inst_block12]}
 // CHECK:STDOUT:   classes:         {}
 // CHECK:STDOUT:   classes:         {}
 // CHECK:STDOUT:   generics:        {}
 // CHECK:STDOUT:   generics:        {}
 // CHECK:STDOUT:   specifics:       {}
 // CHECK:STDOUT:   specifics:       {}
@@ -42,20 +42,20 @@ fn Foo(n: ()) -> ((), ()) {
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(Error)}
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(Error)}
 // CHECK:STDOUT:     'type(inst(NamespaceType))':
 // CHECK:STDOUT:     'type(inst(NamespaceType))':
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(inst(NamespaceType))}
 // CHECK:STDOUT:       value_repr:      {kind: copy, type: type(inst(NamespaceType))}
-// CHECK:STDOUT:     'type(inst37)':
-// CHECK:STDOUT:       value_repr:      {kind: none, type: type(inst15)}
 // CHECK:STDOUT:     'type(inst15)':
 // CHECK:STDOUT:     'type(inst15)':
 // CHECK:STDOUT:       value_repr:      {kind: none, type: type(inst15)}
 // CHECK:STDOUT:       value_repr:      {kind: none, type: type(inst15)}
 // CHECK:STDOUT:     'type(inst24)':
 // CHECK:STDOUT:     'type(inst24)':
-// CHECK:STDOUT:       value_repr:      {kind: pointer, type: type(inst39)}
-// CHECK:STDOUT:     'type(inst39)':
-// CHECK:STDOUT:       value_repr:      {kind: copy, type: type(inst39)}
+// CHECK:STDOUT:       value_repr:      {kind: pointer, type: type(inst26)}
+// CHECK:STDOUT:     'type(inst26)':
+// CHECK:STDOUT:       value_repr:      {kind: copy, type: type(inst26)}
+// CHECK:STDOUT:     'type(inst38)':
+// CHECK:STDOUT:       value_repr:      {kind: none, type: type(inst15)}
 // CHECK:STDOUT:   insts:
 // CHECK:STDOUT:   insts:
 // CHECK:STDOUT:     inst14:          {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
 // CHECK:STDOUT:     inst14:          {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
 // CHECK:STDOUT:     inst15:          {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
 // CHECK:STDOUT:     inst15:          {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
 // CHECK:STDOUT:     inst16:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst15)}
 // CHECK:STDOUT:     inst16:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst15)}
 // CHECK:STDOUT:     inst17:          {kind: Converted, arg0: inst16, arg1: inst15, type: type(TypeType)}
 // CHECK:STDOUT:     inst17:          {kind: Converted, arg0: inst16, arg1: inst15, type: type(TypeType)}
-// CHECK:STDOUT:     inst18:          {kind: BindName, arg0: entity_name0, arg1: inst32, type: type(inst15)}
+// CHECK:STDOUT:     inst18:          {kind: BindName, arg0: entity_name0, arg1: inst33, type: type(inst15)}
 // CHECK:STDOUT:     inst19:          {kind: PatternType, arg0: inst15, type: type(TypeType)}
 // CHECK:STDOUT:     inst19:          {kind: PatternType, arg0: inst15, type: type(TypeType)}
 // CHECK:STDOUT:     inst20:          {kind: BindingPattern, arg0: entity_name0, type: type(inst19)}
 // CHECK:STDOUT:     inst20:          {kind: BindingPattern, arg0: entity_name0, type: type(inst19)}
 // CHECK:STDOUT:     inst21:          {kind: ValueParamPattern, arg0: inst20, arg1: call_param0, type: type(inst19)}
 // CHECK:STDOUT:     inst21:          {kind: ValueParamPattern, arg0: inst20, arg1: call_param0, type: type(inst19)}
@@ -63,34 +63,34 @@ fn Foo(n: ()) -> ((), ()) {
 // CHECK:STDOUT:     inst23:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst15)}
 // CHECK:STDOUT:     inst23:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst15)}
 // CHECK:STDOUT:     inst24:          {kind: TupleType, arg0: inst_block7, type: type(TypeType)}
 // CHECK:STDOUT:     inst24:          {kind: TupleType, arg0: inst_block7, type: type(TypeType)}
 // CHECK:STDOUT:     inst25:          {kind: TupleLiteral, arg0: inst_block6, type: type(inst24)}
 // CHECK:STDOUT:     inst25:          {kind: TupleLiteral, arg0: inst_block6, type: type(inst24)}
-// CHECK:STDOUT:     inst26:          {kind: Converted, arg0: inst22, arg1: inst15, type: type(TypeType)}
-// CHECK:STDOUT:     inst27:          {kind: Converted, arg0: inst23, arg1: inst15, type: type(TypeType)}
-// CHECK:STDOUT:     inst28:          {kind: Converted, arg0: inst25, arg1: inst24, type: type(TypeType)}
-// CHECK:STDOUT:     inst29:          {kind: PatternType, arg0: inst24, type: type(TypeType)}
-// CHECK:STDOUT:     inst30:          {kind: ReturnSlotPattern, arg0: inst28, type: type(inst29)}
-// CHECK:STDOUT:     inst31:          {kind: OutParamPattern, arg0: inst30, arg1: call_param1, type: type(inst29)}
-// CHECK:STDOUT:     inst32:          {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst15)}
-// CHECK:STDOUT:     inst33:          {kind: SpliceBlock, arg0: inst_block4, arg1: inst17, type: type(TypeType)}
-// CHECK:STDOUT:     inst34:          {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(inst24)}
-// CHECK:STDOUT:     inst35:          {kind: ReturnSlot, arg0: inst24, arg1: inst34, type: type(inst24)}
-// CHECK:STDOUT:     inst36:          {kind: FunctionDecl, arg0: function0, arg1: inst_block11, type: type(inst37)}
-// CHECK:STDOUT:     inst37:          {kind: FunctionType, arg0: function0, arg1: specific<none>, type: type(TypeType)}
-// CHECK:STDOUT:     inst38:          {kind: StructValue, arg0: inst_block_empty, type: type(inst37)}
-// CHECK:STDOUT:     inst39:          {kind: PointerType, arg0: inst24, type: type(TypeType)}
+// CHECK:STDOUT:     inst26:          {kind: PointerType, arg0: inst24, type: type(TypeType)}
+// CHECK:STDOUT:     inst27:          {kind: Converted, arg0: inst22, arg1: inst15, type: type(TypeType)}
+// CHECK:STDOUT:     inst28:          {kind: Converted, arg0: inst23, arg1: inst15, type: type(TypeType)}
+// CHECK:STDOUT:     inst29:          {kind: Converted, arg0: inst25, arg1: inst24, type: type(TypeType)}
+// CHECK:STDOUT:     inst30:          {kind: PatternType, arg0: inst24, type: type(TypeType)}
+// CHECK:STDOUT:     inst31:          {kind: ReturnSlotPattern, arg0: inst29, type: type(inst30)}
+// CHECK:STDOUT:     inst32:          {kind: OutParamPattern, arg0: inst31, arg1: call_param1, type: type(inst30)}
+// CHECK:STDOUT:     inst33:          {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst15)}
+// CHECK:STDOUT:     inst34:          {kind: SpliceBlock, arg0: inst_block4, arg1: inst17, type: type(TypeType)}
+// CHECK:STDOUT:     inst35:          {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(inst24)}
+// CHECK:STDOUT:     inst36:          {kind: ReturnSlot, arg0: inst24, arg1: inst35, type: type(inst24)}
+// CHECK:STDOUT:     inst37:          {kind: FunctionDecl, arg0: function0, arg1: inst_block11, type: type(inst38)}
+// CHECK:STDOUT:     inst38:          {kind: FunctionType, arg0: function0, arg1: specific<none>, type: type(TypeType)}
+// CHECK:STDOUT:     inst39:          {kind: StructValue, arg0: inst_block_empty, type: type(inst38)}
 // CHECK:STDOUT:     inst40:          {kind: NameRef, arg0: name1, arg1: inst18, type: type(inst15)}
 // CHECK:STDOUT:     inst40:          {kind: NameRef, arg0: name1, arg1: inst18, type: type(inst15)}
 // CHECK:STDOUT:     inst41:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst15)}
 // CHECK:STDOUT:     inst41:          {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst15)}
 // CHECK:STDOUT:     inst42:          {kind: TupleLiteral, arg0: inst_block13, type: type(inst24)}
 // CHECK:STDOUT:     inst42:          {kind: TupleLiteral, arg0: inst_block13, type: type(inst24)}
-// CHECK:STDOUT:     inst43:          {kind: TupleAccess, arg0: inst35, arg1: element0, type: type(inst15)}
+// CHECK:STDOUT:     inst43:          {kind: TupleAccess, arg0: inst36, arg1: element0, type: type(inst15)}
 // CHECK:STDOUT:     inst44:          {kind: TupleInit, arg0: inst_block14, arg1: inst43, type: type(inst15)}
 // CHECK:STDOUT:     inst44:          {kind: TupleInit, arg0: inst_block14, arg1: inst43, type: type(inst15)}
 // CHECK:STDOUT:     inst45:          {kind: TupleValue, arg0: inst_block_empty, type: type(inst15)}
 // CHECK:STDOUT:     inst45:          {kind: TupleValue, arg0: inst_block_empty, type: type(inst15)}
 // CHECK:STDOUT:     inst46:          {kind: Converted, arg0: inst40, arg1: inst44, type: type(inst15)}
 // CHECK:STDOUT:     inst46:          {kind: Converted, arg0: inst40, arg1: inst44, type: type(inst15)}
-// CHECK:STDOUT:     inst47:          {kind: TupleAccess, arg0: inst35, arg1: element1, type: type(inst15)}
+// CHECK:STDOUT:     inst47:          {kind: TupleAccess, arg0: inst36, arg1: element1, type: type(inst15)}
 // CHECK:STDOUT:     inst48:          {kind: TupleInit, arg0: inst_block_empty, arg1: inst47, type: type(inst15)}
 // CHECK:STDOUT:     inst48:          {kind: TupleInit, arg0: inst_block_empty, arg1: inst47, type: type(inst15)}
 // CHECK:STDOUT:     inst49:          {kind: Converted, arg0: inst41, arg1: inst48, type: type(inst15)}
 // CHECK:STDOUT:     inst49:          {kind: Converted, arg0: inst41, arg1: inst48, type: type(inst15)}
-// CHECK:STDOUT:     inst50:          {kind: TupleInit, arg0: inst_block15, arg1: inst35, type: type(inst24)}
+// CHECK:STDOUT:     inst50:          {kind: TupleInit, arg0: inst_block15, arg1: inst36, type: type(inst24)}
 // CHECK:STDOUT:     inst51:          {kind: TupleValue, arg0: inst_block16, type: type(inst24)}
 // CHECK:STDOUT:     inst51:          {kind: TupleValue, arg0: inst_block16, type: type(inst24)}
 // CHECK:STDOUT:     inst52:          {kind: Converted, arg0: inst42, arg1: inst50, type: type(inst24)}
 // CHECK:STDOUT:     inst52:          {kind: Converted, arg0: inst42, arg1: inst50, type: type(inst24)}
-// CHECK:STDOUT:     inst53:          {kind: ReturnExpr, arg0: inst52, arg1: inst35}
+// CHECK:STDOUT:     inst53:          {kind: ReturnExpr, arg0: inst52, arg1: inst36}
 // CHECK:STDOUT:   constant_values:
 // CHECK:STDOUT:   constant_values:
 // CHECK:STDOUT:     values:
 // CHECK:STDOUT:     values:
 // CHECK:STDOUT:       inst14:          concrete_constant(inst14)
 // CHECK:STDOUT:       inst14:          concrete_constant(inst14)
@@ -100,15 +100,15 @@ fn Foo(n: ()) -> ((), ()) {
 // CHECK:STDOUT:       inst20:          concrete_constant(inst20)
 // CHECK:STDOUT:       inst20:          concrete_constant(inst20)
 // CHECK:STDOUT:       inst21:          concrete_constant(inst21)
 // CHECK:STDOUT:       inst21:          concrete_constant(inst21)
 // CHECK:STDOUT:       inst24:          concrete_constant(inst24)
 // CHECK:STDOUT:       inst24:          concrete_constant(inst24)
-// CHECK:STDOUT:       inst26:          concrete_constant(inst15)
+// CHECK:STDOUT:       inst26:          concrete_constant(inst26)
 // CHECK:STDOUT:       inst27:          concrete_constant(inst15)
 // CHECK:STDOUT:       inst27:          concrete_constant(inst15)
-// CHECK:STDOUT:       inst28:          concrete_constant(inst24)
-// CHECK:STDOUT:       inst29:          concrete_constant(inst29)
+// CHECK:STDOUT:       inst28:          concrete_constant(inst15)
+// CHECK:STDOUT:       inst29:          concrete_constant(inst24)
 // CHECK:STDOUT:       inst30:          concrete_constant(inst30)
 // CHECK:STDOUT:       inst30:          concrete_constant(inst30)
 // CHECK:STDOUT:       inst31:          concrete_constant(inst31)
 // CHECK:STDOUT:       inst31:          concrete_constant(inst31)
-// CHECK:STDOUT:       inst33:          concrete_constant(inst15)
-// CHECK:STDOUT:       inst36:          concrete_constant(inst38)
-// CHECK:STDOUT:       inst37:          concrete_constant(inst37)
+// CHECK:STDOUT:       inst32:          concrete_constant(inst32)
+// CHECK:STDOUT:       inst34:          concrete_constant(inst15)
+// CHECK:STDOUT:       inst37:          concrete_constant(inst39)
 // CHECK:STDOUT:       inst38:          concrete_constant(inst38)
 // CHECK:STDOUT:       inst38:          concrete_constant(inst38)
 // CHECK:STDOUT:       inst39:          concrete_constant(inst39)
 // CHECK:STDOUT:       inst39:          concrete_constant(inst39)
 // CHECK:STDOUT:       inst44:          concrete_constant(inst45)
 // CHECK:STDOUT:       inst44:          concrete_constant(inst45)
@@ -123,7 +123,7 @@ fn Foo(n: ()) -> ((), ()) {
 // CHECK:STDOUT:   inst_blocks:
 // CHECK:STDOUT:   inst_blocks:
 // CHECK:STDOUT:     inst_block_empty: {}
 // CHECK:STDOUT:     inst_block_empty: {}
 // CHECK:STDOUT:     exports:
 // CHECK:STDOUT:     exports:
-// CHECK:STDOUT:       0:               inst36
+// CHECK:STDOUT:       0:               inst37
 // CHECK:STDOUT:     imports:         {}
 // CHECK:STDOUT:     imports:         {}
 // CHECK:STDOUT:     global_init:     {}
 // CHECK:STDOUT:     global_init:     {}
 // CHECK:STDOUT:     inst_block4:
 // CHECK:STDOUT:     inst_block4:
@@ -138,28 +138,28 @@ fn Foo(n: ()) -> ((), ()) {
 // CHECK:STDOUT:       0:               inst15
 // CHECK:STDOUT:       0:               inst15
 // CHECK:STDOUT:       1:               inst15
 // CHECK:STDOUT:       1:               inst15
 // CHECK:STDOUT:     inst_block8:
 // CHECK:STDOUT:     inst_block8:
-// CHECK:STDOUT:       0:               inst26
-// CHECK:STDOUT:       1:               inst27
+// CHECK:STDOUT:       0:               inst27
+// CHECK:STDOUT:       1:               inst28
 // CHECK:STDOUT:     inst_block9:
 // CHECK:STDOUT:     inst_block9:
-// CHECK:STDOUT:       0:               inst32
-// CHECK:STDOUT:       1:               inst34
+// CHECK:STDOUT:       0:               inst33
+// CHECK:STDOUT:       1:               inst35
 // CHECK:STDOUT:     inst_block10:
 // CHECK:STDOUT:     inst_block10:
 // CHECK:STDOUT:       0:               inst20
 // CHECK:STDOUT:       0:               inst20
 // CHECK:STDOUT:       1:               inst21
 // CHECK:STDOUT:       1:               inst21
-// CHECK:STDOUT:       2:               inst30
-// CHECK:STDOUT:       3:               inst31
+// CHECK:STDOUT:       2:               inst31
+// CHECK:STDOUT:       3:               inst32
 // CHECK:STDOUT:     inst_block11:
 // CHECK:STDOUT:     inst_block11:
 // CHECK:STDOUT:       0:               inst22
 // CHECK:STDOUT:       0:               inst22
 // CHECK:STDOUT:       1:               inst23
 // CHECK:STDOUT:       1:               inst23
 // CHECK:STDOUT:       2:               inst25
 // CHECK:STDOUT:       2:               inst25
-// CHECK:STDOUT:       3:               inst26
-// CHECK:STDOUT:       4:               inst27
-// CHECK:STDOUT:       5:               inst28
-// CHECK:STDOUT:       6:               inst32
-// CHECK:STDOUT:       7:               inst33
+// CHECK:STDOUT:       3:               inst27
+// CHECK:STDOUT:       4:               inst28
+// CHECK:STDOUT:       5:               inst29
+// CHECK:STDOUT:       6:               inst33
+// CHECK:STDOUT:       7:               inst34
 // CHECK:STDOUT:       8:               inst18
 // CHECK:STDOUT:       8:               inst18
-// CHECK:STDOUT:       9:               inst34
-// CHECK:STDOUT:       10:              inst35
+// CHECK:STDOUT:       9:               inst35
+// CHECK:STDOUT:       10:              inst36
 // CHECK:STDOUT:     inst_block12:
 // CHECK:STDOUT:     inst_block12:
 // CHECK:STDOUT:       0:               inst40
 // CHECK:STDOUT:       0:               inst40
 // CHECK:STDOUT:       1:               inst41
 // CHECK:STDOUT:       1:               inst41
@@ -185,7 +185,7 @@ fn Foo(n: ()) -> ((), ()) {
 // CHECK:STDOUT:       1:               inst45
 // CHECK:STDOUT:       1:               inst45
 // CHECK:STDOUT:     inst_block17:
 // CHECK:STDOUT:     inst_block17:
 // CHECK:STDOUT:       0:               inst14
 // CHECK:STDOUT:       0:               inst14
-// CHECK:STDOUT:       1:               inst36
+// CHECK:STDOUT:       1:               inst37
 // CHECK:STDOUT: ...
 // CHECK:STDOUT: ...
 // CHECK:STDOUT: --- one_file_with_textual_ir.carbon
 // CHECK:STDOUT: --- one_file_with_textual_ir.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT:

+ 63 - 0
toolchain/check/testdata/class/adapter/convert_incomplete.carbon

@@ -0,0 +1,63 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
+//
+// AUTOUPDATE
+// TIP: To test this file alone, run:
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/adapter/convert_incomplete.carbon
+// TIP: To dump output, run:
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/adapter/convert_incomplete.carbon
+
+// --- already_complete.carbon
+
+library "[[@TEST_NAME]]";
+
+class Adapter(T:! type) {
+  extend adapt T*;
+}
+
+class X {}
+
+// Trigger completion of Adapter(X) here.
+var x: Adapter(X);
+
+fn F(p: Adapter(X)*) {
+  let x: X* = *p as X*;
+}
+
+// --- can_be_completed.carbon
+
+library "[[@TEST_NAME]]";
+
+class Adapter(T:! type) {
+  extend adapt T*;
+}
+
+class X {}
+
+fn F(p: Adapter(X)*) {
+  // The conversion here triggers completion of Adapter(X)
+  // so we can determine what it adapts.
+  let x: X* = *p as X*;
+}
+
+// --- fail_incomplete.carbon
+
+library "[[@TEST_NAME]]";
+
+class Adapter(T:! type);
+
+class X {}
+
+fn F(p: Adapter(X)*) {
+  // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:15: error: cannot convert expression of type `Adapter(X)` to `X*` with `as` [ConversionFailure]
+  // CHECK:STDERR:   let x: X* = *p as X*;
+  // CHECK:STDERR:               ^~~~~~~~
+  // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:15: note: type `Adapter(X)` does not implement interface `Core.As(X*)` [MissingImplInMemberAccessNote]
+  // CHECK:STDERR:   let x: X* = *p as X*;
+  // CHECK:STDERR:               ^~~~~~~~
+  // CHECK:STDERR:
+  let x: X* = *p as X*;
+}

+ 12 - 12
toolchain/check/testdata/deduce/array.carbon

@@ -177,7 +177,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3, %C [concrete]
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3, %C [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
-// CHECK:STDOUT:   %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
+// CHECK:STDOUT:   %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %int_2: Core.IntLiteral = int_value 2 [concrete]
 // CHECK:STDOUT:   %int_2: Core.IntLiteral = int_value 2 [concrete]
@@ -313,7 +313,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %.loc9_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_34.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_34.1: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %.loc9_35.1: %tuple.type = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
+// CHECK:STDOUT:   %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
 // CHECK:STDOUT:   %.loc9_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc9_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
 // CHECK:STDOUT:   %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
@@ -421,7 +421,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3.1ba, %C [concrete]
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3.1ba, %C [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
-// CHECK:STDOUT:   %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
+// CHECK:STDOUT:   %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
@@ -567,7 +567,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %.loc9_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_34.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_34.1: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %.loc9_35.1: %tuple.type = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
+// CHECK:STDOUT:   %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
 // CHECK:STDOUT:   %.loc9_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc9_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
 // CHECK:STDOUT:   %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
@@ -654,7 +654,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3, %C [concrete]
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3, %C [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
-// CHECK:STDOUT:   %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
+// CHECK:STDOUT:   %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
@@ -770,7 +770,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %.loc9_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_34.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_34.1: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %.loc9_35.1: %tuple.type = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
+// CHECK:STDOUT:   %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
 // CHECK:STDOUT:   %.loc9_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc9_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
 // CHECK:STDOUT:   %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
@@ -875,7 +875,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3, %C [concrete]
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3, %C [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
-// CHECK:STDOUT:   %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
+// CHECK:STDOUT:   %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
 // CHECK:STDOUT:   %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
@@ -1012,7 +1012,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %.loc10_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc10_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc10_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc10_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc10_34.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc10_34.1: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %.loc10_35.1: %tuple.type = tuple_literal (%.loc10_26.1, %.loc10_30.1, %.loc10_34.1)
+// CHECK:STDOUT:   %.loc10_35.1: %tuple.type.8d4 = tuple_literal (%.loc10_26.1, %.loc10_30.1, %.loc10_34.1)
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
 // CHECK:STDOUT:   %.loc10_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc10_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc10_26.2: init %C = class_init (), %.loc10_35.2 [concrete = constants.%C.val]
 // CHECK:STDOUT:   %.loc10_26.2: init %C = class_init (), %.loc10_35.2 [concrete = constants.%C.val]
@@ -1126,7 +1126,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %array_type.fe4: type = array_type %int_3.1ba, %D [concrete]
 // CHECK:STDOUT:   %array_type.fe4: type = array_type %int_3.1ba, %D [concrete]
 // CHECK:STDOUT:   %ptr.af6: type = ptr_type %array_type.fe4 [concrete]
 // CHECK:STDOUT:   %ptr.af6: type = ptr_type %array_type.fe4 [concrete]
 // CHECK:STDOUT:   %pattern_type.f30: type = pattern_type %array_type.fe4 [concrete]
 // CHECK:STDOUT:   %pattern_type.f30: type = pattern_type %array_type.fe4 [concrete]
-// CHECK:STDOUT:   %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
+// CHECK:STDOUT:   %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete]
 // CHECK:STDOUT:   %D.val: %D = struct_value () [concrete]
 // CHECK:STDOUT:   %D.val: %D = struct_value () [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
@@ -1306,7 +1306,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %.loc11_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc11_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc11_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc11_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc11_34.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc11_34.1: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %.loc11_35.1: %tuple.type = tuple_literal (%.loc11_26.1, %.loc11_30.1, %.loc11_34.1)
+// CHECK:STDOUT:   %.loc11_35.1: %tuple.type.8d4 = tuple_literal (%.loc11_26.1, %.loc11_30.1, %.loc11_34.1)
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
 // CHECK:STDOUT:   %.loc11_35.2: ref %D = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc11_35.2: ref %D = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc11_26.2: init %D = class_init (), %.loc11_35.2 [concrete = constants.%D.val]
 // CHECK:STDOUT:   %.loc11_26.2: init %D = class_init (), %.loc11_35.2 [concrete = constants.%D.val]
@@ -1409,7 +1409,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3, %C [concrete]
 // CHECK:STDOUT:   %array_type.002: type = array_type %int_3, %C [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %ptr.301: type = ptr_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
 // CHECK:STDOUT:   %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
-// CHECK:STDOUT:   %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
+// CHECK:STDOUT:   %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
@@ -1545,7 +1545,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %.loc9_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_26.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_30.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_34.1: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc9_34.1: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %.loc9_35.1: %tuple.type = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
+// CHECK:STDOUT:   %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
 // CHECK:STDOUT:   %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
 // CHECK:STDOUT:   %.loc9_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc9_35.2: ref %C = array_index %a.var, %int_0
 // CHECK:STDOUT:   %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
 // CHECK:STDOUT:   %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]

+ 27 - 14
toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon

@@ -72,11 +72,11 @@ fn G() {
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %Generic.generic: %Generic.type.c21 = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.generic: %Generic.type.c21 = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.type.91ccba.1: type = facet_type <@Generic, @Generic(%Scalar)> [symbolic]
 // CHECK:STDOUT:   %Generic.type.91ccba.1: type = facet_type <@Generic, @Generic(%Scalar)> [symbolic]
-// CHECK:STDOUT:   %Self.dee: %Generic.type.91ccba.1 = bind_symbolic_name Self, 1 [symbolic]
-// CHECK:STDOUT:   %Generic.F.type.f43: type = fn_type @Generic.F, @Generic(%Scalar) [symbolic]
-// CHECK:STDOUT:   %Generic.F.8a2: %Generic.F.type.f43 = struct_value () [symbolic]
-// CHECK:STDOUT:   %Generic.assoc_type.0fd: type = assoc_entity_type @Generic, @Generic(%Scalar) [symbolic]
-// CHECK:STDOUT:   %assoc0.296: %Generic.assoc_type.0fd = assoc_entity element0, @Generic.%Generic.F.decl [symbolic]
+// CHECK:STDOUT:   %Self.dee8d8.1: %Generic.type.91ccba.1 = bind_symbolic_name Self, 1 [symbolic]
+// CHECK:STDOUT:   %Generic.F.type.f439a9.1: type = fn_type @Generic.F, @Generic(%Scalar) [symbolic]
+// CHECK:STDOUT:   %Generic.F.8a2d67.1: %Generic.F.type.f439a9.1 = struct_value () [symbolic]
+// CHECK:STDOUT:   %Generic.assoc_type.0fd877.1: type = assoc_entity_type @Generic, @Generic(%Scalar) [symbolic]
+// CHECK:STDOUT:   %assoc0.2966cb.1: %Generic.assoc_type.0fd877.1 = assoc_entity element0, @Generic.%Generic.F.decl [symbolic]
 // CHECK:STDOUT:   %GenericParam: type = class_type @GenericParam [concrete]
 // CHECK:STDOUT:   %GenericParam: type = class_type @GenericParam [concrete]
 // CHECK:STDOUT:   %Destroy.type: type = facet_type <@Destroy> [concrete]
 // CHECK:STDOUT:   %Destroy.type: type = facet_type <@Destroy> [concrete]
 // CHECK:STDOUT:   %pattern_type.f6d: type = pattern_type auto [concrete]
 // CHECK:STDOUT:   %pattern_type.f6d: type = pattern_type auto [concrete]
@@ -115,6 +115,11 @@ fn G() {
 // CHECK:STDOUT:   %CallGenericMethod.specific_fn.2ff: <specific function> = specific_function %CallGenericMethod, @CallGenericMethod(%GenericParam, %Generic.facet) [concrete]
 // CHECK:STDOUT:   %CallGenericMethod.specific_fn.2ff: <specific function> = specific_function %CallGenericMethod, @CallGenericMethod(%GenericParam, %Generic.facet) [concrete]
 // CHECK:STDOUT:   %PassThroughToGenericMethod.type: type = fn_type @PassThroughToGenericMethod [concrete]
 // CHECK:STDOUT:   %PassThroughToGenericMethod.type: type = fn_type @PassThroughToGenericMethod [concrete]
 // CHECK:STDOUT:   %PassThroughToGenericMethod: %PassThroughToGenericMethod.type = struct_value () [concrete]
 // CHECK:STDOUT:   %PassThroughToGenericMethod: %PassThroughToGenericMethod.type = struct_value () [concrete]
+// CHECK:STDOUT:   %Self.dee8d8.2: %Generic.type.91ccba.2 = bind_symbolic_name Self, 1 [symbolic]
+// CHECK:STDOUT:   %Generic.F.type.f439a9.2: type = fn_type @Generic.F, @Generic(%T) [symbolic]
+// CHECK:STDOUT:   %Generic.F.8a2d67.2: %Generic.F.type.f439a9.2 = struct_value () [symbolic]
+// CHECK:STDOUT:   %Generic.assoc_type.0fd877.2: type = assoc_entity_type @Generic, @Generic(%T) [symbolic]
+// CHECK:STDOUT:   %assoc0.2966cb.2: %Generic.assoc_type.0fd877.2 = assoc_entity element0, @Generic.%Generic.F.decl [symbolic]
 // CHECK:STDOUT:   %CallGenericMethod.specific_fn.a24: <specific function> = specific_function %CallGenericMethod, @CallGenericMethod(%T, %U) [symbolic]
 // CHECK:STDOUT:   %CallGenericMethod.specific_fn.a24: <specific function> = specific_function %CallGenericMethod, @CallGenericMethod(%T, %U) [symbolic]
 // CHECK:STDOUT:   %H.type: type = fn_type @H [concrete]
 // CHECK:STDOUT:   %H.type: type = fn_type @H [concrete]
 // CHECK:STDOUT:   %H: %H.type = struct_value () [concrete]
 // CHECK:STDOUT:   %H: %H.type = struct_value () [concrete]
@@ -195,16 +200,16 @@ fn G() {
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
 // CHECK:STDOUT: !definition:
 // CHECK:STDOUT:   %Generic.type: type = facet_type <@Generic, @Generic(%Scalar.loc4_19.1)> [symbolic = %Generic.type (constants.%Generic.type.91ccba.1)]
 // CHECK:STDOUT:   %Generic.type: type = facet_type <@Generic, @Generic(%Scalar.loc4_19.1)> [symbolic = %Generic.type (constants.%Generic.type.91ccba.1)]
-// CHECK:STDOUT:   %Self.2: @Generic.%Generic.type (%Generic.type.91ccba.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.dee)]
-// CHECK:STDOUT:   %Generic.F.type: type = fn_type @Generic.F, @Generic(%Scalar.loc4_19.1) [symbolic = %Generic.F.type (constants.%Generic.F.type.f43)]
-// CHECK:STDOUT:   %Generic.F: @Generic.%Generic.F.type (%Generic.F.type.f43) = struct_value () [symbolic = %Generic.F (constants.%Generic.F.8a2)]
-// CHECK:STDOUT:   %Generic.assoc_type: type = assoc_entity_type @Generic, @Generic(%Scalar.loc4_19.1) [symbolic = %Generic.assoc_type (constants.%Generic.assoc_type.0fd)]
-// CHECK:STDOUT:   %assoc0.loc5_9.2: @Generic.%Generic.assoc_type (%Generic.assoc_type.0fd) = assoc_entity element0, %Generic.F.decl [symbolic = %assoc0.loc5_9.2 (constants.%assoc0.296)]
+// CHECK:STDOUT:   %Self.2: @Generic.%Generic.type (%Generic.type.91ccba.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.dee8d8.1)]
+// CHECK:STDOUT:   %Generic.F.type: type = fn_type @Generic.F, @Generic(%Scalar.loc4_19.1) [symbolic = %Generic.F.type (constants.%Generic.F.type.f439a9.1)]
+// CHECK:STDOUT:   %Generic.F: @Generic.%Generic.F.type (%Generic.F.type.f439a9.1) = struct_value () [symbolic = %Generic.F (constants.%Generic.F.8a2d67.1)]
+// CHECK:STDOUT:   %Generic.assoc_type: type = assoc_entity_type @Generic, @Generic(%Scalar.loc4_19.1) [symbolic = %Generic.assoc_type (constants.%Generic.assoc_type.0fd877.1)]
+// CHECK:STDOUT:   %assoc0.loc5_9.2: @Generic.%Generic.assoc_type (%Generic.assoc_type.0fd877.1) = assoc_entity element0, %Generic.F.decl [symbolic = %assoc0.loc5_9.2 (constants.%assoc0.2966cb.1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT:   interface {
 // CHECK:STDOUT:   interface {
-// CHECK:STDOUT:     %Self.1: @Generic.%Generic.type (%Generic.type.91ccba.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.dee)]
-// CHECK:STDOUT:     %Generic.F.decl: @Generic.%Generic.F.type (%Generic.F.type.f43) = fn_decl @Generic.F [symbolic = @Generic.%Generic.F (constants.%Generic.F.8a2)] {} {}
-// CHECK:STDOUT:     %assoc0.loc5_9.1: @Generic.%Generic.assoc_type (%Generic.assoc_type.0fd) = assoc_entity element0, %Generic.F.decl [symbolic = %assoc0.loc5_9.2 (constants.%assoc0.296)]
+// CHECK:STDOUT:     %Self.1: @Generic.%Generic.type (%Generic.type.91ccba.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.dee8d8.1)]
+// CHECK:STDOUT:     %Generic.F.decl: @Generic.%Generic.F.type (%Generic.F.type.f439a9.1) = fn_decl @Generic.F [symbolic = @Generic.%Generic.F (constants.%Generic.F.8a2d67.1)] {} {}
+// CHECK:STDOUT:     %assoc0.loc5_9.1: @Generic.%Generic.assoc_type (%Generic.assoc_type.0fd877.1) = assoc_entity element0, %Generic.F.decl [symbolic = %assoc0.loc5_9.2 (constants.%assoc0.2966cb.1)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT:   !members:
 // CHECK:STDOUT:   !members:
 // CHECK:STDOUT:     .Self = %Self.1
 // CHECK:STDOUT:     .Self = %Self.1
@@ -352,7 +357,7 @@ fn G() {
 // CHECK:STDOUT:   %Scalar.loc4_19.1 => constants.%Scalar
 // CHECK:STDOUT:   %Scalar.loc4_19.1 => constants.%Scalar
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:
-// CHECK:STDOUT: specific @Generic.F(constants.%Scalar, constants.%Self.dee) {}
+// CHECK:STDOUT: specific @Generic.F(constants.%Scalar, constants.%Self.dee8d8.1) {}
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Generic(constants.%GenericParam) {
 // CHECK:STDOUT: specific @Generic(constants.%GenericParam) {
 // CHECK:STDOUT:   %Scalar.loc4_19.1 => constants.%GenericParam
 // CHECK:STDOUT:   %Scalar.loc4_19.1 => constants.%GenericParam
@@ -370,6 +375,14 @@ fn G() {
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Generic(constants.%T) {
 // CHECK:STDOUT: specific @Generic(constants.%T) {
 // CHECK:STDOUT:   %Scalar.loc4_19.1 => constants.%T
 // CHECK:STDOUT:   %Scalar.loc4_19.1 => constants.%T
+// CHECK:STDOUT:
+// CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %Generic.type => constants.%Generic.type.91ccba.2
+// CHECK:STDOUT:   %Self.2 => constants.%Self.dee8d8.2
+// CHECK:STDOUT:   %Generic.F.type => constants.%Generic.F.type.f439a9.2
+// CHECK:STDOUT:   %Generic.F => constants.%Generic.F.8a2d67.2
+// CHECK:STDOUT:   %Generic.assoc_type => constants.%Generic.assoc_type.0fd877.2
+// CHECK:STDOUT:   %assoc0.loc5_9.2 => constants.%assoc0.2966cb.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @CallGenericMethod(constants.%T, constants.%U) {
 // CHECK:STDOUT: specific @CallGenericMethod(constants.%T, constants.%U) {

+ 11 - 6
toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon

@@ -139,6 +139,11 @@ fn B() {
 // CHECK:STDOUT:   %Generic.type.91ccba.2: type = facet_type <@Generic, @Generic(%T)> [symbolic]
 // CHECK:STDOUT:   %Generic.type.91ccba.2: type = facet_type <@Generic, @Generic(%T)> [symbolic]
 // CHECK:STDOUT:   %U: %Generic.type.91ccba.2 = bind_symbolic_name U, 1 [symbolic]
 // CHECK:STDOUT:   %U: %Generic.type.91ccba.2 = bind_symbolic_name U, 1 [symbolic]
 // CHECK:STDOUT:   %pattern_type.80f: type = pattern_type %Generic.type.91ccba.2 [symbolic]
 // CHECK:STDOUT:   %pattern_type.80f: type = pattern_type %Generic.type.91ccba.2 [symbolic]
+// CHECK:STDOUT:   %Self.dee8d8.2: %Generic.type.91ccba.2 = bind_symbolic_name Self, 1 [symbolic]
+// CHECK:STDOUT:   %Generic.F.type.f439a9.2: type = fn_type @Generic.F, @Generic(%T) [symbolic]
+// CHECK:STDOUT:   %Generic.F.8a2d67.2: %Generic.F.type.f439a9.2 = struct_value () [symbolic]
+// CHECK:STDOUT:   %Generic.assoc_type.0fd877.2: type = assoc_entity_type @Generic, @Generic(%T) [symbolic]
+// CHECK:STDOUT:   %assoc0.2966cb.2: %Generic.assoc_type.0fd877.2 = assoc_entity element0, @Generic.%Generic.F.decl [symbolic]
 // CHECK:STDOUT:   %U.as_type: type = facet_access_type %U [symbolic]
 // CHECK:STDOUT:   %U.as_type: type = facet_access_type %U [symbolic]
 // CHECK:STDOUT:   %pattern_type.f48: type = pattern_type %U.as_type [symbolic]
 // CHECK:STDOUT:   %pattern_type.f48: type = pattern_type %U.as_type [symbolic]
 // CHECK:STDOUT:   %pattern_type.7dc: type = pattern_type %T [symbolic]
 // CHECK:STDOUT:   %pattern_type.7dc: type = pattern_type %T [symbolic]
@@ -146,11 +151,6 @@ fn B() {
 // CHECK:STDOUT:   %CallGenericMethod: %CallGenericMethod.type = struct_value () [concrete]
 // CHECK:STDOUT:   %CallGenericMethod: %CallGenericMethod.type = struct_value () [concrete]
 // CHECK:STDOUT:   %require_complete.7b2: <witness> = require_complete_type %U.as_type [symbolic]
 // CHECK:STDOUT:   %require_complete.7b2: <witness> = require_complete_type %U.as_type [symbolic]
 // CHECK:STDOUT:   %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
 // CHECK:STDOUT:   %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
-// CHECK:STDOUT:   %Self.dee8d8.2: %Generic.type.91ccba.2 = bind_symbolic_name Self, 1 [symbolic]
-// CHECK:STDOUT:   %Generic.F.type.f439a9.2: type = fn_type @Generic.F, @Generic(%T) [symbolic]
-// CHECK:STDOUT:   %Generic.F.8a2d67.2: %Generic.F.type.f439a9.2 = struct_value () [symbolic]
-// CHECK:STDOUT:   %Generic.assoc_type.0fd877.2: type = assoc_entity_type @Generic, @Generic(%T) [symbolic]
-// CHECK:STDOUT:   %assoc0.2966cb.2: %Generic.assoc_type.0fd877.2 = assoc_entity element0, @Generic.%Generic.F.decl [symbolic]
 // CHECK:STDOUT:   %require_complete.02a: <witness> = require_complete_type %Generic.type.91ccba.2 [symbolic]
 // CHECK:STDOUT:   %require_complete.02a: <witness> = require_complete_type %Generic.type.91ccba.2 [symbolic]
 // CHECK:STDOUT:   %Generic.lookup_impl_witness: <witness> = lookup_impl_witness %U, @Generic, @Generic(%T) [symbolic]
 // CHECK:STDOUT:   %Generic.lookup_impl_witness: <witness> = lookup_impl_witness %U, @Generic, @Generic(%T) [symbolic]
 // CHECK:STDOUT:   %Generic.facet.680: %Generic.type.91ccba.2 = facet_value %U.as_type, (%Generic.lookup_impl_witness) [symbolic]
 // CHECK:STDOUT:   %Generic.facet.680: %Generic.type.91ccba.2 = facet_value %U.as_type, (%Generic.lookup_impl_witness) [symbolic]
@@ -498,6 +498,7 @@ fn B() {
 // CHECK:STDOUT:   %I.type.202: type = facet_type <@I, @I(%empty_struct_type, %empty_tuple.type)> [concrete]
 // CHECK:STDOUT:   %I.type.202: type = facet_type <@I, @I(%empty_struct_type, %empty_tuple.type)> [concrete]
 // CHECK:STDOUT:   %T.e96: %I.type.202 = bind_symbolic_name T, 0 [symbolic]
 // CHECK:STDOUT:   %T.e96: %I.type.202 = bind_symbolic_name T, 0 [symbolic]
 // CHECK:STDOUT:   %pattern_type.a84: type = pattern_type %I.type.202 [concrete]
 // CHECK:STDOUT:   %pattern_type.a84: type = pattern_type %I.type.202 [concrete]
+// CHECK:STDOUT:   %Self.38c: %I.type.202 = bind_symbolic_name Self, 2 [symbolic]
 // CHECK:STDOUT:   %T.as_type: type = facet_access_type %T.e96 [symbolic]
 // CHECK:STDOUT:   %T.as_type: type = facet_access_type %T.e96 [symbolic]
 // CHECK:STDOUT:   %pattern_type.3ff: type = pattern_type %T.as_type [symbolic]
 // CHECK:STDOUT:   %pattern_type.3ff: type = pattern_type %T.as_type [symbolic]
 // CHECK:STDOUT:   %A.type: type = fn_type @A [concrete]
 // CHECK:STDOUT:   %A.type: type = fn_type @A [concrete]
@@ -506,7 +507,6 @@ fn B() {
 // CHECK:STDOUT:   %B.type: type = fn_type @B [concrete]
 // CHECK:STDOUT:   %B.type: type = fn_type @B [concrete]
 // CHECK:STDOUT:   %B: %B.type = struct_value () [concrete]
 // CHECK:STDOUT:   %B: %B.type = struct_value () [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
 // CHECK:STDOUT:   %C.val: %C = struct_value () [concrete]
-// CHECK:STDOUT:   %Self.38c: %I.type.202 = bind_symbolic_name Self, 2 [symbolic]
 // CHECK:STDOUT:   %complete_type.3d9: <witness> = complete_type_witness %I.type.202 [concrete]
 // CHECK:STDOUT:   %complete_type.3d9: <witness> = complete_type_witness %I.type.202 [concrete]
 // CHECK:STDOUT:   %I.impl_witness.806: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%empty_struct_type) [concrete]
 // CHECK:STDOUT:   %I.impl_witness.806: <witness> = impl_witness file.%I.impl_witness_table, @C.as.I.impl(%empty_struct_type) [concrete]
 // CHECK:STDOUT:   %I.facet: %I.type.202 = facet_value %C, (%I.impl_witness.806) [concrete]
 // CHECK:STDOUT:   %I.facet: %I.type.202 = facet_value %C, (%I.impl_witness.806) [concrete]
@@ -763,6 +763,7 @@ fn B() {
 // CHECK:STDOUT:   %I.type.906: type = facet_type <@I, @I(%empty_struct_type, %empty_struct_type)> [concrete]
 // CHECK:STDOUT:   %I.type.906: type = facet_type <@I, @I(%empty_struct_type, %empty_struct_type)> [concrete]
 // CHECK:STDOUT:   %T.4b2: %I.type.906 = bind_symbolic_name T, 0 [symbolic]
 // CHECK:STDOUT:   %T.4b2: %I.type.906 = bind_symbolic_name T, 0 [symbolic]
 // CHECK:STDOUT:   %pattern_type.a62: type = pattern_type %I.type.906 [concrete]
 // CHECK:STDOUT:   %pattern_type.a62: type = pattern_type %I.type.906 [concrete]
+// CHECK:STDOUT:   %Self.bc2: %I.type.906 = bind_symbolic_name Self, 2 [symbolic]
 // CHECK:STDOUT:   %T.as_type: type = facet_access_type %T.4b2 [symbolic]
 // CHECK:STDOUT:   %T.as_type: type = facet_access_type %T.4b2 [symbolic]
 // CHECK:STDOUT:   %pattern_type.f1c: type = pattern_type %T.as_type [symbolic]
 // CHECK:STDOUT:   %pattern_type.f1c: type = pattern_type %T.as_type [symbolic]
 // CHECK:STDOUT:   %A.type: type = fn_type @A [concrete]
 // CHECK:STDOUT:   %A.type: type = fn_type @A [concrete]
@@ -955,6 +956,10 @@ fn B() {
 // CHECK:STDOUT: specific @I(constants.%empty_struct_type, constants.%empty_struct_type) {
 // CHECK:STDOUT: specific @I(constants.%empty_struct_type, constants.%empty_struct_type) {
 // CHECK:STDOUT:   %V.loc3_13.1 => constants.%empty_struct_type
 // CHECK:STDOUT:   %V.loc3_13.1 => constants.%empty_struct_type
 // CHECK:STDOUT:   %W.loc3_23.1 => constants.%empty_struct_type
 // CHECK:STDOUT:   %W.loc3_23.1 => constants.%empty_struct_type
+// CHECK:STDOUT:
+// CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %I.type => constants.%I.type.906
+// CHECK:STDOUT:   %Self.2 => constants.%Self.bc2
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @A(constants.%T.4b2) {
 // CHECK:STDOUT: specific @A(constants.%T.4b2) {

+ 5 - 0
toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon

@@ -83,6 +83,7 @@ fn F() {
 // CHECK:STDOUT:   %Eats.type.b39: type = facet_type <@Eats, @Eats(%Food.as_type.952)> [symbolic]
 // CHECK:STDOUT:   %Eats.type.b39: type = facet_type <@Eats, @Eats(%Food.as_type.952)> [symbolic]
 // CHECK:STDOUT:   %T.223: %Eats.type.b39 = bind_symbolic_name T, 1 [symbolic]
 // CHECK:STDOUT:   %T.223: %Eats.type.b39 = bind_symbolic_name T, 1 [symbolic]
 // CHECK:STDOUT:   %pattern_type.ed7: type = pattern_type %Eats.type.b39 [symbolic]
 // CHECK:STDOUT:   %pattern_type.ed7: type = pattern_type %Eats.type.b39 [symbolic]
+// CHECK:STDOUT:   %Self.223: %Eats.type.b39 = bind_symbolic_name Self, 1 [symbolic]
 // CHECK:STDOUT:   %T.as_type.212: type = facet_access_type %T.223 [symbolic]
 // CHECK:STDOUT:   %T.as_type.212: type = facet_access_type %T.223 [symbolic]
 // CHECK:STDOUT:   %pattern_type.1a1: type = pattern_type %T.as_type.212 [symbolic]
 // CHECK:STDOUT:   %pattern_type.1a1: type = pattern_type %T.as_type.212 [symbolic]
 // CHECK:STDOUT:   %pattern_type.54f: type = pattern_type %Food.as_type.952 [symbolic]
 // CHECK:STDOUT:   %pattern_type.54f: type = pattern_type %Food.as_type.952 [symbolic]
@@ -503,6 +504,10 @@ fn F() {
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Eats(constants.%Food.as_type.952) {
 // CHECK:STDOUT: specific @Eats(constants.%Food.as_type.952) {
 // CHECK:STDOUT:   %Food.loc21_16.1 => constants.%Food.as_type.952
 // CHECK:STDOUT:   %Food.loc21_16.1 => constants.%Food.as_type.952
+// CHECK:STDOUT:
+// CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %Eats.type => constants.%Eats.type.b39
+// CHECK:STDOUT:   %Self.2 => constants.%Self.223
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Feed(constants.%Food.9af, constants.%T.223) {
 // CHECK:STDOUT: specific @Feed(constants.%Food.9af, constants.%T.223) {

+ 1 - 1
toolchain/check/testdata/impl/forward_decls.carbon

@@ -492,12 +492,12 @@ interface I {
 // CHECK:STDOUT:   %I.assoc_type: type = assoc_entity_type @I [concrete]
 // CHECK:STDOUT:   %I.assoc_type: type = assoc_entity_type @I [concrete]
 // CHECK:STDOUT:   %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
 // CHECK:STDOUT:   %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %.Self.258: %I.type = bind_symbolic_name .Self [symbolic_self]
 // CHECK:STDOUT:   %.Self.258: %I.type = bind_symbolic_name .Self [symbolic_self]
 // CHECK:STDOUT:   %.Self.as_type: type = facet_access_type %.Self.258 [symbolic_self]
 // CHECK:STDOUT:   %.Self.as_type: type = facet_access_type %.Self.258 [symbolic_self]
 // CHECK:STDOUT:   %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.258, @I [symbolic_self]
 // CHECK:STDOUT:   %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.258, @I [symbolic_self]
 // CHECK:STDOUT:   %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
 // CHECK:STDOUT:   %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
-// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
 // CHECK:STDOUT:   %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT:   %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/check/testdata/impl/import_interface_assoc_const.carbon

@@ -615,9 +615,9 @@ impl CD as IF where .F = 0 {
 // CHECK:STDOUT:   %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
 // CHECK:STDOUT:   %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
 // CHECK:STDOUT:   %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
 // CHECK:STDOUT:   %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %I_where.type.8c8: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete]
 // CHECK:STDOUT:   %I_where.type.8c8: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete]
 // CHECK:STDOUT:   %I.impl_witness.b54: <witness> = impl_witness file.%I.impl_witness_table.loc9 [concrete]
 // CHECK:STDOUT:   %I.impl_witness.b54: <witness> = impl_witness file.%I.impl_witness_table.loc9 [concrete]
-// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %I_where.type.cba: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
 // CHECK:STDOUT:   %I_where.type.cba: type = facet_type <@I where %impl.elem0 = %empty_tuple.type> [concrete]
 // CHECK:STDOUT:   %I.impl_witness.ac6: <witness> = impl_witness file.%I.impl_witness_table.loc10 [concrete]
 // CHECK:STDOUT:   %I.impl_witness.ac6: <witness> = impl_witness file.%I.impl_witness_table.loc10 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/check/testdata/impl/use_assoc_const.carbon

@@ -3147,8 +3147,8 @@ fn F() {
 // CHECK:STDOUT:   %M.type: type = facet_type <@M> [concrete]
 // CHECK:STDOUT:   %M.type: type = facet_type <@M> [concrete]
 // CHECK:STDOUT:   %Self: %M.type = bind_symbolic_name Self, 0 [symbolic]
 // CHECK:STDOUT:   %Self: %M.type = bind_symbolic_name Self, 0 [symbolic]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
 // CHECK:STDOUT:   %M.assoc_type: type = assoc_entity_type @M [concrete]
 // CHECK:STDOUT:   %M.assoc_type: type = assoc_entity_type @M [concrete]
 // CHECK:STDOUT:   %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete]
 // CHECK:STDOUT:   %assoc0: %M.assoc_type = assoc_entity element0, @M.%Z [concrete]
 // CHECK:STDOUT:   %pattern_type: type = pattern_type %empty_struct_type [concrete]
 // CHECK:STDOUT:   %pattern_type: type = pattern_type %empty_struct_type [concrete]
@@ -3315,6 +3315,7 @@ fn F() {
 // CHECK:STDOUT:   %M.facet.caa: %M.type = facet_value %.Self.as_type, (%M.lookup_impl_witness) [symbolic_self]
 // CHECK:STDOUT:   %M.facet.caa: %M.type = facet_value %.Self.as_type, (%M.lookup_impl_witness) [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0: %struct_type.b.86f = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self]
 // CHECK:STDOUT:   %impl.elem0: %struct_type.b.86f = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self]
 // CHECK:STDOUT:   %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
 // CHECK:STDOUT:   %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
+// CHECK:STDOUT:   %struct_type.b.161: type = struct_type {.b: %empty_tuple.type} [concrete]
 // CHECK:STDOUT:   %struct.0f3: %struct_type.b.86f = struct_value (%empty_struct_type) [concrete]
 // CHECK:STDOUT:   %struct.0f3: %struct_type.b.86f = struct_value (%empty_struct_type) [concrete]
 // CHECK:STDOUT:   %M_where.type.d04: type = facet_type <@M where %impl.elem0 = %struct.0f3> [concrete]
 // CHECK:STDOUT:   %M_where.type.d04: type = facet_type <@M where %impl.elem0 = %struct.0f3> [concrete]
 // CHECK:STDOUT:   %M.impl_witness.baa: <witness> = impl_witness file.%M.impl_witness_table.loc10 [concrete]
 // CHECK:STDOUT:   %M.impl_witness.baa: <witness> = impl_witness file.%M.impl_witness_table.loc10 [concrete]
@@ -3322,7 +3323,6 @@ fn F() {
 // CHECK:STDOUT:   %C.as.M.impl.G.eac: %C.as.M.impl.G.type.d92 = struct_value () [concrete]
 // CHECK:STDOUT:   %C.as.M.impl.G.eac: %C.as.M.impl.G.type.d92 = struct_value () [concrete]
 // CHECK:STDOUT:   %M.facet.1dc: %M.type = facet_value %C.7a7, (%M.impl_witness.baa) [concrete]
 // CHECK:STDOUT:   %M.facet.1dc: %M.type = facet_value %C.7a7, (%M.impl_witness.baa) [concrete]
 // CHECK:STDOUT:   %C.3a0: type = class_type @C, @C(%empty_tuple.type) [concrete]
 // CHECK:STDOUT:   %C.3a0: type = class_type @C, @C(%empty_tuple.type) [concrete]
-// CHECK:STDOUT:   %struct_type.b.161: type = struct_type {.b: %empty_tuple.type} [concrete]
 // CHECK:STDOUT:   %struct.c94: %struct_type.b.86f = struct_value (%empty_tuple.type) [concrete]
 // CHECK:STDOUT:   %struct.c94: %struct_type.b.86f = struct_value (%empty_tuple.type) [concrete]
 // CHECK:STDOUT:   %M_where.type.eda: type = facet_type <@M where %impl.elem0 = %struct.c94> [concrete]
 // CHECK:STDOUT:   %M_where.type.eda: type = facet_type <@M where %impl.elem0 = %struct.c94> [concrete]
 // CHECK:STDOUT:   %M.impl_witness.feb: <witness> = impl_witness file.%M.impl_witness_table.loc16 [concrete]
 // CHECK:STDOUT:   %M.impl_witness.feb: <witness> = impl_witness file.%M.impl_witness_table.loc16 [concrete]

+ 8 - 3
toolchain/check/testdata/interface/generic.carbon

@@ -381,7 +381,7 @@ fn G(T:! Generic(B)) {
 // CHECK:STDOUT:   %Generic.type.c21: type = generic_interface_type @Generic [concrete]
 // CHECK:STDOUT:   %Generic.type.c21: type = generic_interface_type @Generic [concrete]
 // CHECK:STDOUT:   %Generic.generic: %Generic.type.c21 = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.generic: %Generic.type.c21 = struct_value () [concrete]
 // CHECK:STDOUT:   %Generic.type.91c: type = facet_type <@Generic, @Generic(%T.8b3)> [symbolic]
 // CHECK:STDOUT:   %Generic.type.91c: type = facet_type <@Generic, @Generic(%T.8b3)> [symbolic]
-// CHECK:STDOUT:   %Self: %Generic.type.91c = bind_symbolic_name Self, 1 [symbolic]
+// CHECK:STDOUT:   %Self.dee: %Generic.type.91c = bind_symbolic_name Self, 1 [symbolic]
 // CHECK:STDOUT:   %A: type = class_type @A [concrete]
 // CHECK:STDOUT:   %A: type = class_type @A [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
@@ -396,6 +396,7 @@ fn G(T:! Generic(B)) {
 // CHECK:STDOUT:   %pattern_type.f4a: type = pattern_type %Generic.type.4ce [concrete]
 // CHECK:STDOUT:   %pattern_type.f4a: type = pattern_type %Generic.type.4ce [concrete]
 // CHECK:STDOUT:   %G.type: type = fn_type @G [concrete]
 // CHECK:STDOUT:   %G.type: type = fn_type @G [concrete]
 // CHECK:STDOUT:   %G: %G.type = struct_value () [concrete]
 // CHECK:STDOUT:   %G: %G.type = struct_value () [concrete]
+// CHECK:STDOUT:   %Self.52f: %Generic.type.4ce = bind_symbolic_name Self, 1 [symbolic]
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT: file {
@@ -443,10 +444,10 @@ fn G(T:! Generic(B)) {
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: !definition:
 // CHECK:STDOUT: !definition:
 // CHECK:STDOUT:   %Generic.type: type = facet_type <@Generic, @Generic(%T.loc4_19.1)> [symbolic = %Generic.type (constants.%Generic.type.91c)]
 // CHECK:STDOUT:   %Generic.type: type = facet_type <@Generic, @Generic(%T.loc4_19.1)> [symbolic = %Generic.type (constants.%Generic.type.91c)]
-// CHECK:STDOUT:   %Self.2: @Generic.%Generic.type (%Generic.type.91c) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
+// CHECK:STDOUT:   %Self.2: @Generic.%Generic.type (%Generic.type.91c) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.dee)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT:   interface {
 // CHECK:STDOUT:   interface {
-// CHECK:STDOUT:     %Self.1: @Generic.%Generic.type (%Generic.type.91c) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
+// CHECK:STDOUT:     %Self.1: @Generic.%Generic.type (%Generic.type.91c) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.dee)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT:   !members:
 // CHECK:STDOUT:   !members:
 // CHECK:STDOUT:     .Self = %Self.1
 // CHECK:STDOUT:     .Self = %Self.1
@@ -503,6 +504,10 @@ fn G(T:! Generic(B)) {
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Generic(constants.%B) {
 // CHECK:STDOUT: specific @Generic(constants.%B) {
 // CHECK:STDOUT:   %T.loc4_19.1 => constants.%B
 // CHECK:STDOUT:   %T.loc4_19.1 => constants.%B
+// CHECK:STDOUT:
+// CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %Generic.type => constants.%Generic.type.4ce
+// CHECK:STDOUT:   %Self.2 => constants.%Self.52f
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @G(constants.%T.bae) {
 // CHECK:STDOUT: specific @G(constants.%T.bae) {

+ 1 - 1
toolchain/check/testdata/patterns/underscore.carbon

@@ -224,9 +224,9 @@ fn F() -> {} {
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %pattern_type: type = pattern_type %empty_struct_type [concrete]
 // CHECK:STDOUT:   %pattern_type: type = pattern_type %empty_struct_type [concrete]
 // CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
 // CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %G.type: type = fn_type @G [concrete]
 // CHECK:STDOUT:   %G.type: type = fn_type @G [concrete]
 // CHECK:STDOUT:   %G: %G.type = struct_value () [concrete]
 // CHECK:STDOUT:   %G: %G.type = struct_value () [concrete]

+ 2 - 2
toolchain/check/testdata/struct/fail_assign_nested.carbon

@@ -24,7 +24,7 @@ var x: {.a: {}} = {.b = {}};
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
 // CHECK:STDOUT:   %struct_type.a.225: type = struct_type {.a: %empty_struct_type} [concrete]
 // CHECK:STDOUT:   %struct_type.a.225: type = struct_type {.a: %empty_struct_type} [concrete]
 // CHECK:STDOUT:   %pattern_type: type = pattern_type %struct_type.a.225 [concrete]
 // CHECK:STDOUT:   %pattern_type: type = pattern_type %struct_type.a.225 [concrete]
-// CHECK:STDOUT:   %struct_type.b: type = struct_type {.b: %empty_struct_type} [concrete]
+// CHECK:STDOUT:   %struct_type.b.347: type = struct_type {.b: %empty_struct_type} [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT: file {
@@ -47,7 +47,7 @@ var x: {.a: {}} = {.b = {}};
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc19_26: %empty_struct_type = struct_literal ()
 // CHECK:STDOUT:   %.loc19_26: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %.loc19_27: %struct_type.b = struct_literal (%.loc19_26)
+// CHECK:STDOUT:   %.loc19_27: %struct_type.b.347 = struct_literal (%.loc19_26)
 // CHECK:STDOUT:   assign file.%x.var, <error>
 // CHECK:STDOUT:   assign file.%x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT: }