| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810 |
- // 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
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon
- // --- types.carbon
- library "[[@TEST_NAME]]";
- interface I(T:! type) { fn F(); }
- class C(T:! type) {}
- class X {}
- // --- impl_in_interface_args.carbon
- library "[[@TEST_NAME]]";
- import library "types";
- class InInterfaceArgs {}
- impl X as I(InInterfaceArgs) { fn F() {} }
- // --- use_impl_in_interface_args.carbon
- library "[[@TEST_NAME]]";
- import library "types";
- import library "impl_in_interface_args";
- fn G(x: X) { x.(I(InInterfaceArgs).F)(); }
- // --- impl_in_class_args.carbon
- library "[[@TEST_NAME]]";
- import library "types";
- class InClassArgs {}
- impl C(InClassArgs) as I(X) { fn F() {} }
- // --- use_impl_in_class_args.carbon
- library "[[@TEST_NAME]]";
- import library "types";
- import library "impl_in_class_args";
- fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
- // CHECK:STDOUT: --- types.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [template]
- // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [template]
- // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %F.type: type = fn_type @F, @I(%T) [symbolic]
- // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type.325 [symbolic]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%F.decl [symbolic]
- // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
- // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
- // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %X: type = class_type @X [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = %I.decl
- // CHECK:STDOUT: .C = %C.decl
- // CHECK:STDOUT: .X = %X.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %I.decl: %I.type.dac = interface_decl @I [template = constants.%I.generic] {
- // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_13.1, runtime_param<none> [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
- // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_13.2 (constants.%T)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
- // CHECK:STDOUT: %T.patt.loc5_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_9.2 (constants.%T.patt)]
- // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc5_9.1, runtime_param<none> [symbolic = %T.patt.loc5_9.2 (constants.%T.patt)]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
- // CHECK:STDOUT: %T.loc5_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc5_9.2 (constants.%T)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @I(%T.loc4_13.1: type) {
- // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
- // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T.loc4_13.2)> [symbolic = %I.type (constants.%I.type.325)]
- // CHECK:STDOUT: %Self.2: %I.type.325 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
- // CHECK:STDOUT: %F.type: type = fn_type @F, @I(%T.loc4_13.2) [symbolic = %F.type (constants.%F.type)]
- // CHECK:STDOUT: %F: @I.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I.%I.type (%I.type.325) [symbolic = %I.assoc_type (constants.%I.assoc_type)]
- // CHECK:STDOUT: %assoc0.loc4_31.2: @I.%I.assoc_type (%I.assoc_type) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc4_31.2 (constants.%assoc0)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.325) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
- // CHECK:STDOUT: %F.decl: @I.%F.type (%F.type) = fn_decl @F [symbolic = @I.%F (constants.%F)] {} {}
- // CHECK:STDOUT: %assoc0.loc4_31.1: @I.%I.assoc_type (%I.assoc_type) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc4_31.2 (constants.%assoc0)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self.1
- // CHECK:STDOUT: .F = %assoc0.loc4_31.1
- // CHECK:STDOUT: witness = (%F.decl)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic class @C(%T.loc5_9.1: type) {
- // CHECK:STDOUT: %T.loc5_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_9.2 (constants.%T)]
- // CHECK:STDOUT: %T.patt.loc5_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_9.2 (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT:
- // CHECK:STDOUT: class {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @X {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%X
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @F(@I.%T.loc4_13.1: type, @I.%Self.1: @I.%I.type (%I.type.325)) {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%T) {
- // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
- // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @F(constants.%T, constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(%T.loc4_13.2) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @C(constants.%T) {
- // CHECK:STDOUT: %T.loc5_9.2 => constants.%T
- // CHECK:STDOUT: %T.patt.loc5_9.2 => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- impl_in_interface_args.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %InInterfaceArgs: type = class_type @InInterfaceArgs [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %X: type = class_type @X [template]
- // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [template]
- // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [template]
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %F.type.2ae: type = fn_type @F.1, @I(%T) [symbolic]
- // CHECK:STDOUT: %F.bb2: %F.type.2ae = struct_value () [symbolic]
- // CHECK:STDOUT: %I.assoc_type.955: type = assoc_entity_type %I.type.325 [symbolic]
- // CHECK:STDOUT: %assoc0.249: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.479 [symbolic]
- // CHECK:STDOUT: %I.type.e45: type = facet_type <@I, @I(%InInterfaceArgs)> [template]
- // CHECK:STDOUT: %F.type.14f: type = fn_type @F.1, @I(%InInterfaceArgs) [template]
- // CHECK:STDOUT: %F.b81: %F.type.14f = struct_value () [template]
- // CHECK:STDOUT: %I.assoc_type.9f3: type = assoc_entity_type %I.type.e45 [template]
- // CHECK:STDOUT: %assoc0.055: %I.assoc_type.9f3 = assoc_entity element0, imports.%Main.import_ref.479 [template]
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template]
- // CHECK:STDOUT: %F.type.b63: type = fn_type @F.2 [template]
- // CHECK:STDOUT: %F.d5f: %F.type.b63 = struct_value () [template]
- // CHECK:STDOUT: %I.facet: %I.type.e45 = facet_value %X, %impl_witness [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//types, I, loaded [template = constants.%I.generic]
- // CHECK:STDOUT: %Main.C = import_ref Main//types, C, unloaded
- // CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X]
- // CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.cbe = import_ref Main//types, loc4_31, unloaded
- // CHECK:STDOUT: %Main.F: @I.%F.type (%F.type.2ae) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.bb2)]
- // CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
- // CHECK:STDOUT: %Main.import_ref.479 = import_ref Main//types, loc4_31, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = imports.%Main.I
- // CHECK:STDOUT: .C = imports.%Main.C
- // CHECK:STDOUT: .X = imports.%Main.X
- // CHECK:STDOUT: .InInterfaceArgs = %InInterfaceArgs.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %InInterfaceArgs.decl: type = class_decl @InInterfaceArgs [template = constants.%InInterfaceArgs] {} {}
- // CHECK:STDOUT: impl_decl @impl [template] {} {
- // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [template = constants.%X]
- // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, imports.%Main.I [template = constants.%I.generic]
- // CHECK:STDOUT: %InInterfaceArgs.ref: type = name_ref InInterfaceArgs, file.%InInterfaceArgs.decl [template = constants.%InInterfaceArgs]
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%InInterfaceArgs)> [template = constants.%I.type.e45]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template = constants.%impl_witness]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.325)]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %F.type: type = fn_type @F.1, @I(%T) [symbolic = %F.type (constants.%F.type.2ae)]
- // CHECK:STDOUT: %F: @I.%F.type (%F.type.2ae) = struct_value () [symbolic = %F (constants.%F.bb2)]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I.%I.type (%I.type.325) [symbolic = %I.assoc_type (constants.%I.assoc_type.955)]
- // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.955) = assoc_entity element0, imports.%Main.import_ref.479 [symbolic = %assoc0 (constants.%assoc0.249)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.884
- // CHECK:STDOUT: .F = imports.%Main.import_ref.cbe
- // CHECK:STDOUT: witness = (imports.%Main.F)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: %X.ref as %I.type {
- // CHECK:STDOUT: %F.decl: %F.type.b63 = fn_decl @F.2 [template = constants.%F.d5f] {} {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: witness = file.%impl_witness
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @InInterfaceArgs {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%InInterfaceArgs
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @X [from "types.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.acf
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F.2() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(%T) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%InInterfaceArgs) {
- // CHECK:STDOUT: %T => constants.%InInterfaceArgs
- // CHECK:STDOUT: %T.patt => constants.%InInterfaceArgs
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type => constants.%I.type.e45
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %F.type => constants.%F.type.14f
- // CHECK:STDOUT: %F => constants.%F.b81
- // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.9f3
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.055
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @F.1(constants.%InInterfaceArgs, constants.%I.facet) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_impl_in_interface_args.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %X: type = class_type @X [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %G.type: type = fn_type @G [template]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
- // CHECK:STDOUT: %G: %G.type = struct_value () [template]
- // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [template]
- // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [template]
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %F.type.2ae: type = fn_type @F.1, @I(%T) [symbolic]
- // CHECK:STDOUT: %F.bb2: %F.type.2ae = struct_value () [symbolic]
- // CHECK:STDOUT: %I.assoc_type.955: type = assoc_entity_type %I.type.325 [symbolic]
- // CHECK:STDOUT: %assoc0.62c: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.e54 [symbolic]
- // CHECK:STDOUT: %InInterfaceArgs: type = class_type @InInterfaceArgs [template]
- // CHECK:STDOUT: %I.type.e45: type = facet_type <@I, @I(%InInterfaceArgs)> [template]
- // CHECK:STDOUT: %F.type.14f: type = fn_type @F.1, @I(%InInterfaceArgs) [template]
- // CHECK:STDOUT: %F.b81: %F.type.14f = struct_value () [template]
- // CHECK:STDOUT: %I.assoc_type.9f3: type = assoc_entity_type %I.type.e45 [template]
- // CHECK:STDOUT: %assoc0.0fc: %I.assoc_type.9f3 = assoc_entity element0, imports.%Main.import_ref.e54 [template]
- // CHECK:STDOUT: %assoc0.249: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.479 [symbolic]
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.7f5) [template]
- // CHECK:STDOUT: %I.facet: %I.type.e45 = facet_value %X, %impl_witness [template]
- // CHECK:STDOUT: %.e37: type = fn_type_with_self_type %F.type.14f, %I.facet [template]
- // CHECK:STDOUT: %F.type.b63: type = fn_type @F.2 [template]
- // CHECK:STDOUT: %F.d5f: %F.type.b63 = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//types, I, loaded [template = constants.%I.generic]
- // CHECK:STDOUT: %Main.C = import_ref Main//types, C, unloaded
- // CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X]
- // CHECK:STDOUT: %Main.InInterfaceArgs: type = import_ref Main//impl_in_interface_args, InInterfaceArgs, loaded [template = constants.%InInterfaceArgs]
- // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.cd3: @I.%I.assoc_type (%I.assoc_type.955) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%assoc0 (constants.%assoc0.249)]
- // CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
- // CHECK:STDOUT: %Main.import_ref.e54: @I.%F.type (%F.type.2ae) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%F (constants.%F.bb2)]
- // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//impl_in_interface_args, loc5_24, loaded [template = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.bf8 = import_ref Main//impl_in_interface_args, inst18 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f9f: <witness> = import_ref Main//impl_in_interface_args, loc7_30, loaded [template = constants.%impl_witness]
- // CHECK:STDOUT: %Main.import_ref.956: type = import_ref Main//impl_in_interface_args, loc7_6, loaded [template = constants.%X]
- // CHECK:STDOUT: %Main.import_ref.e8c: type = import_ref Main//impl_in_interface_args, loc7_28, loaded [template = constants.%I.type.e45]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = imports.%Main.I
- // CHECK:STDOUT: .C = imports.%Main.C
- // CHECK:STDOUT: .X = imports.%Main.X
- // CHECK:STDOUT: .InInterfaceArgs = imports.%Main.InInterfaceArgs
- // CHECK:STDOUT: .G = %G.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
- // CHECK:STDOUT: %x.patt: %X = binding_pattern x
- // CHECK:STDOUT: %x.param_patt: %X = value_param_pattern %x.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %x.param: %X = value_param runtime_param0
- // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [template = constants.%X]
- // CHECK:STDOUT: %x: %X = bind_name x, %x.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.325)]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %F.type: type = fn_type @F.1, @I(%T) [symbolic = %F.type (constants.%F.type.2ae)]
- // CHECK:STDOUT: %F: @I.%F.type (%F.type.2ae) = struct_value () [symbolic = %F (constants.%F.bb2)]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I.%I.type (%I.type.325) [symbolic = %I.assoc_type (constants.%I.assoc_type.955)]
- // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.955) = assoc_entity element0, imports.%Main.import_ref.e54 [symbolic = %assoc0 (constants.%assoc0.62c)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.884
- // CHECK:STDOUT: .F = imports.%Main.import_ref.cd3
- // CHECK:STDOUT: witness = (imports.%Main.F)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.956 as imports.%Main.import_ref.e8c [from "impl_in_interface_args.carbon"] {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: witness = imports.%Main.import_ref.f9f
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @X [from "types.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.acf
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @InInterfaceArgs [from "impl_in_interface_args.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.bf8
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @G(%x.param_patt: %X) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %x.ref: %X = name_ref x, %x
- // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, imports.%Main.I [template = constants.%I.generic]
- // CHECK:STDOUT: %InInterfaceArgs.ref: type = name_ref InInterfaceArgs, imports.%Main.InInterfaceArgs [template = constants.%InInterfaceArgs]
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%InInterfaceArgs)> [template = constants.%I.type.e45]
- // CHECK:STDOUT: %.loc6: %I.assoc_type.9f3 = specific_constant imports.%Main.import_ref.cd3, @I(constants.%InInterfaceArgs) [template = constants.%assoc0.0fc]
- // CHECK:STDOUT: %F.ref: %I.assoc_type.9f3 = name_ref F, %.loc6 [template = constants.%assoc0.0fc]
- // CHECK:STDOUT: %impl.elem0: %.e37 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.d5f]
- // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.2: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F.2() [from "impl_in_interface_args.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(%T) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%InInterfaceArgs) {
- // CHECK:STDOUT: %T => constants.%InInterfaceArgs
- // CHECK:STDOUT: %T.patt => constants.%InInterfaceArgs
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type => constants.%I.type.e45
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %F.type => constants.%F.type.14f
- // CHECK:STDOUT: %F => constants.%F.b81
- // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.9f3
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.0fc
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- impl_in_class_args.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %InClassArgs: type = class_type @InClassArgs [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
- // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %C.23b: type = class_type @C, @C(%InClassArgs) [template]
- // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [template]
- // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [template]
- // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %F.type.2ae: type = fn_type @F.1, @I(%T) [symbolic]
- // CHECK:STDOUT: %F.bb2: %F.type.2ae = struct_value () [symbolic]
- // CHECK:STDOUT: %I.assoc_type.955: type = assoc_entity_type %I.type.325 [symbolic]
- // CHECK:STDOUT: %assoc0.249: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.479 [symbolic]
- // CHECK:STDOUT: %X: type = class_type @X [template]
- // CHECK:STDOUT: %I.type.45c: type = facet_type <@I, @I(%X)> [template]
- // CHECK:STDOUT: %F.type.56a: type = fn_type @F.1, @I(%X) [template]
- // CHECK:STDOUT: %F.a79: %F.type.56a = struct_value () [template]
- // CHECK:STDOUT: %I.assoc_type.a7e: type = assoc_entity_type %I.type.45c [template]
- // CHECK:STDOUT: %assoc0.7c6: %I.assoc_type.a7e = assoc_entity element0, imports.%Main.import_ref.479 [template]
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template]
- // CHECK:STDOUT: %F.type.fab: type = fn_type @F.2 [template]
- // CHECK:STDOUT: %F.7ab: %F.type.fab = struct_value () [template]
- // CHECK:STDOUT: %I.facet: %I.type.45c = facet_value %C.23b, %impl_witness [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//types, I, loaded [template = constants.%I.generic]
- // CHECK:STDOUT: %Main.C: %C.type = import_ref Main//types, C, loaded [template = constants.%C.generic]
- // CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X]
- // CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc5_9, loaded [symbolic = @C.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//types, loc5_20, loaded [template = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//types, inst49 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.cbe = import_ref Main//types, loc4_31, unloaded
- // CHECK:STDOUT: %Main.F: @I.%F.type (%F.type.2ae) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.bb2)]
- // CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
- // CHECK:STDOUT: %Main.import_ref.479 = import_ref Main//types, loc4_31, unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = imports.%Main.I
- // CHECK:STDOUT: .C = imports.%Main.C
- // CHECK:STDOUT: .X = imports.%Main.X
- // CHECK:STDOUT: .InClassArgs = %InClassArgs.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %InClassArgs.decl: type = class_decl @InClassArgs [template = constants.%InClassArgs] {} {}
- // CHECK:STDOUT: impl_decl @impl [template] {} {
- // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C.generic]
- // CHECK:STDOUT: %InClassArgs.ref: type = name_ref InClassArgs, file.%InClassArgs.decl [template = constants.%InClassArgs]
- // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%InClassArgs) [template = constants.%C.23b]
- // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, imports.%Main.I [template = constants.%I.generic]
- // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [template = constants.%X]
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%X)> [template = constants.%I.type.45c]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl) [template = constants.%impl_witness]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.2: type) [from "types.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.325)]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %F.type: type = fn_type @F.1, @I(%T) [symbolic = %F.type (constants.%F.type.2ae)]
- // CHECK:STDOUT: %F: @I.%F.type (%F.type.2ae) = struct_value () [symbolic = %F (constants.%F.bb2)]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I.%I.type (%I.type.325) [symbolic = %I.assoc_type (constants.%I.assoc_type.955)]
- // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.955) = assoc_entity element0, imports.%Main.import_ref.479 [symbolic = %assoc0 (constants.%assoc0.249)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.884
- // CHECK:STDOUT: .F = imports.%Main.import_ref.cbe
- // CHECK:STDOUT: witness = (imports.%Main.F)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: %C as %I.type {
- // CHECK:STDOUT: %F.decl: %F.type.fab = fn_decl @F.2 [template = constants.%F.7ab] {} {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: witness = file.%impl_witness
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @InClassArgs {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%InClassArgs
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT:
- // CHECK:STDOUT: class {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.4c0
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @X [from "types.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.acf
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F.2() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @C(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @C(constants.%InClassArgs) {
- // CHECK:STDOUT: %T => constants.%InClassArgs
- // CHECK:STDOUT: %T.patt => constants.%InClassArgs
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(%T) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%X) {
- // CHECK:STDOUT: %T => constants.%X
- // CHECK:STDOUT: %T.patt => constants.%X
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type => constants.%I.type.45c
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %F.type => constants.%F.type.56a
- // CHECK:STDOUT: %F => constants.%F.a79
- // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.a7e
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.7c6
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @F.1(constants.%X, constants.%I.facet) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_impl_in_class_args.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
- // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
- // CHECK:STDOUT: %InClassArgs: type = class_type @InClassArgs [template]
- // CHECK:STDOUT: %C.23b: type = class_type @C, @C(%InClassArgs) [template]
- // CHECK:STDOUT: %H.type: type = fn_type @H [template]
- // CHECK:STDOUT: %H: %H.type = struct_value () [template]
- // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [template]
- // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [template]
- // CHECK:STDOUT: %I.type.325: type = facet_type <@I, @I(%T)> [symbolic]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic]
- // CHECK:STDOUT: %F.type.2ae: type = fn_type @F.1, @I(%T) [symbolic]
- // CHECK:STDOUT: %F.bb2: %F.type.2ae = struct_value () [symbolic]
- // CHECK:STDOUT: %I.assoc_type.955: type = assoc_entity_type %I.type.325 [symbolic]
- // CHECK:STDOUT: %assoc0.62c: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.e54 [symbolic]
- // CHECK:STDOUT: %X: type = class_type @X [template]
- // CHECK:STDOUT: %I.type.45c: type = facet_type <@I, @I(%X)> [template]
- // CHECK:STDOUT: %F.type.56a: type = fn_type @F.1, @I(%X) [template]
- // CHECK:STDOUT: %F.a79: %F.type.56a = struct_value () [template]
- // CHECK:STDOUT: %I.assoc_type.a7e: type = assoc_entity_type %I.type.45c [template]
- // CHECK:STDOUT: %assoc0.ba0: %I.assoc_type.a7e = assoc_entity element0, imports.%Main.import_ref.e54 [template]
- // CHECK:STDOUT: %assoc0.249: %I.assoc_type.955 = assoc_entity element0, imports.%Main.import_ref.479 [symbolic]
- // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.ae4) [template]
- // CHECK:STDOUT: %I.facet: %I.type.45c = facet_value %C.23b, %impl_witness [template]
- // CHECK:STDOUT: %.c87: type = fn_type_with_self_type %F.type.56a, %I.facet [template]
- // CHECK:STDOUT: %F.type.fab: type = fn_type @F.2 [template]
- // CHECK:STDOUT: %F.7ab: %F.type.fab = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: %I.type.dac = import_ref Main//types, I, loaded [template = constants.%I.generic]
- // CHECK:STDOUT: %Main.C: %C.type = import_ref Main//types, C, loaded [template = constants.%C.generic]
- // CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [template = constants.%X]
- // CHECK:STDOUT: %Main.InClassArgs: type = import_ref Main//impl_in_class_args, InClassArgs, loaded [template = constants.%InClassArgs]
- // CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc5_9, loaded [symbolic = @C.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.8f24d3.1: <witness> = import_ref Main//types, loc5_20, loaded [template = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.4c0 = import_ref Main//types, inst49 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.8f24d3.2: <witness> = import_ref Main//impl_in_class_args, loc5_20, loaded [template = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.683 = import_ref Main//impl_in_class_args, inst18 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.cd3: @I.%I.assoc_type (%I.assoc_type.955) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%assoc0 (constants.%assoc0.249)]
- // CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded
- // CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
- // CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
- // CHECK:STDOUT: %Main.import_ref.e54: @I.%F.type (%F.type.2ae) = import_ref Main//types, loc4_31, loaded [symbolic = @I.%F (constants.%F.bb2)]
- // CHECK:STDOUT: %Main.import_ref.8f24d3.3: <witness> = import_ref Main//types, loc7_10, loaded [template = constants.%complete_type]
- // CHECK:STDOUT: %Main.import_ref.acf = import_ref Main//types, inst54 [no loc], unloaded
- // CHECK:STDOUT: %Main.import_ref.6de: <witness> = import_ref Main//impl_in_class_args, loc7_29, loaded [template = constants.%impl_witness]
- // CHECK:STDOUT: %Main.import_ref.d6e: type = import_ref Main//impl_in_class_args, loc7_19, loaded [template = constants.%C.23b]
- // CHECK:STDOUT: %Main.import_ref.208: type = import_ref Main//impl_in_class_args, loc7_27, loaded [template = constants.%I.type.45c]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = imports.%Main.I
- // CHECK:STDOUT: .C = imports.%Main.C
- // CHECK:STDOUT: .X = imports.%Main.X
- // CHECK:STDOUT: .InClassArgs = imports.%Main.InClassArgs
- // CHECK:STDOUT: .H = %H.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {
- // CHECK:STDOUT: %c.patt: %C.23b = binding_pattern c
- // CHECK:STDOUT: %c.param_patt: %C.23b = value_param_pattern %c.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %c.param: %C.23b = value_param runtime_param0
- // CHECK:STDOUT: %.loc6_22: type = splice_block %C [template = constants.%C.23b] {
- // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [template = constants.%C.generic]
- // CHECK:STDOUT: %InClassArgs.ref: type = name_ref InClassArgs, imports.%Main.InClassArgs [template = constants.%InClassArgs]
- // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%InClassArgs) [template = constants.%C.23b]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: %C.23b = bind_name c, %c.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic interface @I(imports.%Main.import_ref.f6b058.2: type) [from "types.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.325)]
- // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)]
- // CHECK:STDOUT: %F.type: type = fn_type @F.1, @I(%T) [symbolic = %F.type (constants.%F.type.2ae)]
- // CHECK:STDOUT: %F: @I.%F.type (%F.type.2ae) = struct_value () [symbolic = %F (constants.%F.bb2)]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I.%I.type (%I.type.325) [symbolic = %I.assoc_type (constants.%I.assoc_type.955)]
- // CHECK:STDOUT: %assoc0: @I.%I.assoc_type (%I.assoc_type.955) = assoc_entity element0, imports.%Main.import_ref.e54 [symbolic = %assoc0 (constants.%assoc0.62c)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.884
- // CHECK:STDOUT: .F = imports.%Main.import_ref.cd3
- // CHECK:STDOUT: witness = (imports.%Main.F)
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: impl @impl: imports.%Main.import_ref.d6e as imports.%Main.import_ref.208 [from "impl_in_class_args.carbon"] {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: witness = imports.%Main.import_ref.6de
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic class @C(imports.%Main.import_ref.f6b058.1: type) [from "types.carbon"] {
- // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT:
- // CHECK:STDOUT: class {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.4c0
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @InClassArgs [from "impl_in_class_args.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.683
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @X [from "types.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f24d3.3
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Main.import_ref.acf
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @H(%c.param_patt: %C.23b) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %c.ref: %C.23b = name_ref c, %c
- // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, imports.%Main.I [template = constants.%I.generic]
- // CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [template = constants.%X]
- // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%X)> [template = constants.%I.type.45c]
- // CHECK:STDOUT: %.loc6_34: %I.assoc_type.a7e = specific_constant imports.%Main.import_ref.cd3, @I(constants.%X) [template = constants.%assoc0.ba0]
- // CHECK:STDOUT: %F.ref: %I.assoc_type.a7e = name_ref F, %.loc6_34 [template = constants.%assoc0.ba0]
- // CHECK:STDOUT: %impl.elem0: %.c87 = impl_witness_access constants.%impl_witness, element0 [template = constants.%F.7ab]
- // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f6b058.3: type, imports.%Main.import_ref.38e: @I.%I.type (%I.type.325)) [from "types.carbon"] {
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F.2() [from "impl_in_class_args.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @C(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @C(constants.%InClassArgs) {
- // CHECK:STDOUT: %T => constants.%InClassArgs
- // CHECK:STDOUT: %T.patt => constants.%InClassArgs
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%T) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %T.patt => constants.%T
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(%T) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @F.1(constants.%T, constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @I(constants.%X) {
- // CHECK:STDOUT: %T => constants.%X
- // CHECK:STDOUT: %T.patt => constants.%X
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %I.type => constants.%I.type.45c
- // CHECK:STDOUT: %Self => constants.%Self
- // CHECK:STDOUT: %F.type => constants.%F.type.56a
- // CHECK:STDOUT: %F => constants.%F.a79
- // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.a7e
- // CHECK:STDOUT: %assoc0 => constants.%assoc0.ba0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|