Files
carbon-lang/toolchain/check/testdata/impl/import_self_specific.carbon
T
Geoff Romer d21cc3197f Fix the textual IR name of WrapperBindingPattern (#7650)
`at_binding_pattern` is a relic from an earlier revision of #6930.
2026-08-18 22:31:27 +00:00

811 lines
50 KiB
Plaintext

// 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/none.carbon
// EXTRA-ARGS: --dump-sem-ir-ranges=ignore
//
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_self_specific.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_self_specific.carbon
// --- impl_def.carbon
library "[[@TEST_NAME]]";
// The I.Assoc will be a facet of type Y.
interface Y {}
impl forall [T: type] T as Y {}
// C takes a facet of type Z.
interface Z {}
impl forall [U: type] U as Z {}
class C(V: Z) {
adapt ();
}
interface I {
let Assoc: Y;
// This is a generic function with a specific that contains a reference `Self`
// in it (in the ImplWitnessAccess for `Self.Assoc`). The `Self.Assoc` is
// converted from `Y` to `Z`, so it holds a FacetValue in the specific with a
// witness for impl lookup of `Self.Assoc as Z`. This `Self` gets imported
// when an `impl` implements it, and should not be introduced into that
// `impl`'s generic eval block.
fn F(c: C(Assoc));
}
// --- impl_use.carbon
library "[[@TEST_NAME]]";
import library "impl_def";
class E {}
class D(N: E) {}
// The eval block for this generic `impl` must not include any instructions
// derived from the import of `I.F`.
//
// This impl will import each entry in the interface `I`'s witness table. In
// particular, that includes `F` and the specific containing `Self.Assoc as Z`.
// When it does so, the eval block of `F` forms a new local eval block for the
// imported generic. And when the generic is evaluated against a newly
// constructed local self specific, any instructions created in the process of
// that evaluation (such as inside impl lookup deduction against the U in the
// impl for Z) should not be inappropriately added to this impl's generic eval
// block.
impl forall [N: E] D(N) as I where .Assoc = () {
fn F(unused c: C(())) {}
}
// CHECK:STDOUT: --- impl_def.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
// CHECK:STDOUT: %Self.765: %Y.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %.fdf: <witness> = impl_self_witness %T, @Y [symbolic]
// CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness @T.as.Y.impl.%Y.impl_witness_table, @T.as.Y.impl(%T) [symbolic]
// CHECK:STDOUT: %Y.facet: %Y.type = facet_value %T, (%Y.impl_witness) [symbolic]
// CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
// CHECK:STDOUT: %Self.cb6: %Z.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [symbolic]
// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic]
// CHECK:STDOUT: %.0ce: <witness> = impl_self_witness %U, @Z [symbolic]
// CHECK:STDOUT: %Z.impl_witness.bc3: <witness> = impl_witness @U.as.Z.impl.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic]
// CHECK:STDOUT: %Z.facet.6fa: %Z.type = facet_value %U, (%Z.impl_witness.bc3) [symbolic]
// CHECK:STDOUT: %pattern_type.5d7: type = pattern_type %Z.type [concrete]
// CHECK:STDOUT: %V.patt: %pattern_type.5d7 = symbolic_binding_pattern V, 0 [symbolic]
// CHECK:STDOUT: %V: %Z.type = symbolic_binding V, 0 [symbolic]
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
// CHECK:STDOUT: %C.bb9: type = class_type @C, @C(%V) [symbolic]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_tuple.type [concrete]
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
// CHECK:STDOUT: %Self.37e: %I.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%Assoc [concrete]
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self.37e, @I [symbolic]
// CHECK:STDOUT: %impl.elem0: %Y.type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic]
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0, @Z [symbolic]
// CHECK:STDOUT: %.516: <witness> = impl_self_witness %as_type, @Z [symbolic]
// CHECK:STDOUT: %Z.impl_witness.95f: <witness> = impl_witness @U.as.Z.impl.%Z.impl_witness_table, @U.as.Z.impl(%as_type) [symbolic]
// CHECK:STDOUT: %.5b1: require_specific_def_type = require_specific_def @U.as.Z.impl(%as_type) [symbolic]
// CHECK:STDOUT: %Z.facet.4d3: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic]
// CHECK:STDOUT: %C.e8d: type = class_type @C, @C(%Z.facet.4d3) [symbolic]
// CHECK:STDOUT: %pattern_type.ddf: type = pattern_type %C.e8d [symbolic]
// CHECK:STDOUT: %c.param_patt: %pattern_type.ddf = value_param_pattern [symbolic]
// CHECK:STDOUT: %c.patt: %pattern_type.ddf = wrapper_binding_pattern c, %c.param_patt [symbolic]
// CHECK:STDOUT: %I.WithSelf.F.type: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self.37e) [symbolic]
// CHECK:STDOUT: %I.WithSelf.F: %I.WithSelf.F.type = struct_value () [symbolic]
// CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.WithSelf.%I.WithSelf.F.decl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Y = %Y.decl
// CHECK:STDOUT: .Z = %Z.decl
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .I = %I.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Y.decl: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
// CHECK:STDOUT: impl_decl @T.as.Y.impl [concrete] {
// CHECK:STDOUT: %T.patt.loc5_15.1: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_15.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_15.1 [symbolic = %T.loc5_15.2 (constants.%T)]
// CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type]
// CHECK:STDOUT: %.loc5_17.1: type = splice_block %.loc5_17.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.loc5_17.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc5_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc5_15.2 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc5: <witness> = impl_self_witness @T.as.Y.impl.%T.ref, @Y [symbolic = @T.as.Y.impl.%.loc5_30 (constants.%.fdf)]
// CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
// CHECK:STDOUT: impl_decl @U.as.Z.impl [concrete] {
// CHECK:STDOUT: %U.patt.loc9_15.1: %pattern_type.98f = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_15.2 (constants.%U.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc9_15.1 [symbolic = %U.loc9_15.2 (constants.%U)]
// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
// CHECK:STDOUT: %.loc9_17.1: type = splice_block %.loc9_17.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.loc9_17.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %U.loc9_15.1: type = symbolic_binding U, 0 [symbolic = %U.loc9_15.2 (constants.%U)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc9: <witness> = impl_self_witness @U.as.Z.impl.%U.ref, @Z [symbolic = @U.as.Z.impl.%.loc9_30 (constants.%.0ce)]
// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
// CHECK:STDOUT: %V.patt.loc11_10.1: %pattern_type.5d7 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc11_10.2 (constants.%V.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc11: type = splice_block %Z.ref [concrete = constants.%Z.type] {
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %V.loc11_10.2: %Z.type = symbolic_binding V, 0 [symbolic = %V.loc11_10.1 (constants.%V)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Y {
// CHECK:STDOUT: %Self: %Y.type = symbolic_binding Self, 0 [symbolic = constants.%Self.765]
// CHECK:STDOUT: %Y.WithSelf.decl = interface_with_self_decl @Y [concrete]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
// CHECK:STDOUT: witness = ()
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Z {
// CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self.cb6]
// CHECK:STDOUT: %Z.WithSelf.decl = interface_with_self_decl @Z [concrete]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
// CHECK:STDOUT: witness = ()
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I {
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.37e]
// CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
// CHECK:STDOUT:
// CHECK:STDOUT: !with Self:
// CHECK:STDOUT: %Assoc: %Y.type = assoc_const_decl @Assoc [concrete] {
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%Assoc [concrete = constants.%assoc0]
// CHECK:STDOUT: }
// CHECK:STDOUT: %I.WithSelf.F.decl: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type) = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F)] {
// CHECK:STDOUT: %c.param_patt.loc24_9.1: @I.WithSelf.F.%pattern_type (%pattern_type.ddf) = value_param_pattern [symbolic = %c.param_patt.loc24_9.2 (constants.%c.param_patt)]
// CHECK:STDOUT: %c.patt.loc24_9.1: @I.WithSelf.F.%pattern_type (%pattern_type.ddf) = wrapper_binding_pattern c, %c.param_patt.loc24_9.1 [symbolic = %c.patt.loc24_9.2 (constants.%c.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %c.param: @I.WithSelf.F.%C.loc24_18.1 (%C.e8d) = value_param call_param0
// CHECK:STDOUT: %.loc24_18.2: type = splice_block %C.loc24_18.2 [symbolic = %C.loc24_18.1 (constants.%C.e8d)] {
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
// CHECK:STDOUT: %impl.elem0.loc24_13.2: %Y.type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_13.1 (constants.%impl.elem0)]
// CHECK:STDOUT: %Assoc.ref: %Y.type = name_ref Assoc, %impl.elem0.loc24_13.2 [symbolic = %impl.elem0.loc24_13.1 (constants.%impl.elem0)]
// CHECK:STDOUT: %Assoc.as_type: type = facet_access_type %Assoc.ref [symbolic = %as_type (constants.%as_type)]
// CHECK:STDOUT: %Z.facet.loc24_18.2: %Z.type = facet_value %Assoc.as_type, (constants.%Z.lookup_impl_witness) [symbolic = %Z.facet.loc24_18.1 (constants.%Z.facet.4d3)]
// CHECK:STDOUT: %.loc24_18.3: %Z.type = converted %Assoc.ref, %Z.facet.loc24_18.2 [symbolic = %Z.facet.loc24_18.1 (constants.%Z.facet.4d3)]
// CHECK:STDOUT: %C.loc24_18.2: type = class_type @C, @C(constants.%Z.facet.4d3) [symbolic = %C.loc24_18.1 (constants.%C.e8d)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %c: @I.WithSelf.F.%C.loc24_18.1 (%C.e8d) = wrapper_binding c, %c.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %I.WithSelf.F.decl [concrete = constants.%assoc1]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
// CHECK:STDOUT: .Y = <poisoned>
// CHECK:STDOUT: .C = <poisoned>
// CHECK:STDOUT: .Y = <poisoned>
// CHECK:STDOUT: .Assoc = @Assoc.%assoc0
// CHECK:STDOUT: .C = <poisoned>
// CHECK:STDOUT: .F = @I.WithSelf.%assoc1
// CHECK:STDOUT: witness = (@I.WithSelf.%Assoc, @I.WithSelf.%I.WithSelf.F.decl)
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @T.as.Y.impl(%T.loc5_15.1: type) {
// CHECK:STDOUT: %T.patt.loc5_15.2: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_15.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc5_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc5_15.2 (constants.%T)]
// CHECK:STDOUT: %.loc5_30: <witness> = impl_self_witness %T.loc5_15.2, @Y [symbolic = %.loc5_30 (constants.%.fdf)]
// CHECK:STDOUT: %Y.impl_witness.loc5_30.2: <witness> = impl_witness %Y.impl_witness_table, @T.as.Y.impl(%T.loc5_15.2) [symbolic = %Y.impl_witness.loc5_30.2 (constants.%Y.impl_witness)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: impl: %T.ref as %Y.ref {
// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @T.as.Y.impl [concrete]
// CHECK:STDOUT: %Y.impl_witness.loc5_30.1: <witness> = impl_witness %Y.impl_witness_table, @T.as.Y.impl(constants.%T) [symbolic = %Y.impl_witness.loc5_30.2 (constants.%Y.impl_witness)]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: extend %Y.ref
// CHECK:STDOUT: witness = %Y.impl_witness.loc5_30.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @U.as.Z.impl(%U.loc9_15.1: type) {
// CHECK:STDOUT: %U.patt.loc9_15.2: %pattern_type.98f = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_15.2 (constants.%U.patt)]
// CHECK:STDOUT: %U.loc9_15.2: type = symbolic_binding U, 0 [symbolic = %U.loc9_15.2 (constants.%U)]
// CHECK:STDOUT: %.loc9_30: <witness> = impl_self_witness %U.loc9_15.2, @Z [symbolic = %.loc9_30 (constants.%.0ce)]
// CHECK:STDOUT: %Z.impl_witness.loc9_30.2: <witness> = impl_witness %Z.impl_witness_table, @U.as.Z.impl(%U.loc9_15.2) [symbolic = %Z.impl_witness.loc9_30.2 (constants.%Z.impl_witness.bc3)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: impl: %U.ref as %Z.ref {
// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @U.as.Z.impl [concrete]
// CHECK:STDOUT: %Z.impl_witness.loc9_30.1: <witness> = impl_witness %Z.impl_witness_table, @U.as.Z.impl(constants.%U) [symbolic = %Z.impl_witness.loc9_30.2 (constants.%Z.impl_witness.bc3)]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: extend %Z.ref
// CHECK:STDOUT: witness = %Z.impl_witness.loc9_30.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(%V.loc11_10.2: %Z.type) {
// CHECK:STDOUT: %V.patt.loc11_10.2: %pattern_type.5d7 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc11_10.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.loc11_10.1: %Z.type = symbolic_binding V, 0 [symbolic = %V.loc11_10.1 (constants.%V)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: class {
// CHECK:STDOUT: %.loc12_10: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc12_11: type = converted %.loc12_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: adapt_decl %.loc12_11 [concrete]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_tuple.type [concrete = constants.%complete_type]
// CHECK:STDOUT: complete_type_witness = %complete_type
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%C.bb9
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @I.WithSelf.F(@I.%Self: %I.type) {
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.37e)]
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
// CHECK:STDOUT: %impl.elem0.loc24_13.1: %Y.type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_13.1 (constants.%impl.elem0)]
// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.loc24_13.1 [symbolic = %as_type (constants.%as_type)]
// CHECK:STDOUT: %.loc24_18.1: require_specific_def_type = require_specific_def @U.as.Z.impl(%as_type) [symbolic = %.loc24_18.1 (constants.%.5b1)]
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.loc24_13.1, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
// CHECK:STDOUT: %Z.facet.loc24_18.1: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc24_18.1 (constants.%Z.facet.4d3)]
// CHECK:STDOUT: %C.loc24_18.1: type = class_type @C, @C(%Z.facet.loc24_18.1) [symbolic = %C.loc24_18.1 (constants.%C.e8d)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc24_18.1 [symbolic = %pattern_type (constants.%pattern_type.ddf)]
// CHECK:STDOUT: %c.param_patt.loc24_9.2: @I.WithSelf.F.%pattern_type (%pattern_type.ddf) = value_param_pattern [symbolic = %c.param_patt.loc24_9.2 (constants.%c.param_patt)]
// CHECK:STDOUT: %c.patt.loc24_9.2: @I.WithSelf.F.%pattern_type (%pattern_type.ddf) = wrapper_binding_pattern c, %c.param_patt.loc24_9.2 [symbolic = %c.patt.loc24_9.2 (constants.%c.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%c.param: @I.WithSelf.F.%C.loc24_18.1 (%C.e8d));
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Y.WithSelf(constants.%Self.765) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @T.as.Y.impl(constants.%T) {
// CHECK:STDOUT: %T.patt.loc5_15.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc5_15.2 => constants.%T
// CHECK:STDOUT: %.loc5_30 => constants.%.fdf
// CHECK:STDOUT: %Y.impl_witness.loc5_30.2 => constants.%Y.impl_witness
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Y.WithSelf(constants.%Y.facet) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z.WithSelf(constants.%Self.cb6) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @U.as.Z.impl(constants.%U) {
// CHECK:STDOUT: %U.patt.loc9_15.2 => constants.%U.patt
// CHECK:STDOUT: %U.loc9_15.2 => constants.%U
// CHECK:STDOUT: %.loc9_30 => constants.%.0ce
// CHECK:STDOUT: %Z.impl_witness.loc9_30.2 => constants.%Z.impl_witness.bc3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z.WithSelf(constants.%Z.facet.6fa) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C(constants.%V) {
// CHECK:STDOUT: %V.patt.loc11_10.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc11_10.1 => constants.%V
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf(constants.%Self.37e) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @U.as.Z.impl(constants.%as_type) {
// CHECK:STDOUT: %U.patt.loc9_15.2 => constants.%U.patt
// CHECK:STDOUT: %U.loc9_15.2 => constants.%as_type
// CHECK:STDOUT: %.loc9_30 => constants.%.516
// CHECK:STDOUT: %Z.impl_witness.loc9_30.2 => constants.%Z.impl_witness.95f
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C(constants.%Z.facet.4d3) {
// CHECK:STDOUT: %V.patt.loc11_10.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc11_10.1 => constants.%Z.facet.4d3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self.37e) {
// CHECK:STDOUT: %Self => constants.%Self.37e
// CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness
// CHECK:STDOUT: %impl.elem0.loc24_13.1 => constants.%impl.elem0
// CHECK:STDOUT: %as_type => constants.%as_type
// CHECK:STDOUT: %.loc24_18.1 => constants.%.5b1
// CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness
// CHECK:STDOUT: %Z.facet.loc24_18.1 => constants.%Z.facet.4d3
// CHECK:STDOUT: %C.loc24_18.1 => constants.%C.e8d
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.ddf
// CHECK:STDOUT: %c.param_patt.loc24_9.2 => constants.%c.param_patt
// CHECK:STDOUT: %c.patt.loc24_9.2 => constants.%c.patt
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- impl_use.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %E: type = class_type @E [concrete]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.Self.frozen.197: %type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %pattern_type.849: type = pattern_type %E [concrete]
// CHECK:STDOUT: %N.patt: %pattern_type.849 = symbolic_binding_pattern N, 0 [symbolic]
// CHECK:STDOUT: %N: %E = symbolic_binding N, 0 [symbolic]
// CHECK:STDOUT: %D.type: type = generic_class_type @D [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %D.generic: %D.type = struct_value () [concrete]
// CHECK:STDOUT: %D: type = class_type @D, @D(%N) [symbolic]
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
// CHECK:STDOUT: %Self.dda: %I.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %I.WithSelf.F.type.418: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self.dda) [symbolic]
// CHECK:STDOUT: %I.WithSelf.F.ca5: %I.WithSelf.F.type.418 = struct_value () [symbolic]
// CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
// CHECK:STDOUT: %Self.013: %Z.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self.dda, @I [symbolic]
// CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
// CHECK:STDOUT: %Self.95b: %Y.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %impl.elem0.67e: %Y.type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0.67e, @Z [symbolic]
// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.67e [symbolic]
// CHECK:STDOUT: %Z.facet.416: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic]
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
// CHECK:STDOUT: %complete_type.782: <witness> = complete_type_witness %empty_tuple.type [concrete]
// CHECK:STDOUT: %V: %Z.type = symbolic_binding V, 0 [symbolic]
// CHECK:STDOUT: %pattern_type.5d7: type = pattern_type %Z.type [concrete]
// CHECK:STDOUT: %V.patt: %pattern_type.5d7 = symbolic_binding_pattern V, 0 [symbolic]
// CHECK:STDOUT: %C.526: type = class_type @C, @C(%Z.facet.416) [symbolic]
// CHECK:STDOUT: %pattern_type.d24: type = pattern_type %C.526 [symbolic]
// CHECK:STDOUT: %c.param_patt.6ae: %pattern_type.d24 = value_param_pattern [symbolic]
// CHECK:STDOUT: %c.patt.93c: %pattern_type.d24 = wrapper_binding_pattern c, %c.param_patt.6ae [symbolic]
// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic]
// CHECK:STDOUT: %.0ce: <witness> = impl_self_witness %U, @Z [symbolic]
// CHECK:STDOUT: %Z.impl_witness.d6c: <witness> = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic]
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
// CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [symbolic]
// CHECK:STDOUT: %.68b: require_specific_def_type = require_specific_def @U.as.Z.impl(%as_type) [symbolic]
// CHECK:STDOUT: %Z.impl_witness.65d: <witness> = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%as_type) [symbolic]
// CHECK:STDOUT: %.7e3: <witness> = impl_self_witness %as_type, @Z [symbolic]
// CHECK:STDOUT: %.Self.frozen.3a0: %I.type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %I.WithSelf.F.type.183: type = fn_type @I.WithSelf.F, @I.WithSelf(%.Self.frozen.3a0) [symbolic_self]
// CHECK:STDOUT: %I.WithSelf.F.b1e: %I.WithSelf.F.type.183 = struct_value () [symbolic_self]
// CHECK:STDOUT: %.Self.frozen.as_type: type = facet_access_type %.Self.frozen.3a0 [symbolic_self]
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.d73 [concrete]
// CHECK:STDOUT: %.f01: <witness> = impl_self_witness %.Self.frozen.3a0, @I [symbolic_self]
// CHECK:STDOUT: %impl.elem0.7a5: %Y.type = impl_witness_access %.f01, element0 [symbolic_self]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %.fdf: <witness> = impl_self_witness %T, @Y [symbolic]
// CHECK:STDOUT: %Y.impl_witness.383: <witness> = impl_witness imports.%Y.impl_witness_table, @T.as.Y.impl(%T) [symbolic]
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %.fa3: <witness> = impl_self_witness %empty_tuple.type, @Y [concrete]
// CHECK:STDOUT: %Y.impl_witness.91c: <witness> = impl_witness imports.%Y.impl_witness_table, @T.as.Y.impl(%empty_tuple.type) [concrete]
// CHECK:STDOUT: %Y.facet: %Y.type = facet_value %empty_tuple.type, (%Y.impl_witness.91c) [concrete]
// CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %.00f: <witness> = impl_self_witness %.Self, @I [symbolic_self]
// CHECK:STDOUT: %impl.elem0.e02: %Y.type = impl_witness_access %.00f, element0 [symbolic_self]
// CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0.e02 = %Y.facet> [concrete]
// CHECK:STDOUT: %.a26: <witness> = impl_self_witness %D, @I [symbolic]
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @D.as.I.impl.%I.impl_witness_table, @D.as.I.impl(%N) [symbolic]
// CHECK:STDOUT: %.78e: <witness> = impl_self_witness %empty_tuple.type, @Z [concrete]
// CHECK:STDOUT: %Z.impl_witness.9f1: <witness> = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%empty_tuple.type) [concrete]
// CHECK:STDOUT: %.dd0: require_specific_def_type = require_specific_def @U.as.Z.impl(%empty_tuple.type) [concrete]
// CHECK:STDOUT: %Z.facet.c6a: %Z.type = facet_value %empty_tuple.type, (%Z.impl_witness.9f1) [concrete]
// CHECK:STDOUT: %C.82a: type = class_type @C, @C(%Z.facet.c6a) [concrete]
// CHECK:STDOUT: %pattern_type.3b9: type = pattern_type %C.82a [concrete]
// CHECK:STDOUT: %c.param_patt.6af: %pattern_type.3b9 = value_param_pattern [concrete]
// CHECK:STDOUT: %c.patt.816: %pattern_type.3b9 = wrapper_binding_pattern c, %c.param_patt.6af [concrete]
// CHECK:STDOUT: %D.as.I.impl.F.type: type = fn_type @D.as.I.impl.F, @D.as.I.impl(%N) [symbolic]
// CHECK:STDOUT: %D.as.I.impl.F: %D.as.I.impl.F.type = struct_value () [symbolic]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %D, (%I.impl_witness) [symbolic]
// CHECK:STDOUT: %I.WithSelf.F.type.b73: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet) [symbolic]
// CHECK:STDOUT: %I.WithSelf.F.f74: %I.WithSelf.F.type.b73 = struct_value () [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Main.Y = import_ref Main//impl_def, Y, unloaded
// CHECK:STDOUT: %Main.Z = import_ref Main//impl_def, Z, unloaded
// CHECK:STDOUT: %Main.C: %C.type = import_ref Main//impl_def, C, loaded [concrete = constants.%C.generic]
// CHECK:STDOUT: %Main.I: type = import_ref Main//impl_def, I, loaded [concrete = constants.%I.type]
// CHECK:STDOUT: %Main.import_ref.f32: %I.assoc_type = import_ref Main//impl_def, loc16_12, loaded [concrete = constants.%assoc0]
// CHECK:STDOUT: %Main.import_ref.505 = import_ref Main//impl_def, loc24_20, unloaded
// CHECK:STDOUT: %Main.Assoc: %Y.type = import_ref Main//impl_def, Assoc, loaded [concrete = %Assoc]
// CHECK:STDOUT: %Main.F: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.418) = import_ref Main//impl_def, F, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.ca5)]
// CHECK:STDOUT: %Main.import_ref.e73 = import_ref Main//impl_def, loc8_13, unloaded
// CHECK:STDOUT: %Main.import_ref.28a = import_ref Main//impl_def, loc4_13, unloaded
// CHECK:STDOUT: %Main.import_ref.3fc: <witness> = import_ref Main//impl_def, loc13_1, loaded [concrete = constants.%complete_type.782]
// CHECK:STDOUT: %Main.import_ref.b5a = import_ref Main//impl_def, inst{{[0-9A-F]+}} [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.65b: %Z.type = import_ref Main//impl_def, loc11_10, loaded [symbolic = @C.%V (constants.%V)]
// CHECK:STDOUT: %Main.import_ref.3dd: <witness> = import_ref Main//impl_def, loc9_30, loaded [symbolic = @U.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.d6c)]
// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @U.as.Z.impl [concrete]
// CHECK:STDOUT: %Main.import_ref.b7a: type = import_ref Main//impl_def, loc9_23, loaded [symbolic = @U.as.Z.impl.%U (constants.%U)]
// CHECK:STDOUT: %Main.import_ref.fbe: type = import_ref Main//impl_def, loc9_28, loaded [concrete = constants.%Z.type]
// CHECK:STDOUT: %Main.import_ref.b3bc94.1: type = import_ref Main//impl_def, loc9_15, loaded [symbolic = @U.as.Z.impl.%U (constants.%U)]
// CHECK:STDOUT: %Main.import_ref.e59c42.2: %I.type = import_ref Main//impl_def, loc15_13, loaded [symbolic = constants.%Self.dda]
// CHECK:STDOUT: %Main.import_ref.223 = import_ref Main//impl_def, loc15_13, unloaded
// CHECK:STDOUT: %Main.import_ref.d73: %Y.type = import_ref Main//impl_def, loc16_12, loaded [concrete = %Assoc]
// CHECK:STDOUT: %Assoc: %Y.type = assoc_const_decl @Assoc [concrete] {}
// CHECK:STDOUT: %Main.import_ref.320: <witness> = import_ref Main//impl_def, loc5_30, loaded [symbolic = @T.as.Y.impl.%Y.impl_witness (constants.%Y.impl_witness.383)]
// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @T.as.Y.impl [concrete]
// CHECK:STDOUT: %Main.import_ref.68d: type = import_ref Main//impl_def, loc5_23, loaded [symbolic = @T.as.Y.impl.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.81e: type = import_ref Main//impl_def, loc5_28, loaded [concrete = constants.%Y.type]
// CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//impl_def, loc5_15, loaded [symbolic = @T.as.Y.impl.%T (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Y = imports.%Main.Y
// CHECK:STDOUT: .Z = imports.%Main.Z
// CHECK:STDOUT: .C = imports.%Main.C
// CHECK:STDOUT: .I = imports.%Main.I
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import = import <none>
// CHECK:STDOUT: %E.decl: type = class_decl @E [concrete = constants.%E] {} {}
// CHECK:STDOUT: %D.decl: %D.type = class_decl @D [concrete = constants.%D.generic] {
// CHECK:STDOUT: %N.patt.loc7_10.1: %pattern_type.849 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc7_10.2 (constants.%N.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc7: type = splice_block %E.ref [concrete = constants.%E] {
// CHECK:STDOUT: %.Self.frozen: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E]
// CHECK:STDOUT: }
// CHECK:STDOUT: %N.loc7_10.2: %E = symbolic_binding N, 0 [symbolic = %N.loc7_10.1 (constants.%N)]
// CHECK:STDOUT: }
// CHECK:STDOUT: impl_decl @D.as.I.impl [concrete] {
// CHECK:STDOUT: %N.patt.loc20_15.1: %pattern_type.849 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc20_15.2 (constants.%N.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [concrete = constants.%D.generic]
// CHECK:STDOUT: %N.ref: %E = name_ref N, %N.loc20_15.2 [symbolic = %N.loc20_15.1 (constants.%N)]
// CHECK:STDOUT: %D.loc20_23.2: type = class_type @D, @D(constants.%N) [symbolic = %D.loc20_23.1 (constants.%D)]
// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.frozen.loc20_30: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self.frozen.loc20_30 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc20_36: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %Assoc.ref: %I.assoc_type = name_ref Assoc, imports.%Main.import_ref.f32 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc20_36.1: %Y.type = impl_witness_access constants.%.f01, element0 [symbolic_self = constants.%impl.elem0.7a5]
// CHECK:STDOUT: %.loc20_46.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %Y.facet: %Y.type = facet_value constants.%empty_tuple.type, (constants.%Y.impl_witness.91c) [concrete = constants.%Y.facet]
// CHECK:STDOUT: %.loc20_46.2: %Y.type = converted %.loc20_46.1, %Y.facet [concrete = constants.%Y.facet]
// CHECK:STDOUT: %rewrite.loc20_43.1 = requirement_rewrite %impl.elem0.loc20_36.1, %.loc20_46.2 [concrete]
// CHECK:STDOUT: %impl.elem0.loc20_36.2: %Y.type = impl_witness_access constants.%.00f, element0 [symbolic_self = constants.%impl.elem0.e02]
// CHECK:STDOUT: %rewrite.loc20_43.2 = requirement_rewrite %impl.elem0.loc20_36.2, %.loc20_46.2 [concrete]
// CHECK:STDOUT: %.loc20_30: type = where_expr [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %rewrite.loc20_43.2 = requirement_rewrite %impl.elem0.loc20_36.2, %.loc20_46.2 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc20_17: type = splice_block %E.ref [concrete = constants.%E] {
// CHECK:STDOUT: %.Self.frozen.loc20_15: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E]
// CHECK:STDOUT: }
// CHECK:STDOUT: %N.loc20_15.2: %E = symbolic_binding N, 0 [symbolic = %N.loc20_15.1 (constants.%N)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc20: <witness> = impl_self_witness @D.as.I.impl.%D.loc20_23.2, @I [symbolic = @D.as.I.impl.%.loc20_48 (constants.%.a26)]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I [from "impl_def.carbon"] {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = imports.%Main.import_ref.223
// CHECK:STDOUT: .Assoc = imports.%Main.import_ref.f32
// CHECK:STDOUT: .F = imports.%Main.import_ref.505
// CHECK:STDOUT: .C = <poisoned>
// CHECK:STDOUT: witness = (imports.%Main.Assoc, imports.%Main.F)
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Z [from "impl_def.carbon"] {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = imports.%Main.import_ref.e73
// CHECK:STDOUT: witness = ()
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Y [from "impl_def.carbon"] {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = imports.%Main.import_ref.28a
// CHECK:STDOUT: witness = ()
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @U.as.Z.impl(imports.%Main.import_ref.b3bc94.1: type) [from "impl_def.carbon"] {
// CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [symbolic = %U.patt (constants.%U.patt)]
// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic = %U (constants.%U)]
// CHECK:STDOUT: %.1: <witness> = impl_self_witness %U, @Z [symbolic = %.1 (constants.%.0ce)]
// CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness imports.%Z.impl_witness_table, @U.as.Z.impl(%U) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.d6c)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: impl: imports.%Main.import_ref.b7a as imports.%Main.import_ref.fbe {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: witness = imports.%Main.import_ref.3dd
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @T.as.Y.impl(imports.%Main.import_ref.b3bc94.2: type) [from "impl_def.carbon"] {
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %.1: <witness> = impl_self_witness %T, @Y [symbolic = %.1 (constants.%.fdf)]
// CHECK:STDOUT: %Y.impl_witness: <witness> = impl_witness imports.%Y.impl_witness_table, @T.as.Y.impl(%T) [symbolic = %Y.impl_witness (constants.%Y.impl_witness.383)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: impl: imports.%Main.import_ref.68d as imports.%Main.import_ref.81e {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: witness = imports.%Main.import_ref.320
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic impl @D.as.I.impl(%N.loc20_15.2: %E) {
// CHECK:STDOUT: %N.patt.loc20_15.2: %pattern_type.849 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc20_15.2 (constants.%N.patt)]
// CHECK:STDOUT: %N.loc20_15.1: %E = symbolic_binding N, 0 [symbolic = %N.loc20_15.1 (constants.%N)]
// CHECK:STDOUT: %D.loc20_23.1: type = class_type @D, @D(%N.loc20_15.1) [symbolic = %D.loc20_23.1 (constants.%D)]
// CHECK:STDOUT: %.loc20_48: <witness> = impl_self_witness %D.loc20_23.1, @I [symbolic = %.loc20_48 (constants.%.a26)]
// CHECK:STDOUT: %I.impl_witness.loc20_48.2: <witness> = impl_witness %I.impl_witness_table, @D.as.I.impl(%N.loc20_15.1) [symbolic = %I.impl_witness.loc20_48.2 (constants.%I.impl_witness)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %D.as.I.impl.F.type: type = fn_type @D.as.I.impl.F, @D.as.I.impl(%N.loc20_15.1) [symbolic = %D.as.I.impl.F.type (constants.%D.as.I.impl.F.type)]
// CHECK:STDOUT: %D.as.I.impl.F: @D.as.I.impl.%D.as.I.impl.F.type (%D.as.I.impl.F.type) = struct_value () [symbolic = %D.as.I.impl.F (constants.%D.as.I.impl.F)]
// CHECK:STDOUT:
// CHECK:STDOUT: impl: %D.loc20_23.2 as %I.ref {
// CHECK:STDOUT: %D.as.I.impl.F.decl: @D.as.I.impl.%D.as.I.impl.F.type (%D.as.I.impl.F.type) = fn_decl @D.as.I.impl.F [symbolic = @D.as.I.impl.%D.as.I.impl.F (constants.%D.as.I.impl.F)] {
// CHECK:STDOUT: %c.param_patt: %pattern_type.3b9 = value_param_pattern [concrete = constants.%c.param_patt.6af]
// CHECK:STDOUT: %c.patt: %pattern_type.3b9 = wrapper_binding_pattern c, %c.param_patt [concrete = constants.%c.patt.816]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %c.param: %C.82a = value_param call_param0
// CHECK:STDOUT: %.loc21_22.1: type = splice_block %C [concrete = constants.%C.82a] {
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [concrete = constants.%C.generic]
// CHECK:STDOUT: %.loc21_21: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%empty_tuple.type, (constants.%Z.impl_witness.9f1) [concrete = constants.%Z.facet.c6a]
// CHECK:STDOUT: %.loc21_22.2: %Z.type = converted %.loc21_21, %Z.facet [concrete = constants.%Z.facet.c6a]
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%Z.facet.c6a) [concrete = constants.%C.82a]
// CHECK:STDOUT: }
// CHECK:STDOUT: %c: %C.82a = wrapper_binding c, %c.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %D.as.I.impl.F.decl), @D.as.I.impl [concrete]
// CHECK:STDOUT: %I.impl_witness.loc20_48.1: <witness> = impl_witness %I.impl_witness_table, @D.as.I.impl(constants.%N) [symbolic = %I.impl_witness.loc20_48.2 (constants.%I.impl_witness)]
// CHECK:STDOUT: %impl_witness_assoc_constant: %Y.type = impl_witness_assoc_constant constants.%Y.facet [concrete = constants.%Y.facet]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .C = <poisoned>
// CHECK:STDOUT: .F = %D.as.I.impl.F.decl
// CHECK:STDOUT: extend %I.ref
// CHECK:STDOUT: witness = %I.impl_witness.loc20_48.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @E {
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
// CHECK:STDOUT: complete_type_witness = %complete_type
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%E
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @D(%N.loc7_10.2: %E) {
// CHECK:STDOUT: %N.patt.loc7_10.2: %pattern_type.849 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc7_10.2 (constants.%N.patt)]
// CHECK:STDOUT: %N.loc7_10.1: %E = symbolic_binding N, 0 [symbolic = %N.loc7_10.1 (constants.%N)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: class {
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
// CHECK:STDOUT: complete_type_witness = %complete_type
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%D
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic class @C(imports.%Main.import_ref.65b: %Z.type) [from "impl_def.carbon"] {
// CHECK:STDOUT: %V.patt: %pattern_type.5d7 = symbolic_binding_pattern V, 0 [symbolic = %V.patt (constants.%V.patt)]
// CHECK:STDOUT: %V: %Z.type = symbolic_binding V, 0 [symbolic = %V (constants.%V)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: class {
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.3fc
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = imports.%Main.import_ref.b5a
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @I.WithSelf.F(imports.%Main.import_ref.e59c42.2: %I.type) [from "impl_def.carbon"] {
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.dda)]
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
// CHECK:STDOUT: %impl.elem0: %Y.type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0 (constants.%impl.elem0.67e)]
// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic = %as_type (constants.%as_type)]
// CHECK:STDOUT: %.1: require_specific_def_type = require_specific_def @U.as.Z.impl(%as_type) [symbolic = %.1 (constants.%.68b)]
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %impl.elem0, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %as_type, (%Z.lookup_impl_witness) [symbolic = %Z.facet (constants.%Z.facet.416)]
// CHECK:STDOUT: %C: type = class_type @C, @C(%Z.facet) [symbolic = %C (constants.%C.526)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %C [symbolic = %pattern_type (constants.%pattern_type.d24)]
// CHECK:STDOUT: %c.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type.d24) = value_param_pattern [symbolic = %c.param_patt (constants.%c.param_patt.6ae)]
// CHECK:STDOUT: %c.patt: @I.WithSelf.F.%pattern_type (%pattern_type.d24) = wrapper_binding_pattern c, %c.param_patt [symbolic = %c.patt (constants.%c.patt.93c)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @D.as.I.impl.F(@D.as.I.impl.%N.loc20_15.2: %E) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%c.param: %C.82a) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @D(constants.%N) {
// CHECK:STDOUT: %N.patt.loc7_10.2 => constants.%N.patt
// CHECK:STDOUT: %N.loc7_10.1 => constants.%N
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf(constants.%Self.dda) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Self => constants.%Self.dda
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.418
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.ca5
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z.WithSelf(constants.%Self.013) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Y.WithSelf(constants.%Self.95b) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C(constants.%V) {
// CHECK:STDOUT: %V.patt => constants.%V.patt
// CHECK:STDOUT: %V => constants.%V
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C(constants.%Z.facet.416) {
// CHECK:STDOUT: %V.patt => constants.%V.patt
// CHECK:STDOUT: %V => constants.%Z.facet.416
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @U.as.Z.impl(constants.%U) {
// CHECK:STDOUT: %U.patt => constants.%U.patt
// CHECK:STDOUT: %U => constants.%U
// CHECK:STDOUT: %.1 => constants.%.0ce
// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.d6c
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @U.as.Z.impl(constants.%as_type) {
// CHECK:STDOUT: %U.patt => constants.%U.patt
// CHECK:STDOUT: %U => constants.%as_type
// CHECK:STDOUT: %.1 => constants.%.7e3
// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.65d
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self.dda) {
// CHECK:STDOUT: %Self => constants.%Self.dda
// CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness
// CHECK:STDOUT: %impl.elem0 => constants.%impl.elem0.67e
// CHECK:STDOUT: %as_type => constants.%as_type
// CHECK:STDOUT: %.1 => constants.%.68b
// CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness
// CHECK:STDOUT: %Z.facet => constants.%Z.facet.416
// CHECK:STDOUT: %C => constants.%C.526
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.d24
// CHECK:STDOUT: %c.param_patt => constants.%c.param_patt.6ae
// CHECK:STDOUT: %c.patt => constants.%c.patt.93c
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf(constants.%.Self.frozen.3a0) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Self => constants.%.Self.frozen.3a0
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.183
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.b1e
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @T.as.Y.impl(constants.%T) {
// CHECK:STDOUT: %T.patt => constants.%T.patt
// CHECK:STDOUT: %T => constants.%T
// CHECK:STDOUT: %.1 => constants.%.fdf
// CHECK:STDOUT: %Y.impl_witness => constants.%Y.impl_witness.383
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @T.as.Y.impl(constants.%empty_tuple.type) {
// CHECK:STDOUT: %T.patt => constants.%T.patt
// CHECK:STDOUT: %T => constants.%empty_tuple.type
// CHECK:STDOUT: %.1 => constants.%.fa3
// CHECK:STDOUT: %Y.impl_witness => constants.%Y.impl_witness.91c
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @D.as.I.impl(constants.%N) {
// CHECK:STDOUT: %N.patt.loc20_15.2 => constants.%N.patt
// CHECK:STDOUT: %N.loc20_15.1 => constants.%N
// CHECK:STDOUT: %D.loc20_23.1 => constants.%D
// CHECK:STDOUT: %.loc20_48 => constants.%.a26
// CHECK:STDOUT: %I.impl_witness.loc20_48.2 => constants.%I.impl_witness
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %D.as.I.impl.F.type => constants.%D.as.I.impl.F.type
// CHECK:STDOUT: %D.as.I.impl.F => constants.%D.as.I.impl.F
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @U.as.Z.impl(constants.%empty_tuple.type) {
// CHECK:STDOUT: %U.patt => constants.%U.patt
// CHECK:STDOUT: %U => constants.%empty_tuple.type
// CHECK:STDOUT: %.1 => constants.%.78e
// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.9f1
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C(constants.%Z.facet.c6a) {
// CHECK:STDOUT: %V.patt => constants.%V.patt
// CHECK:STDOUT: %V => constants.%Z.facet.c6a
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @D.as.I.impl.F(constants.%N) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Self => constants.%I.facet
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.b73
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.f74
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) {
// CHECK:STDOUT: %Self => constants.%I.facet
// CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.impl_witness
// CHECK:STDOUT: %impl.elem0 => constants.%Y.facet
// CHECK:STDOUT: %as_type => constants.%empty_tuple.type
// CHECK:STDOUT: %.1 => constants.%.dd0
// CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.impl_witness.9f1
// CHECK:STDOUT: %Z.facet => constants.%Z.facet.c6a
// CHECK:STDOUT: %C => constants.%C.82a
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.3b9
// CHECK:STDOUT: %c.param_patt => constants.%c.param_patt.6af
// CHECK:STDOUT: %c.patt => constants.%c.patt.816
// CHECK:STDOUT: }
// CHECK:STDOUT: