// 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/convert.carbon // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". // EXTRA-ARGS: --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/generic.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/generic.carbon // --- deduced_type.carbon library "[[@TEST_NAME]]"; interface HasF { fn F[self: Self](); } impl forall [T:! type] T as HasF { fn F[self: Self]() {} } fn G(x: {}) { x.(HasF.F)(); } // --- deduced_type_subst.carbon library "[[@TEST_NAME]]"; interface HasF { fn F[self: Self]() -> Self; } impl forall [T:! type] T* as HasF { fn F[self: Self]() -> T* { return self; } } fn G(x: {}*) -> {}* { return x.(HasF.F)(); } // --- deduced_type_argument.carbon library "[[@TEST_NAME]]"; interface HasF { fn F[self: Self](); } class C(T:! type) {} impl forall [T:! type] C(T) as HasF { fn F[self: Self]() {} } fn G(x: C({})) { x.(HasF.F)(); } // --- deduced_interface_argument.carbon library "[[@TEST_NAME]]"; interface HasF(T:! type) { fn F[self: Self](); } impl forall [T:! type] {} as HasF(T) { fn F[self: Self]() {} } fn G(x: {}) { x.(HasF({}).F)(); } // --- fail_incomplete_deduction.carbon library "[[@TEST_NAME]]"; interface HasF { fn F[self: Self](); } // CHECK:STDERR: fail_incomplete_deduction.carbon:[[@LINE+4]]:13: error: `impl` with unused generic binding [ImplUnusedBinding] // CHECK:STDERR: impl forall [T:! type, U:! type] T as HasF { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: impl forall [T:! type, U:! type] T as HasF { fn F[self: Self]() {} } fn G(x: {}) { // CHECK:STDERR: fail_incomplete_deduction.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasF` in type `{}` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: x.(HasF.F)(); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: x.(HasF.F)(); } // --- fail_inconsistent_deduction.carbon library "[[@TEST_NAME]]"; interface HasF(T:! type) { fn F[self: Self](); } impl forall [T:! type] T as HasF(T) { fn F[self: Self]() {} } class A {} class B {} fn G(x: A) { // TODO: It'd be nice to include a note here saying that deduction failed because // we deduced two different values for `T`. // CHECK:STDERR: fail_inconsistent_deduction.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasF(B)` in type `A` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: x.(HasF(B).F)(); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: x.(HasF(B).F)(); } // CHECK:STDOUT: --- deduced_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete] // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type [symbolic] // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete] // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %HasF.impl_witness.ebd: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F.type.a16: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F.66e: %T.as.HasF.impl.F.type.a16 = struct_value () [symbolic] // CHECK:STDOUT: %HasF.facet.804: %HasF.type = facet_value %T, (%HasF.impl_witness.ebd) [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.impl_witness.401: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.HasF.impl.F.type.4de: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %T.as.HasF.impl.F.00f: %T.as.HasF.impl.F.type.4de = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.4bd: %HasF.type = facet_value %empty_struct_type, (%HasF.impl_witness.401) [concrete] // CHECK:STDOUT: %.adb: type = fn_type_with_self_type %HasF.F.type, %HasF.facet.4bd [concrete] // CHECK:STDOUT: %T.as.HasF.impl.F.specific_fn: = specific_function %T.as.HasF.impl.F.00f, @T.as.HasF.impl.F(%empty_struct_type) [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {} // CHECK:STDOUT: impl_decl @T.as.HasF.impl [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@T.as.HasF.impl.%T.as.HasF.impl.F.decl), @T.as.HasF.impl [concrete] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.ebd)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0 // CHECK:STDOUT: %.loc12_10.1: type = splice_block %.loc12_10.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc12_10.2: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc12_10.3: type = converted %.loc12_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] { // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %assoc0 // CHECK:STDOUT: witness = (%HasF.F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc8_14.2: type) { // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.ebd)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %T.as.HasF.impl.F.type (constants.%T.as.HasF.impl.F.type.a16)] // CHECK:STDOUT: %T.as.HasF.impl.F: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type.a16) = struct_value () [symbolic = %T.as.HasF.impl.F (constants.%T.as.HasF.impl.F.66e)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %HasF.ref { // CHECK:STDOUT: %T.as.HasF.impl.F.decl: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type.a16) = fn_decl @T.as.HasF.impl.F [symbolic = @T.as.HasF.impl.%T.as.HasF.impl.F (constants.%T.as.HasF.impl.F.66e)] { // CHECK:STDOUT: %self.patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T.as.HasF.impl.F.%T (%T) = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl // CHECK:STDOUT: witness = file.%HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc8_14.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @T.as.HasF.impl.F.%T (%T)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%x.param: %empty_struct_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.adb = impl_witness_access constants.%HasF.impl_witness.401, element0 [concrete = constants.%T.as.HasF.impl.F.00f] // CHECK:STDOUT: %bound_method.loc13_4: = bound_method %x.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @T.as.HasF.impl.F(constants.%empty_struct_type) [concrete = constants.%T.as.HasF.impl.F.specific_fn] // CHECK:STDOUT: %bound_method.loc13_14: = bound_method %x.ref, %specific_fn // CHECK:STDOUT: %T.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method.loc13_14(%x.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%T // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.ebd // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type.a16 // CHECK:STDOUT: %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F.66e // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%HasF.facet.804) { // CHECK:STDOUT: %Self => constants.%HasF.facet.804 // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.401 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type.4de // CHECK:STDOUT: %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F.00f // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl.F(constants.%empty_struct_type) { // CHECK:STDOUT: %T => constants.%empty_struct_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a96 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduced_type_subst.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete] // CHECK:STDOUT: %Self.cb9: %HasF.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Self.as_type.45c: type = facet_access_type %Self.cb9 [symbolic] // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type.45c [symbolic] // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete] // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete] // CHECK:STDOUT: %assoc0.97a: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %ptr.79f: type = ptr_type %T.8b3 [symbolic] // CHECK:STDOUT: %HasF.impl_witness.0e0: = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%T.8b3) [symbolic] // CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr.79f [symbolic] // CHECK:STDOUT: %ptr.as.HasF.impl.F.type.aaa: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%T.8b3) [symbolic] // CHECK:STDOUT: %ptr.as.HasF.impl.F.b35: %ptr.as.HasF.impl.F.type.aaa = struct_value () [symbolic] // CHECK:STDOUT: %HasF.facet.040: %HasF.type = facet_value %ptr.79f, (%HasF.impl_witness.0e0) [symbolic] // CHECK:STDOUT: %require_complete.6e5: = require_complete_type %ptr.79f [symbolic] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.31f: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.8a8: %ptr.as.Copy.impl.Op.type.31f = struct_value () [symbolic] // CHECK:STDOUT: %Copy.lookup_impl_witness.cb2: = lookup_impl_witness %ptr.79f, @Copy [symbolic] // CHECK:STDOUT: %Copy.facet.2d1: %Copy.type = facet_value %ptr.79f, (%Copy.lookup_impl_witness.cb2) [symbolic] // CHECK:STDOUT: %.1cc: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.2d1 [symbolic] // CHECK:STDOUT: %impl.elem0.751: %.1cc = impl_witness_access %Copy.lookup_impl_witness.cb2, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.f44: = specific_impl_function %impl.elem0.751, @Copy.Op(%Copy.facet.2d1) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.1cc: type = pattern_type %ptr.c28 [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.impl_witness.589: = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.HasF.impl.F.type.fcd: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.HasF.impl.F.407: %ptr.as.HasF.impl.F.type.fcd = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.157: %HasF.type = facet_value %ptr.c28, (%HasF.impl_witness.589) [concrete] // CHECK:STDOUT: %.2b4: type = fn_type_with_self_type %HasF.F.type, %HasF.facet.157 [concrete] // CHECK:STDOUT: %ptr.as.HasF.impl.F.specific_fn: = specific_function %ptr.as.HasF.impl.F.407, @ptr.as.HasF.impl.F(%empty_struct_type) [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %ptr.c28 [concrete] // CHECK:STDOUT: %Copy.impl_witness.d27: = impl_witness imports.%Copy.impl_witness_table.53c, @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.800: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.e07: %ptr.as.Copy.impl.Op.type.800 = struct_value () [concrete] // CHECK:STDOUT: %Copy.facet.0b7: %Copy.type = facet_value %ptr.c28, (%Copy.impl_witness.d27) [concrete] // CHECK:STDOUT: %.edf: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.0b7 [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.e07, @ptr.as.Copy.impl.Op(%empty_struct_type) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Copy = %Core.Copy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.0e4: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.31f) = import_ref Core//prelude/parts/copy, loc36_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.8a8)] // CHECK:STDOUT: %Copy.impl_witness_table.53c = impl_witness_table (%Core.import_ref.0e4), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {} // CHECK:STDOUT: impl_decl @ptr.as.HasF.impl [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T.8b3)] // CHECK:STDOUT: %ptr.loc8_25.2: type = ptr_type %T.ref [symbolic = %ptr.loc8_25.1 (constants.%ptr.79f)] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T.8b3)] // CHECK:STDOUT: } // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@ptr.as.HasF.impl.%ptr.as.HasF.impl.F.decl), @ptr.as.HasF.impl [concrete] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @ptr.as.HasF.impl(constants.%T.8b3) [symbolic = @ptr.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.0e0)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.1cc = binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.1cc = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: %return.patt: %pattern_type.1cc = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.1cc = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_18: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc12_19: type = converted %.loc12_18, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %ptr.loc12_19: type = ptr_type %.loc12_19 [concrete = constants.%ptr.c28] // CHECK:STDOUT: %x.param: %ptr.c28 = value_param call_param0 // CHECK:STDOUT: %.loc12_11.1: type = splice_block %ptr.loc12_11 [concrete = constants.%ptr.c28] { // CHECK:STDOUT: %.loc12_10: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %ptr.loc12_11: type = ptr_type %.loc12_11.2 [concrete = constants.%ptr.c28] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %ptr.c28 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %ptr.c28 = out_param call_param1 // CHECK:STDOUT: %return: ref %ptr.c28 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.cb9] // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] { // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %return.patt: @HasF.F.%pattern_type (%pattern_type.85b) = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref.loc5_25: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.cb9)] // CHECK:STDOUT: %Self.as_type.loc5_25: type = facet_access_type %Self.ref.loc5_25 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] // CHECK:STDOUT: %.loc5_25: type = converted %Self.ref.loc5_25, %Self.as_type.loc5_25 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = value_param call_param0 // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] { // CHECK:STDOUT: %Self.ref.loc5_14: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.cb9)] // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref.loc5_14 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref.loc5_14, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = out_param call_param1 // CHECK:STDOUT: %return: ref @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0.97a] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %assoc0 // CHECK:STDOUT: witness = (%HasF.F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @ptr.as.HasF.impl(%T.loc8_14.2: type) { // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T.8b3)] // CHECK:STDOUT: %ptr.loc8_25.1: type = ptr_type %T.loc8_14.1 [symbolic = %ptr.loc8_25.1 (constants.%ptr.79f)] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @ptr.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.0e0)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr.as.HasF.impl.F.type: type = fn_type @ptr.as.HasF.impl.F, @ptr.as.HasF.impl(%T.loc8_14.1) [symbolic = %ptr.as.HasF.impl.F.type (constants.%ptr.as.HasF.impl.F.type.aaa)] // CHECK:STDOUT: %ptr.as.HasF.impl.F: @ptr.as.HasF.impl.%ptr.as.HasF.impl.F.type (%ptr.as.HasF.impl.F.type.aaa) = struct_value () [symbolic = %ptr.as.HasF.impl.F (constants.%ptr.as.HasF.impl.F.b35)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %ptr.loc8_25.2 as %HasF.ref { // CHECK:STDOUT: %ptr.as.HasF.impl.F.decl: @ptr.as.HasF.impl.%ptr.as.HasF.impl.F.type (%ptr.as.HasF.impl.F.type.aaa) = fn_decl @ptr.as.HasF.impl.F [symbolic = @ptr.as.HasF.impl.%ptr.as.HasF.impl.F (constants.%ptr.as.HasF.impl.F.b35)] { // CHECK:STDOUT: %self.patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.afe) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.afe) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %return.patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.afe) = return_slot_pattern [concrete] // CHECK:STDOUT: %return.param_patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.afe) = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @ptr.as.HasF.impl.%T.loc8_14.2 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %ptr.loc9_26: type = ptr_type %T.ref [symbolic = %ptr.loc9_14 (constants.%ptr.79f)] // CHECK:STDOUT: %self.param: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @ptr.as.HasF.impl.%ptr.loc8_25.2 [symbolic = %ptr.loc9_14 (constants.%ptr.79f)] // CHECK:STDOUT: %self: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = out_param call_param1 // CHECK:STDOUT: %return: ref @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .T = // CHECK:STDOUT: .F = %ptr.as.HasF.impl.F.decl // CHECK:STDOUT: witness = file.%HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cb9)] // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c)) -> @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ptr.as.HasF.impl.F(@ptr.as.HasF.impl.%T.loc8_14.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %ptr.loc9_14: type = ptr_type %T [symbolic = %ptr.loc9_14 (constants.%ptr.79f)] // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_14 [symbolic = %pattern_type (constants.%pattern_type.afe)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %ptr.loc9_14 [symbolic = %require_complete (constants.%require_complete.6e5)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc9_14, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cb2)] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc9_14, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.2d1)] // CHECK:STDOUT: %.loc9_37.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc9_37.2 (constants.%.1cc)] // CHECK:STDOUT: %impl.elem0.loc9_37.2: @ptr.as.HasF.impl.F.%.loc9_37.2 (%.1cc) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.751)] // CHECK:STDOUT: %specific_impl_fn.loc9_37.2: = specific_impl_function %impl.elem0.loc9_37.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_37.2 (constants.%specific_impl_fn.f44)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f)) -> @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = name_ref self, %self // CHECK:STDOUT: %impl.elem0.loc9_37.1: @ptr.as.HasF.impl.F.%.loc9_37.2 (%.1cc) = impl_witness_access constants.%Copy.lookup_impl_witness.cb2, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.751)] // CHECK:STDOUT: %bound_method.loc9_37.1: = bound_method %self.ref, %impl.elem0.loc9_37.1 // CHECK:STDOUT: %specific_impl_fn.loc9_37.1: = specific_impl_function %impl.elem0.loc9_37.1, @Copy.Op(constants.%Copy.facet.2d1) [symbolic = %specific_impl_fn.loc9_37.2 (constants.%specific_impl_fn.f44)] // CHECK:STDOUT: %bound_method.loc9_37.2: = bound_method %self.ref, %specific_impl_fn.loc9_37.1 // CHECK:STDOUT: %.loc9_37.1: init @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.79f) = call %bound_method.loc9_37.2(%self.ref) // CHECK:STDOUT: return %.loc9_37.1 to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%x.param: %ptr.c28) -> %ptr.c28 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %ptr.c28 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0.97a] // CHECK:STDOUT: %impl.elem0: %.2b4 = impl_witness_access constants.%HasF.impl_witness.589, element0 [concrete = constants.%ptr.as.HasF.impl.F.407] // CHECK:STDOUT: %bound_method.loc13_11: = bound_method %x.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @ptr.as.HasF.impl.F(constants.%empty_struct_type) [concrete = constants.%ptr.as.HasF.impl.F.specific_fn] // CHECK:STDOUT: %bound_method.loc13_21: = bound_method %x.ref, %specific_fn // CHECK:STDOUT: %ptr.as.HasF.impl.F.call: init %ptr.c28 = call %bound_method.loc13_21(%x.ref) // CHECK:STDOUT: return %ptr.as.HasF.impl.F.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%Self.cb9) { // CHECK:STDOUT: %Self => constants.%Self.cb9 // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.45c // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ptr.as.HasF.impl(constants.%T.8b3) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%T.8b3 // CHECK:STDOUT: %ptr.loc8_25.1 => constants.%ptr.79f // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.0e0 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr.as.HasF.impl.F.type => constants.%ptr.as.HasF.impl.F.type.aaa // CHECK:STDOUT: %ptr.as.HasF.impl.F => constants.%ptr.as.HasF.impl.F.b35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ptr.as.HasF.impl.F(constants.%T.8b3) { // CHECK:STDOUT: %T => constants.%T.8b3 // CHECK:STDOUT: %ptr.loc9_14 => constants.%ptr.79f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%HasF.facet.040) { // CHECK:STDOUT: %Self => constants.%HasF.facet.040 // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%ptr.79f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ptr.as.HasF.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %ptr.loc8_25.1 => constants.%ptr.c28 // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.589 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr.as.HasF.impl.F.type => constants.%ptr.as.HasF.impl.F.type.fcd // CHECK:STDOUT: %ptr.as.HasF.impl.F => constants.%ptr.as.HasF.impl.F.407 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ptr.as.HasF.impl.F(constants.%empty_struct_type) { // CHECK:STDOUT: %T => constants.%empty_struct_type // CHECK:STDOUT: %ptr.loc9_14 => constants.%ptr.c28 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1cc // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.d27 // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.0b7 // CHECK:STDOUT: %.loc9_37.2 => constants.%.edf // CHECK:STDOUT: %impl.elem0.loc9_37.2 => constants.%ptr.as.Copy.impl.Op.e07 // CHECK:STDOUT: %specific_impl_fn.loc9_37.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduced_type_argument.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete] // CHECK:STDOUT: %Self.cb9: %HasF.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Self.as_type.45c: type = facet_access_type %Self.cb9 [symbolic] // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type.45c [symbolic] // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete] // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete] // CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete] // CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic] // CHECK:STDOUT: %ptr.7d2: type = ptr_type %C.f2e [symbolic] // CHECK:STDOUT: %pattern_type.1d2: type = pattern_type %ptr.7d2 [symbolic] // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic] // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %HasF.impl_witness.e3c: = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %pattern_type.e5e: type = pattern_type %C.f2e [symbolic] // CHECK:STDOUT: %C.as.HasF.impl.F.type.3fd: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %C.as.HasF.impl.F.e8c: %C.as.HasF.impl.F.type.3fd = struct_value () [symbolic] // CHECK:STDOUT: %HasF.facet.469: %HasF.type = facet_value %C.f2e, (%HasF.impl_witness.e3c) [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %C.f2e [symbolic] // CHECK:STDOUT: %C.7a7: type = class_type @C, @C(%empty_struct_type) [concrete] // CHECK:STDOUT: %pattern_type.99a: type = pattern_type %C.7a7 [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.impl_witness.148: = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.type.6e7: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.410: %C.as.HasF.impl.F.type.6e7 = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.6ff: %HasF.type = facet_value %C.7a7, (%HasF.impl_witness.148) [concrete] // CHECK:STDOUT: %.b29: type = fn_type_with_self_type %HasF.F.type, %HasF.facet.6ff [concrete] // CHECK:STDOUT: %C.as.HasF.impl.F.specific_fn: = specific_function %C.as.HasF.impl.F.410, @C.as.HasF.impl.F(%empty_struct_type) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {} // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @C.as.HasF.impl [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10_14.2 [symbolic = %T.loc10_14.1 (constants.%T)] // CHECK:STDOUT: %C.loc10_27.2: type = class_type @C, @C(constants.%T) [symbolic = %C.loc10_27.1 (constants.%C.f2e)] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc10_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@C.as.HasF.impl.%C.as.HasF.impl.F.decl), @C.as.HasF.impl [concrete] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @C.as.HasF.impl(constants.%T) [symbolic = @C.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.e3c)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.99a = binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.99a = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %C.7a7 = value_param call_param0 // CHECK:STDOUT: %.loc14_13.1: type = splice_block %C [concrete = constants.%C.7a7] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic] // CHECK:STDOUT: %.loc14_12: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc14_13.2: type = converted %.loc14_12, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_struct_type) [concrete = constants.%C.7a7] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %C.7a7 = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.cb9] // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] { // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = value_param call_param0 // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] { // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.cb9)] // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %assoc0 // CHECK:STDOUT: witness = (%HasF.F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @C.as.Destroy.impl(@C.%T.loc8_9.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness @C.%Destroy.impl_witness_table, @C.as.Destroy.impl(%T) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op, @C.as.Destroy.impl(%T) [symbolic = %C.as.Destroy.impl.Op.type (constants.%C.as.Destroy.impl.Op.type)] // CHECK:STDOUT: %C.as.Destroy.impl.Op: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = struct_value () [symbolic = %C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)] // CHECK:STDOUT: // CHECK:STDOUT: impl: @C.%Self.ref as constants.%Destroy.type { // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: @C.as.Destroy.impl.%C.as.Destroy.impl.Op.type (%C.as.Destroy.impl.Op.type) = fn_decl @C.as.Destroy.impl.Op [symbolic = @C.as.Destroy.impl.%C.as.Destroy.impl.Op (constants.%C.as.Destroy.impl.Op)] { // CHECK:STDOUT: %self.patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.1d2) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @C.as.Destroy.impl.Op.%pattern_type (%pattern_type.1d2) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %.loc8_19.1: %pattern_type.f6d = addr_pattern %self.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2) = value_param call_param0 // CHECK:STDOUT: %.loc8_19.2: type = splice_block %Self.ref [symbolic = %C (constants.%C.f2e)] { // CHECK:STDOUT: %.loc8_19.3: type = specific_constant constants.%C.f2e, @C(constants.%T) [symbolic = %C (constants.%C.f2e)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc8_19.3 [symbolic = %C (constants.%C.f2e)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl // CHECK:STDOUT: witness = @C.%Destroy.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @C.as.HasF.impl(%T.loc10_14.2: type) { // CHECK:STDOUT: %T.loc10_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.1 (constants.%T)] // CHECK:STDOUT: %C.loc10_27.1: type = class_type @C, @C(%T.loc10_14.1) [symbolic = %C.loc10_27.1 (constants.%C.f2e)] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @C.as.HasF.impl(%T.loc10_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.e3c)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.HasF.impl.F.type: type = fn_type @C.as.HasF.impl.F, @C.as.HasF.impl(%T.loc10_14.1) [symbolic = %C.as.HasF.impl.F.type (constants.%C.as.HasF.impl.F.type.3fd)] // CHECK:STDOUT: %C.as.HasF.impl.F: @C.as.HasF.impl.%C.as.HasF.impl.F.type (%C.as.HasF.impl.F.type.3fd) = struct_value () [symbolic = %C.as.HasF.impl.F (constants.%C.as.HasF.impl.F.e8c)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %C.loc10_27.2 as %HasF.ref { // CHECK:STDOUT: %C.as.HasF.impl.F.decl: @C.as.HasF.impl.%C.as.HasF.impl.F.type (%C.as.HasF.impl.F.type.3fd) = fn_decl @C.as.HasF.impl.F [symbolic = @C.as.HasF.impl.%C.as.HasF.impl.F (constants.%C.as.HasF.impl.F.e8c)] { // CHECK:STDOUT: %self.patt: @C.as.HasF.impl.F.%pattern_type (%pattern_type.e5e) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @C.as.HasF.impl.F.%pattern_type (%pattern_type.e5e) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @C.as.HasF.impl.F.%C (%C.f2e) = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.HasF.impl.%C.loc10_27.2 [symbolic = %C (constants.%C.f2e)] // CHECK:STDOUT: %self: @C.as.HasF.impl.F.%C (%C.f2e) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %C.as.HasF.impl.F.decl // CHECK:STDOUT: witness = file.%HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%T.loc8_9.2: type) { // CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C.f2e [symbolic = @C.as.Destroy.impl.%C (constants.%C.f2e)] // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {} // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table, @C.as.Destroy.impl(constants.%T) [symbolic = @C.as.Destroy.impl.%Destroy.impl_witness (constants.%Destroy.impl_witness)] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.f2e // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cb9)] // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.45c)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.45c)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @C.as.Destroy.impl.Op(@C.%T.loc8_9.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)] // CHECK:STDOUT: %ptr: type = ptr_type %C [symbolic = %ptr (constants.%ptr.7d2)] // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [symbolic = %pattern_type (constants.%pattern_type.1d2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @C.as.Destroy.impl.Op.%ptr (%ptr.7d2)) = "no_op"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @C.as.HasF.impl.F(@C.as.HasF.impl.%T.loc10_14.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.f2e)] // CHECK:STDOUT: %pattern_type: type = pattern_type %C [symbolic = %pattern_type (constants.%pattern_type.e5e)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @C.as.HasF.impl.F.%C (%C.f2e)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%x.param: %C.7a7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %C.7a7 = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.b29 = impl_witness_access constants.%HasF.impl_witness.148, element0 [concrete = constants.%C.as.HasF.impl.F.410] // CHECK:STDOUT: %bound_method.loc15_4: = bound_method %x.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @C.as.HasF.impl.F(constants.%empty_struct_type) [concrete = constants.%C.as.HasF.impl.F.specific_fn] // CHECK:STDOUT: %bound_method.loc15_14: = bound_method %x.ref, %specific_fn // CHECK:STDOUT: %C.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method.loc15_14(%x.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%Self.cb9) { // CHECK:STDOUT: %Self => constants.%Self.cb9 // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.45c // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { // CHECK:STDOUT: %T.loc8_9.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.Destroy.impl(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %C => constants.%C.f2e // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.Destroy.impl.Op(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %C => constants.%C.f2e // CHECK:STDOUT: %ptr => constants.%ptr.7d2 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1d2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.HasF.impl(constants.%T) { // CHECK:STDOUT: %T.loc10_14.1 => constants.%T // CHECK:STDOUT: %C.loc10_27.1 => constants.%C.f2e // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.e3c // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.HasF.impl.F.type => constants.%C.as.HasF.impl.F.type.3fd // CHECK:STDOUT: %C.as.HasF.impl.F => constants.%C.as.HasF.impl.F.e8c // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.HasF.impl.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %C => constants.%C.f2e // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e5e // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%HasF.facet.469) { // CHECK:STDOUT: %Self => constants.%HasF.facet.469 // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%C.f2e // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e5e // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_9.1 => constants.%empty_struct_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.HasF.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc10_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %C.loc10_27.1 => constants.%C.7a7 // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.148 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.as.HasF.impl.F.type => constants.%C.as.HasF.impl.F.type.6e7 // CHECK:STDOUT: %C.as.HasF.impl.F => constants.%C.as.HasF.impl.F.410 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.HasF.impl.F(constants.%empty_struct_type) { // CHECK:STDOUT: %T => constants.%empty_struct_type // CHECK:STDOUT: %C => constants.%C.7a7 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.99a // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduced_interface_argument.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %HasF.type.fe3: type = generic_interface_type @HasF [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HasF.generic: %HasF.type.fe3 = struct_value () [concrete] // CHECK:STDOUT: %HasF.type.9f4: type = facet_type <@HasF, @HasF(%T)> [symbolic] // CHECK:STDOUT: %Self.0b6: %HasF.type.9f4 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.0b6 [symbolic] // CHECK:STDOUT: %pattern_type.f60: type = pattern_type %Self.as_type [symbolic] // CHECK:STDOUT: %HasF.F.type.46c: type = fn_type @HasF.F, @HasF(%T) [symbolic] // CHECK:STDOUT: %HasF.F.823: %HasF.F.type.46c = struct_value () [symbolic] // CHECK:STDOUT: %HasF.assoc_type.dd8: type = assoc_entity_type @HasF, @HasF(%T) [symbolic] // CHECK:STDOUT: %assoc0.d31: %HasF.assoc_type.dd8 = assoc_entity element0, @HasF.%HasF.F.decl [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.9f4 [symbolic] // CHECK:STDOUT: %HasF.impl_witness.b0b: = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type.364: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.6bf: %empty_struct_type.as.HasF.impl.F.type.364 = struct_value () [symbolic] // CHECK:STDOUT: %HasF.facet.e17: %HasF.type.9f4 = facet_value %empty_struct_type, (%HasF.impl_witness.b0b) [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.type.48b: type = facet_type <@HasF, @HasF(%empty_struct_type)> [concrete] // CHECK:STDOUT: %Self.f65: %HasF.type.48b = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %HasF.F.type.b0b: type = fn_type @HasF.F, @HasF(%empty_struct_type) [concrete] // CHECK:STDOUT: %HasF.F.418: %HasF.F.type.b0b = struct_value () [concrete] // CHECK:STDOUT: %HasF.assoc_type.9e4: type = assoc_entity_type @HasF, @HasF(%empty_struct_type) [concrete] // CHECK:STDOUT: %assoc0.f76: %HasF.assoc_type.9e4 = assoc_entity element0, @HasF.%HasF.F.decl [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %HasF.type.48b [concrete] // CHECK:STDOUT: %HasF.impl_witness.430: = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type.9bd: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%empty_struct_type) [concrete] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.8ab: %empty_struct_type.as.HasF.impl.F.type.9bd = struct_value () [concrete] // CHECK:STDOUT: %HasF.facet.b88: %HasF.type.48b = facet_value %empty_struct_type, (%HasF.impl_witness.430) [concrete] // CHECK:STDOUT: %.0b8: type = fn_type_with_self_type %HasF.F.type.b0b, %HasF.facet.b88 [concrete] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.specific_fn: = specific_function %empty_struct_type.as.HasF.impl.F.8ab, @empty_struct_type.as.HasF.impl.F(%empty_struct_type) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: %HasF.type.fe3 = interface_decl @HasF [concrete = constants.%HasF.generic] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @empty_struct_type.as.HasF.impl [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc8_25.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc8_25.2: type = converted %.loc8_25.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic] // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.type.loc8_36.2: type = facet_type <@HasF, @HasF(constants.%T)> [symbolic = %HasF.type.loc8_36.1 (constants.%HasF.type.9f4)] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F.decl), @empty_struct_type.as.HasF.impl [concrete] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(constants.%T) [symbolic = @empty_struct_type.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness.b0b)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0 // CHECK:STDOUT: %.loc12_10.1: type = splice_block %.loc12_10.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc12_10.2: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc12_10.3: type = converted %.loc12_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.2: type) { // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T.loc4_16.1)> [symbolic = %HasF.type (constants.%HasF.type.9f4)] // CHECK:STDOUT: %Self.2: @HasF.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0b6)] // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F, @HasF(%T.loc4_16.1) [symbolic = %HasF.F.type (constants.%HasF.F.type.46c)] // CHECK:STDOUT: %HasF.F: @HasF.%HasF.F.type (%HasF.F.type.46c) = struct_value () [symbolic = %HasF.F (constants.%HasF.F.823)] // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF, @HasF(%T.loc4_16.1) [symbolic = %HasF.assoc_type (constants.%HasF.assoc_type.dd8)] // CHECK:STDOUT: %assoc0.loc5_21.2: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.d31)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @HasF.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0b6)] // CHECK:STDOUT: %HasF.F.decl: @HasF.%HasF.F.type (%HasF.F.type.46c) = fn_decl @HasF.F [symbolic = @HasF.%HasF.F (constants.%HasF.F.823)] { // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.f60) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.f60) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.3 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %.loc5_14.2: @HasF.F.%HasF.type (%HasF.type.9f4) = specific_constant @HasF.%Self.1, @HasF(constants.%T) [symbolic = %Self (constants.%Self.0b6)] // CHECK:STDOUT: %Self.ref: @HasF.F.%HasF.type (%HasF.type.9f4) = name_ref Self, %.loc5_14.2 [symbolic = %Self (constants.%Self.0b6)] // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc5_14.3: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0.loc5_21.1: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.d31)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 // CHECK:STDOUT: .F = %assoc0.loc5_21.1 // CHECK:STDOUT: witness = (%HasF.F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @empty_struct_type.as.HasF.impl(%T.loc8_14.2: type) { // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.type.loc8_36.1: type = facet_type <@HasF, @HasF(%T.loc8_14.1)> [symbolic = %HasF.type.loc8_36.1 (constants.%HasF.type.9f4)] // CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.loc8_36.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @empty_struct_type.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness.b0b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type: type = fn_type @empty_struct_type.as.HasF.impl.F, @empty_struct_type.as.HasF.impl(%T.loc8_14.1) [symbolic = %empty_struct_type.as.HasF.impl.F.type (constants.%empty_struct_type.as.HasF.impl.F.type.364)] // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F: @empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F.type (%empty_struct_type.as.HasF.impl.F.type.364) = struct_value () [symbolic = %empty_struct_type.as.HasF.impl.F (constants.%empty_struct_type.as.HasF.impl.F.6bf)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %.loc8_25.2 as %HasF.type.loc8_36.2 { // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.decl: @empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F.type (%empty_struct_type.as.HasF.impl.F.type.364) = fn_decl @empty_struct_type.as.HasF.impl.F [symbolic = @empty_struct_type.as.HasF.impl.%empty_struct_type.as.HasF.impl.F (constants.%empty_struct_type.as.HasF.impl.F.6bf)] { // CHECK:STDOUT: %self.patt: %pattern_type.a96 = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: %empty_struct_type = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_struct_type.as.HasF.impl.%.loc8_25.2 [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %self: %empty_struct_type = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %empty_struct_type.as.HasF.impl.F.decl // CHECK:STDOUT: witness = file.%HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.F(@HasF.%T.loc4_16.2: type, @HasF.%Self.1: @HasF.%HasF.type (%HasF.type.9f4)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T)> [symbolic = %HasF.type (constants.%HasF.type.9f4)] // CHECK:STDOUT: %Self: @HasF.F.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0b6)] // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.f60)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @empty_struct_type.as.HasF.impl.F(@empty_struct_type.as.HasF.impl.%T.loc8_14.2: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: %empty_struct_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%x.param: %empty_struct_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic] // CHECK:STDOUT: %.loc13_12: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc13_13: type = converted %.loc13_12, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%empty_struct_type)> [concrete = constants.%HasF.type.48b] // CHECK:STDOUT: %.loc13_14: %HasF.assoc_type.9e4 = specific_constant @HasF.%assoc0.loc5_21.1, @HasF(constants.%empty_struct_type) [concrete = constants.%assoc0.f76] // CHECK:STDOUT: %F.ref: %HasF.assoc_type.9e4 = name_ref F, %.loc13_14 [concrete = constants.%assoc0.f76] // CHECK:STDOUT: %impl.elem0: %.0b8 = impl_witness_access constants.%HasF.impl_witness.430, element0 [concrete = constants.%empty_struct_type.as.HasF.impl.F.8ab] // CHECK:STDOUT: %bound_method.loc13_4: = bound_method %x.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @empty_struct_type.as.HasF.impl.F(constants.%empty_struct_type) [concrete = constants.%empty_struct_type.as.HasF.impl.F.specific_fn] // CHECK:STDOUT: %bound_method.loc13_18: = bound_method %x.ref, %specific_fn // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.call: init %empty_tuple.type = call %bound_method.loc13_18(%x.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%T) { // CHECK:STDOUT: %T.loc4_16.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4 // CHECK:STDOUT: %Self.2 => constants.%Self.0b6 // CHECK:STDOUT: %HasF.F.type => constants.%HasF.F.type.46c // CHECK:STDOUT: %HasF.F => constants.%HasF.F.823 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.dd8 // CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.d31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%Self.0b6) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4 // CHECK:STDOUT: %Self => constants.%Self.0b6 // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_36.1 => constants.%HasF.type.9f4 // CHECK:STDOUT: %require_complete => constants.%require_complete // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.b0b // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type => constants.%empty_struct_type.as.HasF.impl.F.type.364 // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F => constants.%empty_struct_type.as.HasF.impl.F.6bf // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl.F(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%HasF.facet.e17) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4 // CHECK:STDOUT: %Self => constants.%HasF.facet.e17 // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a96 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc4_16.1 => constants.%empty_struct_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type => constants.%HasF.type.48b // CHECK:STDOUT: %Self.2 => constants.%Self.f65 // CHECK:STDOUT: %HasF.F.type => constants.%HasF.F.type.b0b // CHECK:STDOUT: %HasF.F => constants.%HasF.F.418 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.9e4 // CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.f76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl(constants.%empty_struct_type) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%empty_struct_type // CHECK:STDOUT: %HasF.type.loc8_36.1 => constants.%HasF.type.48b // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness.430 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F.type => constants.%empty_struct_type.as.HasF.impl.F.type.9bd // CHECK:STDOUT: %empty_struct_type.as.HasF.impl.F => constants.%empty_struct_type.as.HasF.impl.F.8ab // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl.F(constants.%empty_struct_type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_incomplete_deduction.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [concrete] // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] // CHECK:STDOUT: %pattern_type.85b: type = pattern_type %Self.as_type [symbolic] // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F [concrete] // CHECK:STDOUT: %HasF.F: %HasF.F.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF [concrete] // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, @HasF.%HasF.F.decl [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T, %U) [symbolic] // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T, %U) [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F: %T.as.HasF.impl.F.type = struct_value () [symbolic] // CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [concrete = constants.%HasF.type] {} {} // CHECK:STDOUT: impl_decl @T.as.HasF.impl [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_14.2 [symbolic = %T.loc12_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %.Self.1: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc12_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.1 (constants.%T)] // CHECK:STDOUT: %.Self.2: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %U.loc12_24.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc12_24.1 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (), @T.as.HasF.impl [concrete] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T, constants.%U) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness)] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0 // CHECK:STDOUT: %.loc16_10.1: type = splice_block %.loc16_10.3 [concrete = constants.%empty_struct_type] { // CHECK:STDOUT: %.loc16_10.2: %empty_struct_type = struct_literal () // CHECK:STDOUT: %.loc16_10.3: type = converted %.loc16_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %HasF.F.decl: %HasF.F.type = fn_decl @HasF.F [concrete = constants.%HasF.F] { // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.85b) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.85b) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self // CHECK:STDOUT: .F = %assoc0 // CHECK:STDOUT: witness = (%HasF.F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc12_14.2: type, %U.loc12_24.2: type) { // CHECK:STDOUT: %T.loc12_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.1 (constants.%T)] // CHECK:STDOUT: %U.loc12_24.1: type = bind_symbolic_name U, 1 [symbolic = %U.loc12_24.1 (constants.%U)] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc12_14.1, %U.loc12_24.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T.loc12_14.1, %U.loc12_24.1) [symbolic = %T.as.HasF.impl.F.type (constants.%T.as.HasF.impl.F.type)] // CHECK:STDOUT: %T.as.HasF.impl.F: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = struct_value () [symbolic = %T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %HasF.ref { // CHECK:STDOUT: %T.as.HasF.impl.F.decl: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = fn_decl @T.as.HasF.impl.F [symbolic = @T.as.HasF.impl.%T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)] { // CHECK:STDOUT: %self.patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T.as.HasF.impl.F.%T (%T) = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl // CHECK:STDOUT: witness = // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.85b)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc12_14.2: type, @T.as.HasF.impl.%U.loc12_24.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @T.as.HasF.impl.F.%T (%T)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%x.param: %empty_struct_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.type] // CHECK:STDOUT: %F.ref: %HasF.assoc_type = name_ref F, @HasF.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.85b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T, constants.%U) { // CHECK:STDOUT: %T.loc12_14.1 => constants.%T // CHECK:STDOUT: %U.loc12_24.1 => constants.%U // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type // CHECK:STDOUT: %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl.F(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_inconsistent_deduction.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %HasF.type.fe3: type = generic_interface_type @HasF [concrete] // CHECK:STDOUT: %HasF.generic: %HasF.type.fe3 = struct_value () [concrete] // CHECK:STDOUT: %HasF.type.9f4: type = facet_type <@HasF, @HasF(%T)> [symbolic] // CHECK:STDOUT: %Self.0b6: %HasF.type.9f4 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %Self.as_type.b0c: type = facet_access_type %Self.0b6 [symbolic] // CHECK:STDOUT: %pattern_type.f60: type = pattern_type %Self.as_type.b0c [symbolic] // CHECK:STDOUT: %HasF.F.type.46c: type = fn_type @HasF.F, @HasF(%T) [symbolic] // CHECK:STDOUT: %HasF.F.823: %HasF.F.type.46c = struct_value () [symbolic] // CHECK:STDOUT: %HasF.assoc_type.dd8: type = assoc_entity_type @HasF, @HasF(%T) [symbolic] // CHECK:STDOUT: %assoc0.d31: %HasF.assoc_type.dd8 = assoc_entity element0, @HasF.%HasF.F.decl [symbolic] // CHECK:STDOUT: %require_complete.c26: = require_complete_type %HasF.type.9f4 [symbolic] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T) [symbolic] // CHECK:STDOUT: %T.as.HasF.impl.F: %T.as.HasF.impl.F.type = struct_value () [symbolic] // CHECK:STDOUT: %HasF.facet: %HasF.type.9f4 = facet_value %T, (%HasF.impl_witness) [symbolic] // CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T [symbolic] // CHECK:STDOUT: %A: type = class_type @A [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete] // CHECK:STDOUT: %Destroy.impl_witness.ca8: = impl_witness @A.%Destroy.impl_witness_table [concrete] // CHECK:STDOUT: %ptr.6db: type = ptr_type %A [concrete] // CHECK:STDOUT: %pattern_type.5f8: type = pattern_type %ptr.6db [concrete] // CHECK:STDOUT: %A.as.Destroy.impl.Op.type: type = fn_type @A.as.Destroy.impl.Op [concrete] // CHECK:STDOUT: %A.as.Destroy.impl.Op: %A.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %B: type = class_type @B [concrete] // CHECK:STDOUT: %Destroy.impl_witness.041: = impl_witness @B.%Destroy.impl_witness_table [concrete] // CHECK:STDOUT: %ptr.e79: type = ptr_type %B [concrete] // CHECK:STDOUT: %pattern_type.960: type = pattern_type %ptr.e79 [concrete] // CHECK:STDOUT: %B.as.Destroy.impl.Op.type: type = fn_type @B.as.Destroy.impl.Op [concrete] // CHECK:STDOUT: %B.as.Destroy.impl.Op: %B.as.Destroy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %HasF.type.296: type = facet_type <@HasF, @HasF(%B)> [concrete] // CHECK:STDOUT: %Self.f60: %HasF.type.296 = bind_symbolic_name Self, 1 [symbolic] // CHECK:STDOUT: %HasF.F.type.1c6: type = fn_type @HasF.F, @HasF(%B) [concrete] // CHECK:STDOUT: %HasF.F.7cf: %HasF.F.type.1c6 = struct_value () [concrete] // CHECK:STDOUT: %HasF.assoc_type.1af: type = assoc_entity_type @HasF, @HasF(%B) [concrete] // CHECK:STDOUT: %assoc0.402: %HasF.assoc_type.1af = assoc_entity element0, @HasF.%HasF.F.decl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: %HasF.type.fe3 = interface_decl @HasF [concrete = constants.%HasF.generic] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @T.as.HasF.impl [concrete] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc8_24: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic] // CHECK:STDOUT: %T.ref.loc8_34: type = name_ref T, %T.loc8_14.2 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.type.loc8_35.2: type = facet_type <@HasF, @HasF(constants.%T)> [symbolic = %HasF.type.loc8_35.1 (constants.%HasF.type.9f4)] // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %T.loc8_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (@T.as.HasF.impl.%T.as.HasF.impl.F.decl), @T.as.HasF.impl [concrete] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness %HasF.impl_witness_table, @T.as.HasF.impl(constants.%T) [symbolic = @T.as.HasF.impl.%HasF.impl_witness (constants.%HasF.impl_witness)] // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {} // CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { // CHECK:STDOUT: %x.patt: %pattern_type.c10 = binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.c10 = value_param_pattern %x.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: %A = value_param call_param0 // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] // CHECK:STDOUT: %x: %A = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @HasF(%T.loc4_16.2: type) { // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T.loc4_16.1)> [symbolic = %HasF.type (constants.%HasF.type.9f4)] // CHECK:STDOUT: %Self.2: @HasF.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0b6)] // CHECK:STDOUT: %HasF.F.type: type = fn_type @HasF.F, @HasF(%T.loc4_16.1) [symbolic = %HasF.F.type (constants.%HasF.F.type.46c)] // CHECK:STDOUT: %HasF.F: @HasF.%HasF.F.type (%HasF.F.type.46c) = struct_value () [symbolic = %HasF.F (constants.%HasF.F.823)] // CHECK:STDOUT: %HasF.assoc_type: type = assoc_entity_type @HasF, @HasF(%T.loc4_16.1) [symbolic = %HasF.assoc_type (constants.%HasF.assoc_type.dd8)] // CHECK:STDOUT: %assoc0.loc5_21.2: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.d31)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: %Self.1: @HasF.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0b6)] // CHECK:STDOUT: %HasF.F.decl: @HasF.%HasF.F.type (%HasF.F.type.46c) = fn_decl @HasF.F [symbolic = @HasF.%HasF.F (constants.%HasF.F.823)] { // CHECK:STDOUT: %self.patt: @HasF.F.%pattern_type (%pattern_type.f60) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @HasF.F.%pattern_type (%pattern_type.f60) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.b0c) = value_param call_param0 // CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.3 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b0c)] { // CHECK:STDOUT: %.loc5_14.2: @HasF.F.%HasF.type (%HasF.type.9f4) = specific_constant @HasF.%Self.1, @HasF(constants.%T) [symbolic = %Self (constants.%Self.0b6)] // CHECK:STDOUT: %Self.ref: @HasF.F.%HasF.type (%HasF.type.9f4) = name_ref Self, %.loc5_14.2 [symbolic = %Self (constants.%Self.0b6)] // CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b0c)] // CHECK:STDOUT: %.loc5_14.3: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b0c)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.b0c) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0.loc5_21.1: @HasF.%HasF.assoc_type (%HasF.assoc_type.dd8) = assoc_entity element0, %HasF.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.d31)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 // CHECK:STDOUT: .F = %assoc0.loc5_21.1 // CHECK:STDOUT: witness = (%HasF.F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @T.as.HasF.impl(%T.loc8_14.2: type) { // CHECK:STDOUT: %T.loc8_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_14.1 (constants.%T)] // CHECK:STDOUT: %HasF.type.loc8_35.1: type = facet_type <@HasF, @HasF(%T.loc8_14.1)> [symbolic = %HasF.type.loc8_35.1 (constants.%HasF.type.9f4)] // CHECK:STDOUT: %require_complete: = require_complete_type %HasF.type.loc8_35.1 [symbolic = %require_complete (constants.%require_complete.c26)] // CHECK:STDOUT: %HasF.impl_witness: = impl_witness file.%HasF.impl_witness_table, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %HasF.impl_witness (constants.%HasF.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type: type = fn_type @T.as.HasF.impl.F, @T.as.HasF.impl(%T.loc8_14.1) [symbolic = %T.as.HasF.impl.F.type (constants.%T.as.HasF.impl.F.type)] // CHECK:STDOUT: %T.as.HasF.impl.F: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = struct_value () [symbolic = %T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref.loc8_24 as %HasF.type.loc8_35.2 { // CHECK:STDOUT: %T.as.HasF.impl.F.decl: @T.as.HasF.impl.%T.as.HasF.impl.F.type (%T.as.HasF.impl.F.type) = fn_decl @T.as.HasF.impl.F [symbolic = @T.as.HasF.impl.%T.as.HasF.impl.F (constants.%T.as.HasF.impl.F)] { // CHECK:STDOUT: %self.patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: @T.as.HasF.impl.F.%pattern_type (%pattern_type.7dc) = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T.as.HasF.impl.F.%T (%T) = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @T.as.HasF.impl.%T.ref.loc8_24 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %self: @T.as.HasF.impl.F.%T (%T) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %T.as.HasF.impl.F.decl // CHECK:STDOUT: witness = file.%HasF.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @A.as.Destroy.impl: @A.%Self.ref as constants.%Destroy.type { // CHECK:STDOUT: %A.as.Destroy.impl.Op.decl: %A.as.Destroy.impl.Op.type = fn_decl @A.as.Destroy.impl.Op [concrete = constants.%A.as.Destroy.impl.Op] { // CHECK:STDOUT: %self.patt: %pattern_type.5f8 = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.5f8 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %.loc12: %pattern_type.f6d = addr_pattern %self.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: %ptr.6db = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [concrete = constants.%A] // CHECK:STDOUT: %self: %ptr.6db = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %A.as.Destroy.impl.Op.decl // CHECK:STDOUT: witness = @A.%Destroy.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @B.as.Destroy.impl: @B.%Self.ref as constants.%Destroy.type { // CHECK:STDOUT: %B.as.Destroy.impl.Op.decl: %B.as.Destroy.impl.Op.type = fn_decl @B.as.Destroy.impl.Op [concrete = constants.%B.as.Destroy.impl.Op] { // CHECK:STDOUT: %self.patt: %pattern_type.960 = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.960 = value_param_pattern %self.patt, call_param0 [concrete] // CHECK:STDOUT: %.loc13: %pattern_type.f6d = addr_pattern %self.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: %ptr.e79 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [concrete = constants.%B] // CHECK:STDOUT: %self: %ptr.e79 = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %B.as.Destroy.impl.Op.decl // CHECK:STDOUT: witness = @B.%Destroy.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [concrete = constants.%A] // CHECK:STDOUT: impl_decl @A.as.Destroy.impl [concrete] {} {} // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@A.as.Destroy.impl.%A.as.Destroy.impl.Op.decl), @A.as.Destroy.impl [concrete] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.ca8] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [concrete = constants.%B] // CHECK:STDOUT: impl_decl @B.as.Destroy.impl [concrete] {} {} // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@B.as.Destroy.impl.%B.as.Destroy.impl.Op.decl), @B.as.Destroy.impl [concrete] // CHECK:STDOUT: %Destroy.impl_witness: = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.041] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.F(@HasF.%T.loc4_16.2: type, @HasF.%Self.1: @HasF.%HasF.type (%HasF.type.9f4)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T)> [symbolic = %HasF.type (constants.%HasF.type.9f4)] // CHECK:STDOUT: %Self: @HasF.F.%HasF.type (%HasF.type.9f4) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0b6)] // CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.b0c)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.f60)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @HasF.F.%Self.as_type.loc5_14.1 (%Self.as_type.b0c)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc8_14.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic = %require_complete (constants.%require_complete.4ae)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @T.as.HasF.impl.F.%T (%T)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A.as.Destroy.impl.Op(%self.param: %ptr.6db) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @B.as.Destroy.impl.Op(%self.param: %ptr.e79) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%x.param: %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %A = name_ref x, %x // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%B)> [concrete = constants.%HasF.type.296] // CHECK:STDOUT: %.loc22: %HasF.assoc_type.1af = specific_constant @HasF.%assoc0.loc5_21.1, @HasF(constants.%B) [concrete = constants.%assoc0.402] // CHECK:STDOUT: %F.ref: %HasF.assoc_type.1af = name_ref F, %.loc22 [concrete = constants.%assoc0.402] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%T) { // CHECK:STDOUT: %T.loc4_16.1 => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4 // CHECK:STDOUT: %Self.2 => constants.%Self.0b6 // CHECK:STDOUT: %HasF.F.type => constants.%HasF.F.type.46c // CHECK:STDOUT: %HasF.F => constants.%HasF.F.823 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.dd8 // CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.d31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%Self.0b6) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4 // CHECK:STDOUT: %Self => constants.%Self.0b6 // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.b0c // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl(constants.%T) { // CHECK:STDOUT: %T.loc8_14.1 => constants.%T // CHECK:STDOUT: %HasF.type.loc8_35.1 => constants.%HasF.type.9f4 // CHECK:STDOUT: %require_complete => constants.%require_complete.c26 // CHECK:STDOUT: %HasF.impl_witness => constants.%HasF.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T.as.HasF.impl.F.type => constants.%T.as.HasF.impl.F.type // CHECK:STDOUT: %T.as.HasF.impl.F => constants.%T.as.HasF.impl.F // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @T.as.HasF.impl.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.F(constants.%T, constants.%HasF.facet) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %HasF.type => constants.%HasF.type.9f4 // CHECK:STDOUT: %Self => constants.%HasF.facet // CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF(constants.%B) { // CHECK:STDOUT: %T.loc4_16.1 => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HasF.type => constants.%HasF.type.296 // CHECK:STDOUT: %Self.2 => constants.%Self.f60 // CHECK:STDOUT: %HasF.F.type => constants.%HasF.F.type.1c6 // CHECK:STDOUT: %HasF.F => constants.%HasF.F.7cf // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.1af // CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.402 // CHECK:STDOUT: } // CHECK:STDOUT: