mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 17:00:42 +00:00
Shorthand names are intended to be used in the textual format of references to instructions in another IR (which can't happen now, but will be possible in a forthcoming PR). The shorthand name uses the file name (minus the `.carbon` suffix) as a base, and if that base name is ambiguous within the compilation, it is given a numerical suffix `.N`, just like other textual IR names. Shorthand names are prefixed with `$` in the textual format, to distinguish them from inst and scope names. For example, a file `foo/bar.carbon` has the shorthand name `$bar`, and an instruction `@baz.%qux` in that file can be referenced from another file as `$bar.@baz.%qux`. This PR adds `toolchain/check/testdata/basics/file_name.carbon` to test this behavior. All other test changes are just applying this change to the existing textual SemIR dumps. --------- Co-authored-by: Dana Jansens <danakj@orodu.net>
450 lines
29 KiB
Plaintext
450 lines
29 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/default_fn.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/default_fn.carbon
|
|
|
|
// --- parsed_in_class_scope.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class C {
|
|
//@dump-sem-ir-begin
|
|
interface I {
|
|
// TODO: Use `default` here.
|
|
default fn F(unused self) {
|
|
// I and F are both complete here, and the impl below is in scope.
|
|
var c: C = {};
|
|
c.(I.F)();
|
|
}
|
|
}
|
|
//@dump-sem-ir-end
|
|
|
|
// The fact that `F` has a default is visible here.
|
|
//@dump-sem-ir-begin
|
|
impl C as I {}
|
|
//@dump-sem-ir-end
|
|
}
|
|
|
|
// --- generic_impl.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface I {
|
|
fn F();
|
|
//@dump-sem-ir-begin
|
|
default fn G() { Self.F(); }
|
|
//@dump-sem-ir-end
|
|
}
|
|
|
|
//@dump-sem-ir-begin
|
|
impl forall [T: type] T as I {
|
|
fn F() {}
|
|
}
|
|
//@dump-sem-ir-end
|
|
|
|
fn Call() { ().(I.G)(); }
|
|
|
|
// CHECK:STDOUT: --- parsed_in_class_scope.carbon = $parsed_in_class_scope
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
|
// CHECK:STDOUT: %Self.4e9: %I.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: %Self.as_type.0fa: type = facet_access_type %Self.4e9 [symbolic]
|
|
// CHECK:STDOUT: %pattern_type.492: type = pattern_type %Self.as_type.0fa [symbolic]
|
|
// CHECK:STDOUT: %self.param_patt.55d: %pattern_type.492 = value_param_pattern [symbolic]
|
|
// CHECK:STDOUT: %self.patt.ce2: %pattern_type.492 = wrapper_binding_pattern self, %self.param_patt.55d [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.F.type.2e1: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self.4e9) [symbolic]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.F.c83: %I.WithSelf.F.type.2e1 = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
|
|
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.F.decl [concrete]
|
|
// CHECK:STDOUT: %.c3e: <witness> = impl_self_witness %C, @I [concrete]
|
|
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete]
|
|
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.F.type.42f: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet) [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.F.a34: %I.WithSelf.F.type.42f = struct_value () [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: %require_complete.c77: <witness> = require_complete_type %Self.as_type.0fa [symbolic]
|
|
// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete]
|
|
// CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete]
|
|
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
|
|
// CHECK:STDOUT: %.136: type = fn_type_with_self_type %I.WithSelf.F.type.42f, %I.facet [concrete]
|
|
// CHECK:STDOUT: %self.param_patt.303: %pattern_type.98b = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %self.patt.36a: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.303 [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.F.specific_fn: <specific function> = specific_function %I.WithSelf.F.a34, @I.WithSelf.F(%I.facet) [concrete]
|
|
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
|
// CHECK:STDOUT: %SubobjectDestroy.type: type = facet_type <@SubobjectDestroy> [concrete]
|
|
// CHECK:STDOUT: %T.09f: %SubobjectDestroy.type = symbolic_binding T, 0 [symbolic]
|
|
// CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.type.dea: type = fn_type @T.as_type.as.DestroyImpl.impl.Op, @T.as_type.as.DestroyImpl.impl(%T.09f) [symbolic]
|
|
// CHECK:STDOUT: %T.as_type.as.DestroyImpl.impl.Op.6e5: %T.as_type.as.DestroyImpl.impl.Op.type.dea = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc9_7.2 [concrete]
|
|
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete]
|
|
// CHECK:STDOUT: %custom_witness.b80ef6.2: <witness> = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete]
|
|
// CHECK:STDOUT: %SubobjectDestroy.facet.978: %SubobjectDestroy.type = facet_value %C, (%custom_witness.b80ef6.2) [concrete]
|
|
// CHECK:STDOUT: %DestroyImpl.impl_witness.1e5: <witness> = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.978) [concrete]
|
|
// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%DestroyImpl.impl_witness.1e5, %custom_witness.b80ef6.2) [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core.import_ref.74d: @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op.type (%T.as_type.as.DestroyImpl.impl.Op.type.dea) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DestroyImpl.impl.%T.as_type.as.DestroyImpl.impl.Op (constants.%T.as_type.as.DestroyImpl.impl.Op.6e5)]
|
|
// CHECK:STDOUT: %DestroyImpl.impl_witness_table = impl_witness_table (%Core.import_ref.74d), @T.as_type.as.DestroyImpl.impl [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @I {
|
|
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self.4e9]
|
|
// CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !with Self:
|
|
// CHECK:STDOUT: %I.WithSelf.F.decl: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.2e1) = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.c83)] {
|
|
// CHECK:STDOUT: %self.param_patt.loc7_25.1: @I.WithSelf.F.%pattern_type (%pattern_type.492) = value_param_pattern [symbolic = %self.param_patt.loc7_25.2 (constants.%self.param_patt.55d)]
|
|
// CHECK:STDOUT: %self.patt.loc7_25.1: @I.WithSelf.F.%pattern_type (%pattern_type.492) = wrapper_binding_pattern self, %self.param_patt.loc7_25.1 [symbolic = %self.patt.loc7_25.2 (constants.%self.patt.ce2)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc7_25.1 (%Self.as_type.0fa) = value_param call_param0
|
|
// CHECK:STDOUT: %.loc7_25.1: type = splice_block %.loc7_25.2 [symbolic = %Self.as_type.loc7_25.1 (constants.%Self.as_type.0fa)] {
|
|
// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.4e9)]
|
|
// CHECK:STDOUT: %Self.as_type.loc7_25.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_25.1 (constants.%Self.as_type.0fa)]
|
|
// CHECK:STDOUT: %.loc7_25.2: type = converted %Self.ref, %Self.as_type.loc7_25.2 [symbolic = %Self.as_type.loc7_25.1 (constants.%Self.as_type.0fa)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc7_25.1 (%Self.as_type.0fa) = wrapper_binding self, %self.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: .C = <poisoned>
|
|
// CHECK:STDOUT: .I = <poisoned>
|
|
// CHECK:STDOUT: .F = @I.WithSelf.%assoc0
|
|
// CHECK:STDOUT: .C = <poisoned>
|
|
// CHECK:STDOUT: .I = <poisoned>
|
|
// CHECK:STDOUT: witness = (@I.WithSelf.%I.WithSelf.F.decl)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @C.as.I.impl: %C.ref as %I.ref {
|
|
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (constants.%I.WithSelf.F.a34), @C.as.I.impl [concrete]
|
|
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .F = <poisoned>
|
|
// CHECK:STDOUT: extend %I.ref
|
|
// CHECK:STDOUT: witness = %I.impl_witness
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C {
|
|
// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
|
|
// CHECK:STDOUT: impl_decl @C.as.I.impl [concrete] {} {
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %I.ref: type = name_ref I, @C.%I.decl [concrete = constants.%I.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc17: <witness> = impl_self_witness @C.as.I.impl.%C.ref, @I [concrete = constants.%.c3e]
|
|
// CHECK:STDOUT: <elided>
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
// CHECK:STDOUT: .I = %I.decl
|
|
// CHECK:STDOUT: .C = <poisoned>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @I.WithSelf.F(@I.%Self: %I.type) {
|
|
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.4e9)]
|
|
// CHECK:STDOUT: %Self.as_type.loc7_25.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc7_25.1 (constants.%Self.as_type.0fa)]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_25.1 [symbolic = %pattern_type (constants.%pattern_type.492)]
|
|
// CHECK:STDOUT: %self.param_patt.loc7_25.2: @I.WithSelf.F.%pattern_type (%pattern_type.492) = value_param_pattern [symbolic = %self.param_patt.loc7_25.2 (constants.%self.param_patt.55d)]
|
|
// CHECK:STDOUT: %self.patt.loc7_25.2: @I.WithSelf.F.%pattern_type (%pattern_type.492) = wrapper_binding_pattern self, %self.param_patt.loc7_25.2 [symbolic = %self.patt.loc7_25.2 (constants.%self.patt.ce2)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type.loc7_25.1 [symbolic = %require_complete (constants.%require_complete.c77)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc7_25.1 (%Self.as_type.0fa)) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %c.var: ref %C = var_storage %c.var_patt
|
|
// CHECK:STDOUT: %.loc9_19.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
|
// CHECK:STDOUT: %.loc9_19.2: init %C to %c.var = class_init () [concrete = constants.%C.val]
|
|
// CHECK:STDOUT: %.loc9_7.1: init %C = converted %.loc9_19.1, %.loc9_19.2 [concrete = constants.%C.val]
|
|
// CHECK:STDOUT: assign %c.var, %.loc9_7.1
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %c: ref %C = wrapper_binding c, %c.var
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete = constants.%c.patt]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c
|
|
// CHECK:STDOUT: %I.ref: type = name_ref I, @C.%I.decl [concrete = constants.%I.type]
|
|
// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.WithSelf.%assoc0 [concrete = constants.%assoc0]
|
|
// CHECK:STDOUT: %impl.elem0: %.136 = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%I.WithSelf.F.a34]
|
|
// CHECK:STDOUT: %bound_method.loc10_8: <bound method> = bound_method %c.ref, %impl.elem0
|
|
// CHECK:STDOUT: %I.facet.loc10_15.1: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
|
|
// CHECK:STDOUT: %.loc10_15.1: %I.type = converted constants.%C, %I.facet.loc10_15.1 [concrete = constants.%I.facet]
|
|
// CHECK:STDOUT: %I.facet.loc10_15.2: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
|
|
// CHECK:STDOUT: %.loc10_15.2: %I.type = converted constants.%C, %I.facet.loc10_15.2 [concrete = constants.%I.facet]
|
|
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @I.WithSelf.F(constants.%I.facet) [concrete = constants.%I.WithSelf.F.specific_fn]
|
|
// CHECK:STDOUT: %bound_method.loc10_15: <bound method> = bound_method %c.ref, %specific_fn
|
|
// CHECK:STDOUT: %.loc10_7: %C = acquire_value %c.ref
|
|
// CHECK:STDOUT: %I.WithSelf.F.call: init %empty_tuple.type = call %bound_method.loc10_15(%.loc10_7)
|
|
// CHECK:STDOUT: %Destroy.facet.loc9_7.1: %Destroy.type = facet_value constants.%C, (constants.%DestroyImpl.impl_witness.1e5, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
|
|
// CHECK:STDOUT: %.loc9_7.2: %Destroy.type = converted constants.%C, %Destroy.facet.loc9_7.1 [concrete = constants.%Destroy.facet]
|
|
// CHECK:STDOUT: %Destroy.facet.loc9_7.2: %Destroy.type = facet_value constants.%C, (constants.%DestroyImpl.impl_witness.1e5, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet]
|
|
// CHECK:STDOUT: %.loc9_7.3: %Destroy.type = converted constants.%C, %Destroy.facet.loc9_7.2 [concrete = constants.%Destroy.facet]
|
|
// CHECK:STDOUT: <elided>
|
|
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%c.var)
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc9_7.1(%self.param: ref %empty_struct_type) = "no_op";
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc9_7.2(%self.param: ref %C) = "no_op";
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf(constants.%Self.4e9) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %Self => constants.%Self.4e9
|
|
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.2e1
|
|
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.c83
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self.4e9) {
|
|
// CHECK:STDOUT: %Self => constants.%Self.4e9
|
|
// CHECK:STDOUT: %Self.as_type.loc7_25.1 => constants.%Self.as_type.0fa
|
|
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.492
|
|
// CHECK:STDOUT: %self.param_patt.loc7_25.2 => constants.%self.param_patt.55d
|
|
// CHECK:STDOUT: %self.patt.loc7_25.2 => constants.%self.patt.ce2
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %Self => constants.%I.facet
|
|
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.42f
|
|
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.a34
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) {
|
|
// CHECK:STDOUT: %Self => constants.%I.facet
|
|
// CHECK:STDOUT: %Self.as_type.loc7_25.1 => constants.%C
|
|
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b
|
|
// CHECK:STDOUT: %self.param_patt.loc7_25.2 => constants.%self.param_patt.303
|
|
// CHECK:STDOUT: %self.patt.loc7_25.2 => constants.%self.patt.36a
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %require_complete => constants.%complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- generic_impl.carbon = $generic_impl
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
|
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.F.type.de2: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self) [symbolic]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.F.20b: %I.WithSelf.F.type.de2 = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
|
|
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.F.decl [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.G.type.ace: type = fn_type @I.WithSelf.G, @I.WithSelf(%Self) [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.G.179: %I.WithSelf.G.type.ace = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.WithSelf.%I.WithSelf.G.decl [concrete]
|
|
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
|
|
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic]
|
|
// CHECK:STDOUT: %.b7e: type = fn_type_with_self_type %I.WithSelf.F.type.de2, %Self [symbolic]
|
|
// CHECK:STDOUT: %impl.elem0: %.b7e = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
|
|
// CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @I.WithSelf.F(%Self) [symbolic]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
|
|
// CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [symbolic]
|
|
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
|
|
// CHECK:STDOUT: %.917: <witness> = impl_self_witness %T, @I [symbolic]
|
|
// CHECK:STDOUT: %I.impl_witness.899: <witness> = impl_witness @T.as.I.impl.%I.impl_witness_table, @T.as.I.impl(%T) [symbolic]
|
|
// CHECK:STDOUT: %T.as.I.impl.F.type.a03: type = fn_type @T.as.I.impl.F, @T.as.I.impl(%T) [symbolic]
|
|
// CHECK:STDOUT: %T.as.I.impl.F.745: %T.as.I.impl.F.type.a03 = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %I.facet.510: %I.type = facet_value %T, (%I.impl_witness.899) [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.F.type.713: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet.510) [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.F.f4d: %I.WithSelf.F.type.713 = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.G.type.05e: type = fn_type @I.WithSelf.G, @I.WithSelf(%I.facet.510) [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.G.c19: %I.WithSelf.G.type.05e = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %.2ef: <witness> = impl_self_witness %empty_tuple.type, @I [concrete]
|
|
// CHECK:STDOUT: %I.impl_witness.e63: <witness> = impl_witness @T.as.I.impl.%I.impl_witness_table, @T.as.I.impl(%empty_tuple.type) [concrete]
|
|
// CHECK:STDOUT: %I.facet.b01: %I.type = facet_value %empty_tuple.type, (%I.impl_witness.e63) [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.F.type.0a9: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet.b01) [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.F.1d9: %I.WithSelf.F.type.0a9 = struct_value () [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.G.type.c3e: type = fn_type @I.WithSelf.G, @I.WithSelf(%I.facet.b01) [concrete]
|
|
// CHECK:STDOUT: %I.WithSelf.G.861: %I.WithSelf.G.type.c3e = struct_value () [concrete]
|
|
// CHECK:STDOUT: %T.as.I.impl.F.type.846: type = fn_type @T.as.I.impl.F, @T.as.I.impl(%empty_tuple.type) [concrete]
|
|
// CHECK:STDOUT: %T.as.I.impl.F.20e: %T.as.I.impl.F.type.846 = struct_value () [concrete]
|
|
// CHECK:STDOUT: %.aab: type = fn_type_with_self_type %I.WithSelf.F.type.0a9, %I.facet.b01 [concrete]
|
|
// CHECK:STDOUT: %T.as.I.impl.F.specific_fn: <specific function> = specific_function %T.as.I.impl.F.20e, @T.as.I.impl.F(%empty_tuple.type) [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: impl_decl @T.as.I.impl [concrete] {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.1: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_15.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_15.2 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
|
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.2 [concrete = type] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc11_17.2: type = type_literal type [concrete = type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %T.loc11_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc11: <witness> = impl_self_witness @T.as.I.impl.%T.ref, @I [symbolic = @T.as.I.impl.%.loc11_30 (constants.%.917)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @I {
|
|
// CHECK:STDOUT: <elided>
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !with Self:
|
|
// CHECK:STDOUT: <elided>
|
|
// CHECK:STDOUT: %I.WithSelf.G.decl: @I.WithSelf.%I.WithSelf.G.type (%I.WithSelf.G.type.ace) = fn_decl @I.WithSelf.G [symbolic = @I.WithSelf.%I.WithSelf.G (constants.%I.WithSelf.G.179)] {} {}
|
|
// CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %I.WithSelf.G.decl [concrete = constants.%assoc1]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: .F = @I.WithSelf.%assoc0
|
|
// CHECK:STDOUT: .G = @I.WithSelf.%assoc1
|
|
// CHECK:STDOUT: witness = (@I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.%I.WithSelf.G.decl)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic impl @T.as.I.impl(%T.loc11_15.2: type) {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.2: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_15.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: %T.loc11_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc11_15.1 (constants.%T)]
|
|
// CHECK:STDOUT: %.loc11_30: <witness> = impl_self_witness %T.loc11_15.1, @I [symbolic = %.loc11_30 (constants.%.917)]
|
|
// CHECK:STDOUT: %I.impl_witness.loc11_30.2: <witness> = impl_witness %I.impl_witness_table, @T.as.I.impl(%T.loc11_15.1) [symbolic = %I.impl_witness.loc11_30.2 (constants.%I.impl_witness.899)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %T.as.I.impl.F.type: type = fn_type @T.as.I.impl.F, @T.as.I.impl(%T.loc11_15.1) [symbolic = %T.as.I.impl.F.type (constants.%T.as.I.impl.F.type.a03)]
|
|
// CHECK:STDOUT: %T.as.I.impl.F: @T.as.I.impl.%T.as.I.impl.F.type (%T.as.I.impl.F.type.a03) = struct_value () [symbolic = %T.as.I.impl.F (constants.%T.as.I.impl.F.745)]
|
|
// CHECK:STDOUT: <elided>
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl: %T.ref as %I.ref {
|
|
// CHECK:STDOUT: %T.as.I.impl.F.decl: @T.as.I.impl.%T.as.I.impl.F.type (%T.as.I.impl.F.type.a03) = fn_decl @T.as.I.impl.F [symbolic = @T.as.I.impl.%T.as.I.impl.F (constants.%T.as.I.impl.F.745)] {} {}
|
|
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%T.as.I.impl.F.decl, %I.WithSelf.G), @T.as.I.impl [concrete]
|
|
// CHECK:STDOUT: %I.impl_witness.loc11_30.1: <witness> = impl_witness %I.impl_witness_table, @T.as.I.impl(constants.%T) [symbolic = %I.impl_witness.loc11_30.2 (constants.%I.impl_witness.899)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .F = %T.as.I.impl.F.decl
|
|
// CHECK:STDOUT: .G = <poisoned>
|
|
// CHECK:STDOUT: extend %I.ref
|
|
// CHECK:STDOUT: witness = %I.impl_witness.loc11_30.1
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @I.WithSelf.G(@I.%Self: %I.type) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
|
|
// CHECK:STDOUT: %Self.as_type.loc6_24.2: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_24.2 (constants.%Self.as_type)]
|
|
// CHECK:STDOUT: %I.WithSelf.F.type: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self) [symbolic = %I.WithSelf.F.type (constants.%I.WithSelf.F.type.de2)]
|
|
// CHECK:STDOUT: %.loc6_24.2: type = fn_type_with_self_type %I.WithSelf.F.type, %Self [symbolic = %.loc6_24.2 (constants.%.b7e)]
|
|
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
|
|
// CHECK:STDOUT: %impl.elem0.loc6_24.2: @I.WithSelf.G.%.loc6_24.2 (%.b7e) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_24.2 (constants.%impl.elem0)]
|
|
// CHECK:STDOUT: %specific_impl_fn.loc6_24.2: <specific function> = specific_impl_function %impl.elem0.loc6_24.2, @I.WithSelf.F(%Self) [symbolic = %specific_impl_fn.loc6_24.2 (constants.%specific_impl_fn)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
|
|
// CHECK:STDOUT: %Self.as_type.loc6_24.1: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_24.2 (constants.%Self.as_type)]
|
|
// CHECK:STDOUT: %.loc6_24.1: type = converted %Self.ref, %Self.as_type.loc6_24.1 [symbolic = %Self.as_type.loc6_24.2 (constants.%Self.as_type)]
|
|
// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.WithSelf.%assoc0 [concrete = constants.%assoc0]
|
|
// CHECK:STDOUT: %impl.elem0.loc6_24.1: @I.WithSelf.G.%.loc6_24.2 (%.b7e) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_24.2 (constants.%impl.elem0)]
|
|
// CHECK:STDOUT: %specific_impl_fn.loc6_24.1: <specific function> = specific_impl_function %impl.elem0.loc6_24.1, @I.WithSelf.F(constants.%Self) [symbolic = %specific_impl_fn.loc6_24.2 (constants.%specific_impl_fn)]
|
|
// CHECK:STDOUT: %I.WithSelf.F.call: init %empty_tuple.type = call %specific_impl_fn.loc6_24.1()
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @T.as.I.impl.F(@T.as.I.impl.%T.loc11_15.2: type) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %Self => constants.%Self
|
|
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.de2
|
|
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.20b
|
|
// CHECK:STDOUT: %I.WithSelf.G.type => constants.%I.WithSelf.G.type.ace
|
|
// CHECK:STDOUT: %I.WithSelf.G => constants.%I.WithSelf.G.179
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf.G(constants.%Self) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @T.as.I.impl(constants.%T) {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.2 => constants.%T.patt
|
|
// CHECK:STDOUT: %T.loc11_15.1 => constants.%T
|
|
// CHECK:STDOUT: %.loc11_30 => constants.%.917
|
|
// CHECK:STDOUT: %I.impl_witness.loc11_30.2 => constants.%I.impl_witness.899
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %T.as.I.impl.F.type => constants.%T.as.I.impl.F.type.a03
|
|
// CHECK:STDOUT: %T.as.I.impl.F => constants.%T.as.I.impl.F.745
|
|
// CHECK:STDOUT: %I.facet => constants.%I.facet.510
|
|
// CHECK:STDOUT: %I.WithSelf.G.type => constants.%I.WithSelf.G.type.05e
|
|
// CHECK:STDOUT: %I.WithSelf.G => constants.%I.WithSelf.G.c19
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @T.as.I.impl.F(constants.%T) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet.510) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %Self => constants.%I.facet.510
|
|
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.713
|
|
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.f4d
|
|
// CHECK:STDOUT: %I.WithSelf.G.type => constants.%I.WithSelf.G.type.05e
|
|
// CHECK:STDOUT: %I.WithSelf.G => constants.%I.WithSelf.G.c19
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @T.as.I.impl(constants.%empty_tuple.type) {
|
|
// CHECK:STDOUT: %T.patt.loc11_15.2 => constants.%T.patt
|
|
// CHECK:STDOUT: %T.loc11_15.1 => constants.%empty_tuple.type
|
|
// CHECK:STDOUT: %.loc11_30 => constants.%.2ef
|
|
// CHECK:STDOUT: %I.impl_witness.loc11_30.2 => constants.%I.impl_witness.e63
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %T.as.I.impl.F.type => constants.%T.as.I.impl.F.type.846
|
|
// CHECK:STDOUT: %T.as.I.impl.F => constants.%T.as.I.impl.F.20e
|
|
// CHECK:STDOUT: %I.facet => constants.%I.facet.b01
|
|
// CHECK:STDOUT: %I.WithSelf.G.type => constants.%I.WithSelf.G.type.c3e
|
|
// CHECK:STDOUT: %I.WithSelf.G => constants.%I.WithSelf.G.861
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet.b01) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %Self => constants.%I.facet.b01
|
|
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.0a9
|
|
// CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.1d9
|
|
// CHECK:STDOUT: %I.WithSelf.G.type => constants.%I.WithSelf.G.type.c3e
|
|
// CHECK:STDOUT: %I.WithSelf.G => constants.%I.WithSelf.G.861
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf.G(constants.%I.facet.b01) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %Self => constants.%I.facet.b01
|
|
// CHECK:STDOUT: %Self.as_type.loc6_24.2 => constants.%empty_tuple.type
|
|
// CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.0a9
|
|
// CHECK:STDOUT: %.loc6_24.2 => constants.%.aab
|
|
// CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.impl_witness.e63
|
|
// CHECK:STDOUT: %impl.elem0.loc6_24.2 => constants.%T.as.I.impl.F.20e
|
|
// CHECK:STDOUT: %specific_impl_fn.loc6_24.2 => constants.%T.as.I.impl.F.specific_fn
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @T.as.I.impl.F(constants.%empty_tuple.type) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|