Skip to content

Commit 54b994c

Browse files
authored
Simplify member access in facet values (carbon-language#6146)
Given `fn f(T:! I, x: T)`, we have a facet type `I`, a facet value `T` and a value `x` of type `FacetAccessType(T)`. Previously we explicitly handled the case of member access on `x.F` where the type is a `FacetAccessType` by looking through it at the facet value, and then at its facet type. This is already something that impl lookup does for us, so we can remove this special case. We also previously had a complex branch handling the case `T.F` on a facet value, because `PerformImplLookup()` in member access is expecting a `TypeId`, not a facet value. However, the first thing that branch does is convert the facet value to a type expression, forming a `FacetAccessType`. Unfortuntely, when combined, if we had `x.F` we would convert it from a value of type `FacetAccessType` to a facet value, and then convert that to a type as a `FacetAccessType` again. We see this extra `FacetAccessType` disappear from the SemIR after this change. In this change, we remove both the inlined replacement of `PerformImplLookup()` and the explicit handling of `FacetAccessType`. We drive all member access lookups on the `base_id`'s type through a single `PerformImplLookup()` call. If the `base_id` is a facet value, to get the TypeId to look into, we convert the facet value to a `FacetAccessType`, reducing the complex special cases down to a single line.
1 parent 35fb000 commit 54b994c

File tree

8 files changed

+125
-175
lines changed

8 files changed

+125
-175
lines changed

toolchain/check/member_access.cpp

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -331,45 +331,19 @@ static auto LookupMemberNameInScope(Context& context, SemIR::LocId loc_id,
331331
if (auto assoc_type =
332332
context.types().TryGetAs<SemIR::AssociatedEntityType>(type_id)) {
333333
if (lookup_in_type_of_base) {
334-
SemIR::TypeId base_type_id = context.insts().Get(base_id).type_id();
335-
if (auto facet_access_type =
336-
context.types().TryGetAs<SemIR::FacetAccessType>(base_type_id)) {
337-
// Move from the type of a symbolic facet value up in typish-ness to its
338-
// FacetType to find the type to work with.
339-
base_id = facet_access_type->facet_value_inst_id;
340-
base_type_id = context.insts().Get(base_id).type_id();
334+
auto base_type_id = context.insts().Get(base_id).type_id();
335+
336+
// When performing access `T.F` on a facet value `T`, convert the facet
337+
// value `T` itself to a type (`T as type`) to look inside the facet type
338+
// for a witness. This makes the lookup equivalent to `x.F` where the type
339+
// of `x` is a facet value `T`.
340+
if (context.types().Is<SemIR::FacetType>(base_type_id)) {
341+
base_type_id = ExprAsType(context, loc_id, base_id).type_id;
341342
}
342343

343-
if (auto facet_type =
344-
context.types().TryGetAs<SemIR::FacetType>(base_type_id)) {
345-
// Handles `T.F` when `T` is a non-type facet.
346-
auto base_as_type = ExprAsType(context, loc_id, base_id);
347-
348-
auto assoc_interface = assoc_type->GetSpecificInterface();
349-
350-
// Witness that `T` implements the `assoc_interface`.
351-
auto lookup_result = LookupImplWitness(
352-
context, loc_id,
353-
context.types().GetConstantId(base_as_type.type_id),
354-
EvalOrAddInst(
355-
context, loc_id,
356-
FacetTypeFromInterface(context, assoc_interface.interface_id,
357-
assoc_interface.specific_id)));
358-
CARBON_CHECK(lookup_result.has_value());
359-
auto witness_inst_id =
360-
GetWitnessFromSingleImplLookupResult(context, lookup_result);
361-
362-
member_id = AccessMemberOfImplWitness(
363-
context, loc_id, base_as_type.type_id, witness_inst_id,
364-
assoc_interface.specific_id, member_id);
365-
} else {
366-
// Handles `x.F` if `x` is of type `class C` that extends an interface
367-
// containing `F`.
368-
SemIR::ConstantId constant_id =
369-
context.types().GetConstantId(base_type_id);
370-
member_id = PerformImplLookup(context, loc_id, constant_id, *assoc_type,
371-
member_id);
372-
}
344+
member_id = PerformImplLookup(context, loc_id,
345+
context.types().GetConstantId(base_type_id),
346+
*assoc_type, member_id);
373347
} else if (ScopeNeedsImplLookup(context, name_scope_const_id)) {
374348
// Handles `T.F` where `T` is a type extending an interface containing
375349
// `F`.

toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -153,69 +153,69 @@ fn Foo[T:! type](p: T*) -> (T*, ()) {
153153
// CHECK:STDOUT: import_ir_inst122: {ir_id: ir4, inst_id: inst384}
154154
// CHECK:STDOUT: import_ir_inst123: {ir_id: ir4, inst_id: inst401}
155155
// CHECK:STDOUT: import_ir_inst124: {ir_id: ir4, inst_id: inst409}
156-
// CHECK:STDOUT: import_ir_inst125: {ir_id: ir4, inst_id: inst415}
157-
// CHECK:STDOUT: import_ir_inst126: {ir_id: ir4, inst_id: inst417}
158-
// CHECK:STDOUT: import_ir_inst127: {ir_id: ir4, inst_id: inst418}
159-
// CHECK:STDOUT: import_ir_inst128: {ir_id: ir4, inst_id: inst421}
160-
// CHECK:STDOUT: import_ir_inst129: {ir_id: ir4, inst_id: inst433}
161-
// CHECK:STDOUT: import_ir_inst130: {ir_id: ir4, inst_id: inst440}
162-
// CHECK:STDOUT: import_ir_inst131: {ir_id: ir4, inst_id: inst444}
163-
// CHECK:STDOUT: import_ir_inst132: {ir_id: ir4, inst_id: inst445}
164-
// CHECK:STDOUT: import_ir_inst133: {ir_id: ir4, inst_id: inst450}
165-
// CHECK:STDOUT: import_ir_inst134: {ir_id: ir4, inst_id: inst507}
166-
// CHECK:STDOUT: import_ir_inst135: {ir_id: ir4, inst_id: inst505}
167-
// CHECK:STDOUT: import_ir_inst136: {ir_id: ir4, inst_id: inst481}
168-
// CHECK:STDOUT: import_ir_inst137: {ir_id: ir4, inst_id: inst475}
169-
// CHECK:STDOUT: import_ir_inst138: {ir_id: ir4, inst_id: inst470}
170-
// CHECK:STDOUT: import_ir_inst139: {ir_id: ir4, inst_id: inst468}
171-
// CHECK:STDOUT: import_ir_inst140: {ir_id: ir4, inst_id: inst473}
172-
// CHECK:STDOUT: import_ir_inst141: {ir_id: ir4, inst_id: inst478}
173-
// CHECK:STDOUT: import_ir_inst142: {ir_id: ir4, inst_id: inst499}
174-
// CHECK:STDOUT: import_ir_inst143: {ir_id: ir4, inst_id: inst501}
175-
// CHECK:STDOUT: import_ir_inst144: {ir_id: ir4, inst_id: inst532}
176-
// CHECK:STDOUT: import_ir_inst145: {ir_id: ir4, inst_id: inst506}
177-
// CHECK:STDOUT: import_ir_inst146: {ir_id: ir4, inst_id: inst469}
178-
// CHECK:STDOUT: import_ir_inst147: {ir_id: ir4, inst_id: inst474}
179-
// CHECK:STDOUT: import_ir_inst148: {ir_id: ir4, inst_id: inst480}
180-
// CHECK:STDOUT: import_ir_inst149: {ir_id: ir4, inst_id: inst489}
181-
// CHECK:STDOUT: import_ir_inst150: {ir_id: ir4, inst_id: inst492}
182-
// CHECK:STDOUT: import_ir_inst151: {ir_id: ir4, inst_id: inst496}
183-
// CHECK:STDOUT: import_ir_inst152: {ir_id: ir4, inst_id: inst500}
184-
// CHECK:STDOUT: import_ir_inst153: {ir_id: ir4, inst_id: inst509}
185-
// CHECK:STDOUT: import_ir_inst154: {ir_id: ir4, inst_id: inst532}
186-
// CHECK:STDOUT: import_ir_inst155: {ir_id: ir4, inst_id: inst527}
187-
// CHECK:STDOUT: import_ir_inst156: {ir_id: ir4, inst_id: inst528}
188-
// CHECK:STDOUT: import_ir_inst157: {ir_id: ir4, inst_id: inst523}
189-
// CHECK:STDOUT: import_ir_inst158: {ir_id: ir4, inst_id: inst525}
190-
// CHECK:STDOUT: import_ir_inst159: {ir_id: ir4, inst_id: inst468}
191-
// CHECK:STDOUT: import_ir_inst160: {ir_id: ir4, inst_id: inst473}
192-
// CHECK:STDOUT: import_ir_inst161: {ir_id: ir4, inst_id: inst478}
193-
// CHECK:STDOUT: import_ir_inst162: {ir_id: ir4, inst_id: inst535}
194-
// CHECK:STDOUT: import_ir_inst163: {ir_id: ir4, inst_id: inst536}
195-
// CHECK:STDOUT: import_ir_inst164: {ir_id: ir4, inst_id: inst514}
196-
// CHECK:STDOUT: import_ir_inst165: {ir_id: ir4, inst_id: inst515}
197-
// CHECK:STDOUT: import_ir_inst166: {ir_id: ir4, inst_id: inst516}
198-
// CHECK:STDOUT: import_ir_inst167: {ir_id: ir4, inst_id: inst517}
199-
// CHECK:STDOUT: import_ir_inst168: {ir_id: ir4, inst_id: inst518}
200-
// CHECK:STDOUT: import_ir_inst169: {ir_id: ir4, inst_id: inst519}
201-
// CHECK:STDOUT: import_ir_inst170: {ir_id: ir4, inst_id: inst520}
202-
// CHECK:STDOUT: import_ir_inst171: {ir_id: ir4, inst_id: inst524}
203-
// CHECK:STDOUT: import_ir_inst172: {ir_id: ir4, inst_id: inst541}
204-
// CHECK:STDOUT: import_ir_inst173: {ir_id: ir4, inst_id: inst548}
205-
// CHECK:STDOUT: import_ir_inst174: {ir_id: ir4, inst_id: inst554}
206-
// CHECK:STDOUT: import_ir_inst175: {ir_id: ir4, inst_id: inst556}
207-
// CHECK:STDOUT: import_ir_inst176: {ir_id: ir4, inst_id: inst557}
208-
// CHECK:STDOUT: import_ir_inst177: {ir_id: ir4, inst_id: inst560}
209-
// CHECK:STDOUT: import_ir_inst178: {ir_id: ir4, inst_id: inst570}
210-
// CHECK:STDOUT: import_ir_inst179: {ir_id: ir4, inst_id: inst576}
211-
// CHECK:STDOUT: import_ir_inst180: {ir_id: ir4, inst_id: inst578}
212-
// CHECK:STDOUT: import_ir_inst181: {ir_id: ir4, inst_id: inst579}
213-
// CHECK:STDOUT: import_ir_inst182: {ir_id: ir4, inst_id: inst582}
214-
// CHECK:STDOUT: import_ir_inst183: {ir_id: ir4, inst_id: inst594}
215-
// CHECK:STDOUT: import_ir_inst184: {ir_id: ir4, inst_id: inst601}
216-
// CHECK:STDOUT: import_ir_inst185: {ir_id: ir4, inst_id: inst605}
217-
// CHECK:STDOUT: import_ir_inst186: {ir_id: ir4, inst_id: inst606}
218-
// CHECK:STDOUT: import_ir_inst187: {ir_id: ir4, inst_id: inst611}
156+
// CHECK:STDOUT: import_ir_inst125: {ir_id: ir4, inst_id: inst413}
157+
// CHECK:STDOUT: import_ir_inst126: {ir_id: ir4, inst_id: inst415}
158+
// CHECK:STDOUT: import_ir_inst127: {ir_id: ir4, inst_id: inst416}
159+
// CHECK:STDOUT: import_ir_inst128: {ir_id: ir4, inst_id: inst419}
160+
// CHECK:STDOUT: import_ir_inst129: {ir_id: ir4, inst_id: inst431}
161+
// CHECK:STDOUT: import_ir_inst130: {ir_id: ir4, inst_id: inst436}
162+
// CHECK:STDOUT: import_ir_inst131: {ir_id: ir4, inst_id: inst440}
163+
// CHECK:STDOUT: import_ir_inst132: {ir_id: ir4, inst_id: inst441}
164+
// CHECK:STDOUT: import_ir_inst133: {ir_id: ir4, inst_id: inst446}
165+
// CHECK:STDOUT: import_ir_inst134: {ir_id: ir4, inst_id: inst503}
166+
// CHECK:STDOUT: import_ir_inst135: {ir_id: ir4, inst_id: inst501}
167+
// CHECK:STDOUT: import_ir_inst136: {ir_id: ir4, inst_id: inst477}
168+
// CHECK:STDOUT: import_ir_inst137: {ir_id: ir4, inst_id: inst471}
169+
// CHECK:STDOUT: import_ir_inst138: {ir_id: ir4, inst_id: inst466}
170+
// CHECK:STDOUT: import_ir_inst139: {ir_id: ir4, inst_id: inst464}
171+
// CHECK:STDOUT: import_ir_inst140: {ir_id: ir4, inst_id: inst469}
172+
// CHECK:STDOUT: import_ir_inst141: {ir_id: ir4, inst_id: inst474}
173+
// CHECK:STDOUT: import_ir_inst142: {ir_id: ir4, inst_id: inst495}
174+
// CHECK:STDOUT: import_ir_inst143: {ir_id: ir4, inst_id: inst497}
175+
// CHECK:STDOUT: import_ir_inst144: {ir_id: ir4, inst_id: inst528}
176+
// CHECK:STDOUT: import_ir_inst145: {ir_id: ir4, inst_id: inst502}
177+
// CHECK:STDOUT: import_ir_inst146: {ir_id: ir4, inst_id: inst465}
178+
// CHECK:STDOUT: import_ir_inst147: {ir_id: ir4, inst_id: inst470}
179+
// CHECK:STDOUT: import_ir_inst148: {ir_id: ir4, inst_id: inst476}
180+
// CHECK:STDOUT: import_ir_inst149: {ir_id: ir4, inst_id: inst485}
181+
// CHECK:STDOUT: import_ir_inst150: {ir_id: ir4, inst_id: inst488}
182+
// CHECK:STDOUT: import_ir_inst151: {ir_id: ir4, inst_id: inst492}
183+
// CHECK:STDOUT: import_ir_inst152: {ir_id: ir4, inst_id: inst496}
184+
// CHECK:STDOUT: import_ir_inst153: {ir_id: ir4, inst_id: inst505}
185+
// CHECK:STDOUT: import_ir_inst154: {ir_id: ir4, inst_id: inst528}
186+
// CHECK:STDOUT: import_ir_inst155: {ir_id: ir4, inst_id: inst523}
187+
// CHECK:STDOUT: import_ir_inst156: {ir_id: ir4, inst_id: inst524}
188+
// CHECK:STDOUT: import_ir_inst157: {ir_id: ir4, inst_id: inst519}
189+
// CHECK:STDOUT: import_ir_inst158: {ir_id: ir4, inst_id: inst521}
190+
// CHECK:STDOUT: import_ir_inst159: {ir_id: ir4, inst_id: inst464}
191+
// CHECK:STDOUT: import_ir_inst160: {ir_id: ir4, inst_id: inst469}
192+
// CHECK:STDOUT: import_ir_inst161: {ir_id: ir4, inst_id: inst474}
193+
// CHECK:STDOUT: import_ir_inst162: {ir_id: ir4, inst_id: inst531}
194+
// CHECK:STDOUT: import_ir_inst163: {ir_id: ir4, inst_id: inst532}
195+
// CHECK:STDOUT: import_ir_inst164: {ir_id: ir4, inst_id: inst510}
196+
// CHECK:STDOUT: import_ir_inst165: {ir_id: ir4, inst_id: inst511}
197+
// CHECK:STDOUT: import_ir_inst166: {ir_id: ir4, inst_id: inst512}
198+
// CHECK:STDOUT: import_ir_inst167: {ir_id: ir4, inst_id: inst513}
199+
// CHECK:STDOUT: import_ir_inst168: {ir_id: ir4, inst_id: inst514}
200+
// CHECK:STDOUT: import_ir_inst169: {ir_id: ir4, inst_id: inst515}
201+
// CHECK:STDOUT: import_ir_inst170: {ir_id: ir4, inst_id: inst516}
202+
// CHECK:STDOUT: import_ir_inst171: {ir_id: ir4, inst_id: inst520}
203+
// CHECK:STDOUT: import_ir_inst172: {ir_id: ir4, inst_id: inst537}
204+
// CHECK:STDOUT: import_ir_inst173: {ir_id: ir4, inst_id: inst544}
205+
// CHECK:STDOUT: import_ir_inst174: {ir_id: ir4, inst_id: inst548}
206+
// CHECK:STDOUT: import_ir_inst175: {ir_id: ir4, inst_id: inst550}
207+
// CHECK:STDOUT: import_ir_inst176: {ir_id: ir4, inst_id: inst551}
208+
// CHECK:STDOUT: import_ir_inst177: {ir_id: ir4, inst_id: inst554}
209+
// CHECK:STDOUT: import_ir_inst178: {ir_id: ir4, inst_id: inst564}
210+
// CHECK:STDOUT: import_ir_inst179: {ir_id: ir4, inst_id: inst568}
211+
// CHECK:STDOUT: import_ir_inst180: {ir_id: ir4, inst_id: inst570}
212+
// CHECK:STDOUT: import_ir_inst181: {ir_id: ir4, inst_id: inst571}
213+
// CHECK:STDOUT: import_ir_inst182: {ir_id: ir4, inst_id: inst574}
214+
// CHECK:STDOUT: import_ir_inst183: {ir_id: ir4, inst_id: inst586}
215+
// CHECK:STDOUT: import_ir_inst184: {ir_id: ir4, inst_id: inst591}
216+
// CHECK:STDOUT: import_ir_inst185: {ir_id: ir4, inst_id: inst595}
217+
// CHECK:STDOUT: import_ir_inst186: {ir_id: ir4, inst_id: inst596}
218+
// CHECK:STDOUT: import_ir_inst187: {ir_id: ir4, inst_id: inst601}
219219
// CHECK:STDOUT: clang_decls: {}
220220
// CHECK:STDOUT: name_scopes:
221221
// CHECK:STDOUT: name_scope0: {inst: inst14, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name(Core): inst16, name0: inst53}}

toolchain/check/testdata/facet/access.carbon

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,15 @@ fn G(AB:! A & B where .X = () and .Y = {}) -> AB.Y {
340340
// CHECK:STDOUT: !definition:
341341
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc9_18.1 [symbolic = %require_complete (constants.%require_complete)]
342342
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc9_8.1, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
343-
// CHECK:STDOUT: %.loc10_11.2: type = fn_type_with_self_type constants.%I.Copy.type, %T.loc9_8.1 [symbolic = %.loc10_11.2 (constants.%.6f7)]
344-
// CHECK:STDOUT: %impl.elem0.loc10_11.2: @Use.%.loc10_11.2 (%.6f7) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_11.2 (constants.%impl.elem0)]
343+
// CHECK:STDOUT: %.loc10_11: type = fn_type_with_self_type constants.%I.Copy.type, %T.loc9_8.1 [symbolic = %.loc10_11 (constants.%.6f7)]
344+
// CHECK:STDOUT: %impl.elem0.loc10_11.2: @Use.%.loc10_11 (%.6f7) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_11.2 (constants.%impl.elem0)]
345345
// CHECK:STDOUT: %specific_impl_fn.loc10_11.2: <specific function> = specific_impl_function %impl.elem0.loc10_11.2, @I.Copy(%T.loc9_8.1) [symbolic = %specific_impl_fn.loc10_11.2 (constants.%specific_impl_fn)]
346346
// CHECK:STDOUT:
347347
// CHECK:STDOUT: fn(%x.param: @Use.%T.as_type.loc9_18.1 (%T.as_type)) -> %return.param: @Use.%T.as_type.loc9_18.1 (%T.as_type) {
348348
// CHECK:STDOUT: !entry:
349349
// CHECK:STDOUT: %x.ref: @Use.%T.as_type.loc9_18.1 (%T.as_type) = name_ref x, %x
350350
// CHECK:STDOUT: %Copy.ref: %I.assoc_type = name_ref Copy, @I.%assoc0 [concrete = constants.%assoc0]
351-
// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type constants.%T [symbolic = %T.as_type.loc9_18.1 (constants.%T.as_type)]
352-
// CHECK:STDOUT: %.loc10_11.1: type = converted constants.%T, %T.as_type.loc10 [symbolic = %T.as_type.loc9_18.1 (constants.%T.as_type)]
353-
// CHECK:STDOUT: %impl.elem0.loc10_11.1: @Use.%.loc10_11.2 (%.6f7) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_11.2 (constants.%impl.elem0)]
351+
// CHECK:STDOUT: %impl.elem0.loc10_11.1: @Use.%.loc10_11 (%.6f7) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_11.2 (constants.%impl.elem0)]
354352
// CHECK:STDOUT: %bound_method.loc10_11: <bound method> = bound_method %x.ref, %impl.elem0.loc10_11.1
355353
// CHECK:STDOUT: %specific_impl_fn.loc10_11.1: <specific function> = specific_impl_function %impl.elem0.loc10_11.1, @I.Copy(constants.%T) [symbolic = %specific_impl_fn.loc10_11.2 (constants.%specific_impl_fn)]
356354
// CHECK:STDOUT: %bound_method.loc10_17: <bound method> = bound_method %x.ref, %specific_impl_fn.loc10_11.1
@@ -392,17 +390,15 @@ fn G(AB:! A & B where .X = () and .Y = {}) -> AB.Y {
392390
// CHECK:STDOUT: !definition:
393391
// CHECK:STDOUT: <elided>
394392
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc8_8.1, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
395-
// CHECK:STDOUT: %.loc10_4.2: type = fn_type_with_self_type constants.%I.Hello.type, %T.loc8_8.1 [symbolic = %.loc10_4.2 (constants.%.b73)]
396-
// CHECK:STDOUT: %impl.elem0.loc10_4.2: @Use.%.loc10_4.2 (%.b73) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0)]
393+
// CHECK:STDOUT: %.loc10_4: type = fn_type_with_self_type constants.%I.Hello.type, %T.loc8_8.1 [symbolic = %.loc10_4 (constants.%.b73)]
394+
// CHECK:STDOUT: %impl.elem0.loc10_4.2: @Use.%.loc10_4 (%.b73) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0)]
397395
// CHECK:STDOUT: %specific_impl_fn.loc10_4.2: <specific function> = specific_impl_function %impl.elem0.loc10_4.2, @I.Hello(%T.loc8_8.1) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn)]
398396
// CHECK:STDOUT:
399397
// CHECK:STDOUT: fn(%x.param: @Use.%T.as_type.loc8_18.1 (%T.as_type)) {
400398
// CHECK:STDOUT: !entry:
401399
// CHECK:STDOUT: %x.ref: @Use.%T.as_type.loc8_18.1 (%T.as_type) = name_ref x, %x
402400
// CHECK:STDOUT: %Hello.ref: %I.assoc_type = name_ref Hello, @I.%assoc0 [concrete = constants.%assoc0]
403-
// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type constants.%T [symbolic = %T.as_type.loc8_18.1 (constants.%T.as_type)]
404-
// CHECK:STDOUT: %.loc10_4.1: type = converted constants.%T, %T.as_type.loc10 [symbolic = %T.as_type.loc8_18.1 (constants.%T.as_type)]
405-
// CHECK:STDOUT: %impl.elem0.loc10_4.1: @Use.%.loc10_4.2 (%.b73) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0)]
401+
// CHECK:STDOUT: %impl.elem0.loc10_4.1: @Use.%.loc10_4 (%.b73) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0)]
406402
// CHECK:STDOUT: %specific_impl_fn.loc10_4.1: <specific function> = specific_impl_function %impl.elem0.loc10_4.1, @I.Hello(constants.%T) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn)]
407403
// CHECK:STDOUT: %.loc10_11: init %empty_tuple.type = call %specific_impl_fn.loc10_4.1()
408404
// CHECK:STDOUT: <elided>

0 commit comments

Comments
 (0)