mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 07:01:06 +01:00
Find impl witnesses in facets (#5060)
Impl lookup for an interface `I` for a facet with facet type requiring an interface `I` will now succeed, getting the witness from the facet. --------- Co-authored-by: Josh L <josh11b@users.noreply.github.com> Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
co-authored by
Josh L
Dana Jansens
parent
d3869a529b
commit
ea1a0c8b84
@@ -8,6 +8,8 @@
|
||||
#include "toolchain/check/diagnostic_helpers.h"
|
||||
#include "toolchain/check/generic.h"
|
||||
#include "toolchain/check/import_ref.h"
|
||||
#include "toolchain/check/inst.h"
|
||||
#include "toolchain/check/type.h"
|
||||
#include "toolchain/check/type_completion.h"
|
||||
#include "toolchain/sem_ir/ids.h"
|
||||
#include "toolchain/sem_ir/impl.h"
|
||||
@@ -296,6 +298,59 @@ static auto GetWitnessIdForImpl(
|
||||
context.sem_ir(), specific_id, impl.witness_id));
|
||||
}
|
||||
|
||||
// In the case where `facet_const_id` is a facet, see if its facet type requires
|
||||
// that `specific_interface` is implemented. If so, return the witness from the
|
||||
// facet.
|
||||
static auto FindWitnessInFacet(
|
||||
Context& context, SemIR::LocId loc_id, SemIR::ConstantId facet_const_id,
|
||||
const SemIR::SpecificInterface& specific_interface) -> SemIR::InstId {
|
||||
SemIR::InstId facet_inst_id =
|
||||
context.constant_values().GetInstId(facet_const_id);
|
||||
// TODO: Should we convert from a FacetAccessType to its facet here?
|
||||
SemIR::TypeId facet_type_id = context.insts().Get(facet_inst_id).type_id();
|
||||
if (auto facet_type_inst =
|
||||
context.types().TryGetAs<SemIR::FacetType>(facet_type_id)) {
|
||||
auto complete_facet_type_id = RequireCompleteFacetType(
|
||||
context, facet_type_id, loc_id, *facet_type_inst,
|
||||
[&]() -> DiagnosticBuilder {
|
||||
// TODO: Find test that triggers this code path.
|
||||
CARBON_FATAL("impl lookup for with incomplete facet type");
|
||||
});
|
||||
if (complete_facet_type_id.has_value()) {
|
||||
const auto& complete_facet_type =
|
||||
context.complete_facet_types().Get(complete_facet_type_id);
|
||||
for (auto interface : complete_facet_type.required_interfaces) {
|
||||
if (interface == specific_interface) {
|
||||
// TODO: Need to get the right witness when there are multiple.
|
||||
return GetOrAddInst(
|
||||
context, loc_id,
|
||||
SemIR::FacetAccessWitness{
|
||||
.type_id = GetSingletonType(
|
||||
context, SemIR::WitnessType::SingletonInstId),
|
||||
.facet_value_inst_id = facet_inst_id});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return SemIR::InstId::None;
|
||||
}
|
||||
|
||||
static auto FindWitnessInImpls(
|
||||
Context& context, SemIR::LocId loc_id, SemIR::ConstantId type_const_id,
|
||||
const SemIR::SpecificInterface& specific_interface) -> SemIR::InstId {
|
||||
auto& stack = context.impl_lookup_stack();
|
||||
for (const auto& impl : context.impls().array_ref()) {
|
||||
stack.back().impl_loc = impl.definition_id;
|
||||
auto result_witness_id = GetWitnessIdForImpl(context, loc_id, type_const_id,
|
||||
specific_interface, impl);
|
||||
if (result_witness_id.has_value()) {
|
||||
// We found a matching impl; don't keep looking for this interface.
|
||||
return result_witness_id;
|
||||
}
|
||||
}
|
||||
return SemIR::InstId::None;
|
||||
}
|
||||
|
||||
auto LookupImplWitness(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::ConstantId type_const_id,
|
||||
SemIR::ConstantId interface_const_id) -> SemIR::InstId {
|
||||
@@ -346,26 +401,25 @@ auto LookupImplWitness(Context& context, SemIR::LocId loc_id,
|
||||
// them in the same order as they are found in the `CompleteFacetType`, which
|
||||
// is the same order as in `interfaces` here.
|
||||
for (const auto& interface : interfaces) {
|
||||
bool found_witness = false;
|
||||
for (const auto& impl : context.impls().array_ref()) {
|
||||
stack.back().impl_loc = impl.definition_id;
|
||||
auto result_witness_id =
|
||||
GetWitnessIdForImpl(context, loc_id, type_const_id, interface, impl);
|
||||
if (result_witness_id.has_value()) {
|
||||
result_witness_ids.push_back(result_witness_id);
|
||||
// We found a matching impl; don't keep looking for this `interface`,
|
||||
// move onto the next.
|
||||
found_witness = true;
|
||||
break;
|
||||
}
|
||||
// TODO: Since both `interfaces` and `type_const_id` are sorted lists, do an
|
||||
// O(N+M) merge instead of O(N*M) nested loops.
|
||||
auto result_witness_id =
|
||||
FindWitnessInFacet(context, loc_id, type_const_id, interface);
|
||||
if (!result_witness_id.has_value()) {
|
||||
result_witness_id =
|
||||
FindWitnessInImpls(context, loc_id, type_const_id, interface);
|
||||
}
|
||||
if (!found_witness) {
|
||||
if (result_witness_id.has_value()) {
|
||||
result_witness_ids.push_back(result_witness_id);
|
||||
} else {
|
||||
// At least one queried interface in the facet type has no witness for the
|
||||
// given type, we can stop looking for more.
|
||||
break;
|
||||
}
|
||||
}
|
||||
stack.pop_back();
|
||||
// TODO: Validate that the witness satisfies the other requirements in
|
||||
// `interface_const_id`.
|
||||
|
||||
// All interfaces in the query facet type must have been found to be available
|
||||
// through some impl (TODO: or directly on the type itself if `type_const_id`
|
||||
|
||||
+1284
File diff suppressed because it is too large
Load Diff
-598
@@ -1,598 +0,0 @@
|
||||
// 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/builtin_conversions/no_prelude/fail_todo_convert_facet_value_to_narrowed_facet_type.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtin_conversions/no_prelude/fail_todo_convert_facet_value_to_narrowed_facet_type.carbon
|
||||
|
||||
// --- core.carbon
|
||||
|
||||
package Core;
|
||||
|
||||
interface ImplicitAs(T:! type) {
|
||||
fn Convert[self: Self]() -> T;
|
||||
}
|
||||
|
||||
interface BitAnd {
|
||||
fn Op[self: Self](other: Self) -> Self;
|
||||
}
|
||||
|
||||
impl forall [T:! type] T as BitAnd {
|
||||
fn Op[self: Self](other: Self) -> Self = "type.and";
|
||||
}
|
||||
|
||||
// --- fail_todo_convert_to_narrowed_facet_type.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Core;
|
||||
|
||||
interface Eats {}
|
||||
interface Animal {}
|
||||
|
||||
fn Feed[T:! Eats](e: T) {}
|
||||
|
||||
// CHECK:STDERR: fail_todo_convert_to_narrowed_facet_type.carbon:[[@LINE+10]]:44: error: cannot implicitly convert value of type `type` to `Eats` [ImplicitAsConversionFailure]
|
||||
// CHECK:STDERR: fn HandleAnimal[T:! Animal & Eats](a: T) { Feed(a); }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_convert_to_narrowed_facet_type.carbon:[[@LINE+7]]:44: note: type `type` does not implement interface `Core.ImplicitAs(Eats)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: fn HandleAnimal[T:! Animal & Eats](a: T) { Feed(a); }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_convert_to_narrowed_facet_type.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn Feed[T:! Eats](e: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn HandleAnimal[T:! Animal & Eats](a: T) { Feed(a); }
|
||||
|
||||
// CHECK:STDOUT: --- core.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: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%T) [symbolic]
|
||||
// CHECK:STDOUT: %Convert: %Convert.type = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type %ImplicitAs.type.07f [symbolic]
|
||||
// CHECK:STDOUT: %assoc0.a50: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic]
|
||||
// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
|
||||
// CHECK:STDOUT: %Self.e44: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Self.as_type.560: type = facet_access_type %Self.e44 [symbolic]
|
||||
// CHECK:STDOUT: %Op.type.613: type = fn_type @Op.1 [concrete]
|
||||
// CHECK:STDOUT: %Op.d98: %Op.type.613 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type %BitAnd.type [concrete]
|
||||
// CHECK:STDOUT: %assoc0.121: %BitAnd.assoc_type = assoc_entity element0, @BitAnd.%Op.decl [concrete]
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl), @impl(%T) [symbolic]
|
||||
// CHECK:STDOUT: %Op.type.28d: type = fn_type @Op.2, @impl(%T) [symbolic]
|
||||
// CHECK:STDOUT: %Op.902: %Op.type.28d = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
|
||||
// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %T, %impl_witness [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
|
||||
// CHECK:STDOUT: .BitAnd = %BitAnd.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
|
||||
// CHECK:STDOUT: %T.patt.loc4_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_22.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc4_22.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_22.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [concrete = constants.%BitAnd.type] {} {}
|
||||
// CHECK:STDOUT: impl_decl @impl [concrete] {
|
||||
// CHECK:STDOUT: %T.patt.loc12_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_14.1 [symbolic = %T.loc12_14.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, file.%BitAnd.decl [concrete = constants.%BitAnd.type]
|
||||
// CHECK:STDOUT: %T.loc12_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc4_22.1: type) {
|
||||
// CHECK:STDOUT: %T.loc4_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_22.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc4_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_22.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc4_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
|
||||
// CHECK:STDOUT: %Self.2: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
|
||||
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%T.loc4_22.2) [symbolic = %Convert.type (constants.%Convert.type)]
|
||||
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type) = struct_value () [symbolic = %Convert (constants.%Convert)]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)]
|
||||
// CHECK:STDOUT: %assoc0.loc5_32.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc5_32.2 (constants.%assoc0.a50)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)]
|
||||
// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type) = fn_decl @Convert [symbolic = @ImplicitAs.%Convert (constants.%Convert)] {
|
||||
// CHECK:STDOUT: %self.patt: @Convert.%Self.as_type.loc5_20.1 (%Self.as_type.419) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @Convert.%Self.as_type.loc5_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0
|
||||
// CHECK:STDOUT: %return.patt: @Convert.%T (%T) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @Convert.%T (%T) = out_param_pattern %return.patt, call_param1
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc4_22.1 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %self.param: @Convert.%Self.as_type.loc5_20.1 (%Self.as_type.419) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc5_20.1: type = splice_block %.loc5_20.3 [symbolic = %Self.as_type.loc5_20.1 (constants.%Self.as_type.419)] {
|
||||
// CHECK:STDOUT: %.loc5_20.2: @Convert.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.0f3)]
|
||||
// CHECK:STDOUT: %Self.ref: @Convert.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc5_20.2 [symbolic = %Self (constants.%Self.0f3)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc5_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_20.1 (constants.%Self.as_type.419)]
|
||||
// CHECK:STDOUT: %.loc5_20.3: type = converted %Self.ref, %Self.as_type.loc5_20.2 [symbolic = %Self.as_type.loc5_20.1 (constants.%Self.as_type.419)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: @Convert.%Self.as_type.loc5_20.1 (%Self.as_type.419) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %return.param: ref @Convert.%T (%T) = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref @Convert.%T (%T) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %assoc0.loc5_32.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc5_32.2 (constants.%assoc0.a50)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.1
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .Convert = %assoc0.loc5_32.1
|
||||
// CHECK:STDOUT: witness = (%Convert.decl)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @BitAnd {
|
||||
// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e44]
|
||||
// CHECK:STDOUT: %Op.decl: %Op.type.613 = fn_decl @Op.1 [concrete = constants.%Op.d98] {
|
||||
// CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = value_param_pattern %self.patt, call_param0
|
||||
// CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = value_param_pattern %other.patt, call_param1
|
||||
// CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = out_param_pattern %return.patt, call_param2
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc9_37: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_37: type = facet_access_type %Self.ref.loc9_37 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)]
|
||||
// CHECK:STDOUT: %.loc9_37: type = converted %Self.ref.loc9_37, %Self.as_type.loc9_37 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)]
|
||||
// CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc9_15.1: type = splice_block %.loc9_15.2 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)] {
|
||||
// CHECK:STDOUT: %Self.ref.loc9_15: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_15.2: type = facet_access_type %Self.ref.loc9_15 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)]
|
||||
// CHECK:STDOUT: %.loc9_15.2: type = converted %Self.ref.loc9_15, %Self.as_type.loc9_15.2 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc9_28.1: type = splice_block %.loc9_28.2 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)] {
|
||||
// CHECK:STDOUT: %Self.ref.loc9_28: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_28: type = facet_access_type %Self.ref.loc9_28 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)]
|
||||
// CHECK:STDOUT: %.loc9_28.2: type = converted %Self.ref.loc9_28, %Self.as_type.loc9_28 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = bind_name other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %assoc0: %BitAnd.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.121]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: .Op = %assoc0
|
||||
// CHECK:STDOUT: witness = (%Op.decl)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic impl @impl(%T.loc12_14.1: type) {
|
||||
// CHECK:STDOUT: %T.loc12_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_14.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc12_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc12_14.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (%Op.decl), @impl(%T.loc12_14.2) [symbolic = %impl_witness (constants.%impl_witness)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%T.loc12_14.2) [symbolic = %Op.type (constants.%Op.type.28d)]
|
||||
// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.28d) = struct_value () [symbolic = %Op (constants.%Op.902)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.%T.loc12_14.2 (%T) [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl: %T.ref as %BitAnd.ref {
|
||||
// CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.28d) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.902)] {
|
||||
// CHECK:STDOUT: %self.patt: @Op.2.%T (%T) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @Op.2.%T (%T) = value_param_pattern %self.patt, call_param0
|
||||
// CHECK:STDOUT: %other.patt: @Op.2.%T (%T) = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: @Op.2.%T (%T) = value_param_pattern %other.patt, call_param1
|
||||
// CHECK:STDOUT: %return.patt: @Op.2.%T (%T) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @Op.2.%T (%T) = out_param_pattern %return.patt, call_param2
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc13_37: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %self.param: @Op.2.%T (%T) = value_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref.loc13_15: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %self: @Op.2.%T (%T) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @Op.2.%T (%T) = value_param call_param1
|
||||
// CHECK:STDOUT: %Self.ref.loc13_28: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %other: @Op.2.%T (%T) = bind_name other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @Op.2.%T (%T) = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref @Op.2.%T (%T) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Op = %Op.decl
|
||||
// CHECK:STDOUT: witness = file.%impl_witness
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Convert(@ImplicitAs.%T.loc4_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)]
|
||||
// CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc5_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_20.1 (constants.%Self.as_type.419)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type.loc5_20.1 (%Self.as_type.419)]() -> @Convert.%T (%T);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Op.1(@BitAnd.%Self: %BitAnd.type) {
|
||||
// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.e44)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.560)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560)](%other.param_patt: @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560)) -> @Op.1.%Self.as_type.loc9_15.1 (%Self.as_type.560);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Op.2(@impl.%T.loc12_14.1: type) {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_22.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc4_22.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Convert(constants.%T, constants.%Self.0f3) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f
|
||||
// CHECK:STDOUT: %Self => constants.%Self.0f3
|
||||
// CHECK:STDOUT: %Self.as_type.loc5_20.1 => constants.%Self.as_type.419
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(@Convert.%T) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(%T.loc4_22.2) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.1(constants.%Self.e44) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self.e44
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_15.1 => constants.%Self.as_type.560
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc12_14.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc12_14.2 => constants.%T
|
||||
// CHECK:STDOUT: %impl_witness => constants.%impl_witness
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(%T.loc12_14.2) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.2(constants.%T) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.1(constants.%BitAnd.facet) {
|
||||
// CHECK:STDOUT: %Self => constants.%BitAnd.facet
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_15.1 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_convert_to_narrowed_facet_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Eats.type: type = facet_type <@Eats> [concrete]
|
||||
// CHECK:STDOUT: %Self.1b5: %Eats.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Animal.type: type = facet_type <@Animal> [concrete]
|
||||
// CHECK:STDOUT: %Self.fd4: %Animal.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.1b5: %Eats.type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.patt.6be: %Eats.type = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.as_type.27d: type = facet_access_type %T.1b5 [symbolic]
|
||||
// CHECK:STDOUT: %Feed.type: type = fn_type @Feed [concrete]
|
||||
// CHECK:STDOUT: %Feed: %Feed.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.c75: <witness> = require_complete_type %T.as_type.27d [symbolic]
|
||||
// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete]
|
||||
// CHECK:STDOUT: %Self.25f: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type %BitAnd.type [concrete]
|
||||
// CHECK:STDOUT: %assoc0.a63: %BitAnd.assoc_type = assoc_entity element0, imports.%Core.import_ref.a93 [concrete]
|
||||
// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.patt.e01: type = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %impl_witness.db8: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl(%T.8b3) [symbolic]
|
||||
// CHECK:STDOUT: %Op.type.f99: type = fn_type @Op.1, @impl(%T.8b3) [symbolic]
|
||||
// CHECK:STDOUT: %Op.05a: %Op.type.f99 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T.8b3 [symbolic]
|
||||
// CHECK:STDOUT: %impl_witness.3ea: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl(type) [concrete]
|
||||
// CHECK:STDOUT: %impl_witness.b81: <witness> = impl_witness (imports.%Core.import_ref.bd4), @impl(%T.8b3) [symbolic]
|
||||
// CHECK:STDOUT: %Op.type.eb8: type = fn_type @Op.1, @impl(type) [concrete]
|
||||
// CHECK:STDOUT: %Op.444: %Op.type.eb8 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness type [concrete]
|
||||
// CHECK:STDOUT: %Op.type.27a: type = fn_type @Op.2 [concrete]
|
||||
// CHECK:STDOUT: %Self.as_type.19f: type = facet_access_type %Self.25f [symbolic]
|
||||
// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value type, %impl_witness.3ea [concrete]
|
||||
// CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %Op.type.27a, %BitAnd.facet [concrete]
|
||||
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %Animal.type, %Op.444 [concrete]
|
||||
// CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.bound, @Op.1(type) [concrete]
|
||||
// CHECK:STDOUT: %facet_type: type = facet_type <@Eats & @Animal> [concrete]
|
||||
// CHECK:STDOUT: %T.ec1: %facet_type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.patt.cdd: %facet_type = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.as_type.3bf: type = facet_access_type %T.ec1 [symbolic]
|
||||
// CHECK:STDOUT: %HandleAnimal.type: type = fn_type @HandleAnimal [concrete]
|
||||
// CHECK:STDOUT: %HandleAnimal: %HandleAnimal.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.680: <witness> = require_complete_type %T.as_type.3bf [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%T.8b3)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%T.8b3) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Self.as_type.40a: type = facet_access_type %Self.519 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type.837: type = assoc_entity_type %ImplicitAs.type.d62 [symbolic]
|
||||
// CHECK:STDOUT: %assoc0.43db8b.1: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207961.1 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.af9: type = facet_type <@ImplicitAs, @ImplicitAs(%Eats.type)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.9a9: type = fn_type @Convert, @ImplicitAs(%Eats.type) [concrete]
|
||||
// CHECK:STDOUT: %Convert.35d: %Convert.type.9a9 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type.9a7: type = assoc_entity_type %ImplicitAs.type.af9 [concrete]
|
||||
// CHECK:STDOUT: %assoc0.152: %ImplicitAs.assoc_type.9a7 = assoc_entity element0, imports.%Core.import_ref.207961.1 [concrete]
|
||||
// CHECK:STDOUT: %assoc0.43db8b.2: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207961.2 [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .BitAnd = %Core.BitAnd
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//default
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//default, inst59 [no loc], unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//default, loc9_41, loaded [concrete = constants.%assoc0.a63]
|
||||
// CHECK:STDOUT: %Core.Op = import_ref Core//default, Op, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.51c: <witness> = import_ref Core//default, loc12_36, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.b81)]
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc12_14, loaded [symbolic = @impl.%T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//default, loc12_24, loaded [symbolic = @impl.%T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//default, loc12_29, loaded [concrete = constants.%BitAnd.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.1e6: @impl.%Op.type (%Op.type.f99) = import_ref Core//default, loc13_42, loaded [symbolic = @impl.%Op (constants.%Op.05a)]
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc12_14, loaded [symbolic = @impl.%T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//default, inst59 [no loc], loaded [symbolic = constants.%Self.25f]
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//default, loc4_22, loaded [symbolic = @ImplicitAs.%T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst24 [no loc], unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc5_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)]
|
||||
// CHECK:STDOUT: %Core.Convert = import_ref Core//default, Convert, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//default, loc4_22, loaded [symbolic = @ImplicitAs.%T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst24 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
|
||||
// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc5_32, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Eats = %Eats.decl
|
||||
// CHECK:STDOUT: .Animal = %Animal.decl
|
||||
// CHECK:STDOUT: .Feed = %Feed.decl
|
||||
// CHECK:STDOUT: .HandleAnimal = %HandleAnimal.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Eats.decl: type = interface_decl @Eats [concrete = constants.%Eats.type] {} {}
|
||||
// CHECK:STDOUT: %Animal.decl: type = interface_decl @Animal [concrete = constants.%Animal.type] {} {}
|
||||
// CHECK:STDOUT: %Feed.decl: %Feed.type = fn_decl @Feed [concrete = constants.%Feed] {
|
||||
// CHECK:STDOUT: %T.patt.loc9_9.1: %Eats.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_9.2 (constants.%T.patt.6be)]
|
||||
// CHECK:STDOUT: %e.patt: @Feed.%T.as_type.loc9_22.2 (%T.as_type.27d) = binding_pattern e
|
||||
// CHECK:STDOUT: %e.param_patt: @Feed.%T.as_type.loc9_22.2 (%T.as_type.27d) = value_param_pattern %e.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type]
|
||||
// CHECK:STDOUT: %T.loc9_9.1: %Eats.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_9.2 (constants.%T.1b5)]
|
||||
// CHECK:STDOUT: %e.param: @Feed.%T.as_type.loc9_22.2 (%T.as_type.27d) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc9_22.1: type = splice_block %.loc9_22.2 [symbolic = %T.as_type.loc9_22.2 (constants.%T.as_type.27d)] {
|
||||
// CHECK:STDOUT: %T.ref: %Eats.type = name_ref T, %T.loc9_9.1 [symbolic = %T.loc9_9.2 (constants.%T.1b5)]
|
||||
// CHECK:STDOUT: %T.as_type.loc9_22.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc9_22.2 (constants.%T.as_type.27d)]
|
||||
// CHECK:STDOUT: %.loc9_22.2: type = converted %T.ref, %T.as_type.loc9_22.1 [symbolic = %T.as_type.loc9_22.2 (constants.%T.as_type.27d)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: @Feed.%T.as_type.loc9_22.2 (%T.as_type.27d) = bind_name e, %e.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %HandleAnimal.decl: %HandleAnimal.type = fn_decl @HandleAnimal [concrete = constants.%HandleAnimal] {
|
||||
// CHECK:STDOUT: %T.patt.loc21_17.1: %facet_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_17.2 (constants.%T.patt.cdd)]
|
||||
// CHECK:STDOUT: %a.patt: @HandleAnimal.%T.as_type.loc21_39.2 (%T.as_type.3bf) = binding_pattern a
|
||||
// CHECK:STDOUT: %a.param_patt: @HandleAnimal.%T.as_type.loc21_39.2 (%T.as_type.3bf) = value_param_pattern %a.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc21_28.1: type = splice_block %.loc21_28.3 [concrete = constants.%facet_type] {
|
||||
// CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type]
|
||||
// CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type]
|
||||
// CHECK:STDOUT: %impl.elem0: %.d4d = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Op.1(type) [concrete = constants.%Op.specific_fn]
|
||||
// CHECK:STDOUT: %type.and: init type = call %specific_fn(%Animal.ref, %Eats.ref) [concrete = constants.%facet_type]
|
||||
// CHECK:STDOUT: %.loc21_28.2: type = value_of_initializer %type.and [concrete = constants.%facet_type]
|
||||
// CHECK:STDOUT: %.loc21_28.3: type = converted %type.and, %.loc21_28.2 [concrete = constants.%facet_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc21_17.1: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc21_17.2 (constants.%T.ec1)]
|
||||
// CHECK:STDOUT: %a.param: @HandleAnimal.%T.as_type.loc21_39.2 (%T.as_type.3bf) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc21_39.1: type = splice_block %.loc21_39.2 [symbolic = %T.as_type.loc21_39.2 (constants.%T.as_type.3bf)] {
|
||||
// CHECK:STDOUT: %T.ref: %facet_type = name_ref T, %T.loc21_17.1 [symbolic = %T.loc21_17.2 (constants.%T.ec1)]
|
||||
// CHECK:STDOUT: %T.as_type.loc21_39.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc21_39.2 (constants.%T.as_type.3bf)]
|
||||
// CHECK:STDOUT: %.loc21_39.2: type = converted %T.ref, %T.as_type.loc21_39.1 [symbolic = %T.as_type.loc21_39.2 (constants.%T.as_type.3bf)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: @HandleAnimal.%T.as_type.loc21_39.2 (%T.as_type.3bf) = bind_name a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @Eats {
|
||||
// CHECK:STDOUT: %Self: %Eats.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1b5]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @Animal {
|
||||
// CHECK:STDOUT: %Self: %Animal.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.fd4]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @BitAnd [from "core.carbon"] {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0
|
||||
// CHECK:STDOUT: .Op = imports.%Core.import_ref.08d
|
||||
// CHECK:STDOUT: witness = (imports.%Core.Op)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.3: type) [from "core.carbon"] {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.e01)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
|
||||
// CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
|
||||
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%T) [symbolic = %Convert.type (constants.%Convert.type.275)]
|
||||
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = struct_value () [symbolic = %Convert (constants.%Convert.42e)]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.837)]
|
||||
// CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = assoc_entity element0, imports.%Core.import_ref.207961.1 [symbolic = %assoc0 (constants.%assoc0.43db8b.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Core.import_ref.ff5
|
||||
// CHECK:STDOUT: .Convert = imports.%Core.import_ref.630
|
||||
// CHECK:STDOUT: witness = (imports.%Core.Convert)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.e01)]
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Core.import_ref.1e6), @impl(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @impl(%T) [symbolic = %Op.type (constants.%Op.type.f99)]
|
||||
// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.f99) = struct_value () [symbolic = %Op (constants.%Op.05a)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.%T (%T.8b3) [symbolic = %require_complete (constants.%require_complete.4ae)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl: imports.%Core.import_ref.583 as imports.%Core.import_ref.9c1 {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: witness = imports.%Core.import_ref.51c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Feed(%T.loc9_9.1: %Eats.type) {
|
||||
// CHECK:STDOUT: %T.loc9_9.2: %Eats.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_9.2 (constants.%T.1b5)]
|
||||
// CHECK:STDOUT: %T.patt.loc9_9.2: %Eats.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_9.2 (constants.%T.patt.6be)]
|
||||
// CHECK:STDOUT: %T.as_type.loc9_22.2: type = facet_access_type %T.loc9_9.2 [symbolic = %T.as_type.loc9_22.2 (constants.%T.as_type.27d)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Feed.%T.as_type.loc9_22.2 (%T.as_type.27d) [symbolic = %require_complete (constants.%require_complete.c75)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%T.patt.loc9_9.1: %Eats.type](%e.param_patt: @Feed.%T.as_type.loc9_22.2 (%T.as_type.27d)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.5ab3ec.2: type) [from "core.carbon"] {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%T (%T.8b3)](%other.param_patt: @Op.1.%T (%T.8b3)) -> @Op.1.%T (%T.8b3) = "type.and";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.040: %BitAnd.type) [from "core.carbon"] {
|
||||
// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)]
|
||||
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.19f)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self.as_type (%Self.as_type.19f)](%other.param_patt: @Op.2.%Self.as_type (%Self.as_type.19f)) -> @Op.2.%Self.as_type (%Self.as_type.19f);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @HandleAnimal(%T.loc21_17.1: %facet_type) {
|
||||
// CHECK:STDOUT: %T.loc21_17.2: %facet_type = bind_symbolic_name T, 0 [symbolic = %T.loc21_17.2 (constants.%T.ec1)]
|
||||
// CHECK:STDOUT: %T.patt.loc21_17.2: %facet_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_17.2 (constants.%T.patt.cdd)]
|
||||
// CHECK:STDOUT: %T.as_type.loc21_39.2: type = facet_access_type %T.loc21_17.2 [symbolic = %T.as_type.loc21_39.2 (constants.%T.as_type.3bf)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @HandleAnimal.%T.as_type.loc21_39.2 (%T.as_type.3bf) [symbolic = %require_complete (constants.%require_complete.680)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%T.patt.loc21_17.1: %facet_type](%a.param_patt: @HandleAnimal.%T.as_type.loc21_39.2 (%T.as_type.3bf)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Feed.ref: %Feed.type = name_ref Feed, file.%Feed.decl [concrete = constants.%Feed]
|
||||
// CHECK:STDOUT: %a.ref: @HandleAnimal.%T.as_type.loc21_39.2 (%T.as_type.3bf) = name_ref a, %a
|
||||
// CHECK:STDOUT: %.loc21_50: %Eats.type = converted constants.%T.as_type.3bf, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
|
||||
// CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
|
||||
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.40a)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type.40a)]() -> @Convert.%T (%T.8b3);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Feed(constants.%T.1b5) {
|
||||
// CHECK:STDOUT: %T.loc9_9.2 => constants.%T.1b5
|
||||
// CHECK:STDOUT: %T.patt.loc9_9.2 => constants.%T.1b5
|
||||
// CHECK:STDOUT: %T.as_type.loc9_22.2 => constants.%T.as_type.27d
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(constants.%T.8b3) {
|
||||
// CHECK:STDOUT: %T => constants.%T.8b3
|
||||
// CHECK:STDOUT: %T.patt => constants.%T.8b3
|
||||
// CHECK:STDOUT: %impl_witness => constants.%impl_witness.db8
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(%T) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.1(constants.%T.8b3) {
|
||||
// CHECK:STDOUT: %T => constants.%T.8b3
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(type) {
|
||||
// CHECK:STDOUT: %T => type
|
||||
// CHECK:STDOUT: %T.patt => type
|
||||
// CHECK:STDOUT: %impl_witness => constants.%impl_witness.3ea
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Op.type => constants.%Op.type.eb8
|
||||
// CHECK:STDOUT: %Op => constants.%Op.444
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.2(constants.%Self.25f) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self.25f
|
||||
// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.19f
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.1(type) {
|
||||
// CHECK:STDOUT: %T => type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @HandleAnimal(constants.%T.ec1) {
|
||||
// CHECK:STDOUT: %T.loc21_17.2 => constants.%T.ec1
|
||||
// CHECK:STDOUT: %T.patt.loc21_17.2 => constants.%T.ec1
|
||||
// CHECK:STDOUT: %T.as_type.loc21_39.2 => constants.%T.as_type.3bf
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%T.8b3) {
|
||||
// CHECK:STDOUT: %T => constants.%T.8b3
|
||||
// CHECK:STDOUT: %T.patt => constants.%T.8b3
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(%T) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(@Convert.%T) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Convert(constants.%T.8b3, constants.%Self.519) {
|
||||
// CHECK:STDOUT: %T => constants.%T.8b3
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62
|
||||
// CHECK:STDOUT: %Self => constants.%Self.519
|
||||
// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.40a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%Eats.type) {
|
||||
// CHECK:STDOUT: %T => constants.%Eats.type
|
||||
// CHECK:STDOUT: %T.patt => constants.%Eats.type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.af9
|
||||
// CHECK:STDOUT: %Self => constants.%Self.519
|
||||
// CHECK:STDOUT: %Convert.type => constants.%Convert.type.9a9
|
||||
// CHECK:STDOUT: %Convert => constants.%Convert.35d
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.9a7
|
||||
// CHECK:STDOUT: %assoc0 => constants.%assoc0.152
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -33,20 +33,6 @@ fn TestSpecific(a: A({})) -> {} {
|
||||
return a.(I({}).F)();
|
||||
}
|
||||
|
||||
// --- find_blanket_impl.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
interface B {}
|
||||
interface C {}
|
||||
|
||||
impl forall [T:! B] T as C {}
|
||||
|
||||
fn FC[TC:! C](xc: TC) {}
|
||||
|
||||
fn FB[TB:! B](xb: TB) {
|
||||
FC(xb);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- impl_forall.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -577,204 +563,3 @@ fn FB[TB:! B](xb: TB) {
|
||||
// CHECK:STDOUT: %A.elem => constants.%A.elem.2af
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- find_blanket_impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %B.type: type = facet_type <@B> [concrete]
|
||||
// CHECK:STDOUT: %Self.783: %B.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %C.type: type = facet_type <@C> [concrete]
|
||||
// CHECK:STDOUT: %Self.02e: %C.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T: %B.type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.patt: %B.type = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %impl_witness.1431bd.1: <witness> = impl_witness (), @impl(%T) [symbolic]
|
||||
// CHECK:STDOUT: %TC: %C.type = bind_symbolic_name TC, 0 [symbolic]
|
||||
// CHECK:STDOUT: %TC.patt: %C.type = symbolic_binding_pattern TC, 0 [symbolic]
|
||||
// CHECK:STDOUT: %TC.as_type: type = facet_access_type %TC [symbolic]
|
||||
// CHECK:STDOUT: %FC.type: type = fn_type @FC [concrete]
|
||||
// CHECK:STDOUT: %FC: %FC.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.8ca: <witness> = require_complete_type %TC.as_type [symbolic]
|
||||
// CHECK:STDOUT: %TB: %B.type = bind_symbolic_name TB, 0 [symbolic]
|
||||
// CHECK:STDOUT: %TB.patt: %B.type = symbolic_binding_pattern TB, 0 [symbolic]
|
||||
// CHECK:STDOUT: %TB.as_type: type = facet_access_type %TB [symbolic]
|
||||
// CHECK:STDOUT: %FB.type: type = fn_type @FB [concrete]
|
||||
// CHECK:STDOUT: %FB: %FB.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.e08: <witness> = require_complete_type %TB.as_type [symbolic]
|
||||
// CHECK:STDOUT: %impl_witness.1431bd.2: <witness> = impl_witness (), @impl(%TB) [symbolic]
|
||||
// CHECK:STDOUT: %C.facet: %C.type = facet_value %TB.as_type, %impl_witness.1431bd.2 [symbolic]
|
||||
// CHECK:STDOUT: %FC.specific_fn: <specific function> = specific_function %FC, @FC(%C.facet) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .B = %B.decl
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .FC = %FC.decl
|
||||
// CHECK:STDOUT: .FB = %FB.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %B.decl: type = interface_decl @B [concrete = constants.%B.type] {} {}
|
||||
// CHECK:STDOUT: %C.decl: type = interface_decl @C [concrete = constants.%C.type] {} {}
|
||||
// CHECK:STDOUT: impl_decl @impl [concrete] {
|
||||
// CHECK:STDOUT: %T.patt.loc6_14.1: %B.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_14.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.ref: %B.type = name_ref T, %T.loc6_14.1 [symbolic = %T.loc6_14.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type.loc6_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc6_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc6: type = converted %T.ref, %T.as_type.loc6_21.1 [symbolic = %T.as_type.loc6_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C.type]
|
||||
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B.type]
|
||||
// CHECK:STDOUT: %T.loc6_14.1: %B.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_14.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness.1431bd.1)]
|
||||
// CHECK:STDOUT: %FC.decl: %FC.type = fn_decl @FC [concrete = constants.%FC] {
|
||||
// CHECK:STDOUT: %TC.patt.loc8_7.1: %C.type = symbolic_binding_pattern TC, 0 [symbolic = %TC.patt.loc8_7.2 (constants.%TC.patt)]
|
||||
// CHECK:STDOUT: %xc.patt: @FC.%TC.as_type.loc8_19.2 (%TC.as_type) = binding_pattern xc
|
||||
// CHECK:STDOUT: %xc.param_patt: @FC.%TC.as_type.loc8_19.2 (%TC.as_type) = value_param_pattern %xc.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C.type]
|
||||
// CHECK:STDOUT: %TC.loc8_7.1: %C.type = bind_symbolic_name TC, 0 [symbolic = %TC.loc8_7.2 (constants.%TC)]
|
||||
// CHECK:STDOUT: %xc.param: @FC.%TC.as_type.loc8_19.2 (%TC.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.2 [symbolic = %TC.as_type.loc8_19.2 (constants.%TC.as_type)] {
|
||||
// CHECK:STDOUT: %TC.ref: %C.type = name_ref TC, %TC.loc8_7.1 [symbolic = %TC.loc8_7.2 (constants.%TC)]
|
||||
// CHECK:STDOUT: %TC.as_type.loc8_19.1: type = facet_access_type %TC.ref [symbolic = %TC.as_type.loc8_19.2 (constants.%TC.as_type)]
|
||||
// CHECK:STDOUT: %.loc8_19.2: type = converted %TC.ref, %TC.as_type.loc8_19.1 [symbolic = %TC.as_type.loc8_19.2 (constants.%TC.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %xc: @FC.%TC.as_type.loc8_19.2 (%TC.as_type) = bind_name xc, %xc.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %FB.decl: %FB.type = fn_decl @FB [concrete = constants.%FB] {
|
||||
// CHECK:STDOUT: %TB.patt.loc10_7.1: %B.type = symbolic_binding_pattern TB, 0 [symbolic = %TB.patt.loc10_7.2 (constants.%TB.patt)]
|
||||
// CHECK:STDOUT: %xb.patt: @FB.%TB.as_type.loc10_19.2 (%TB.as_type) = binding_pattern xb
|
||||
// CHECK:STDOUT: %xb.param_patt: @FB.%TB.as_type.loc10_19.2 (%TB.as_type) = value_param_pattern %xb.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B.type]
|
||||
// CHECK:STDOUT: %TB.loc10_7.1: %B.type = bind_symbolic_name TB, 0 [symbolic = %TB.loc10_7.2 (constants.%TB)]
|
||||
// CHECK:STDOUT: %xb.param: @FB.%TB.as_type.loc10_19.2 (%TB.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc10_19.1: type = splice_block %.loc10_19.2 [symbolic = %TB.as_type.loc10_19.2 (constants.%TB.as_type)] {
|
||||
// CHECK:STDOUT: %TB.ref: %B.type = name_ref TB, %TB.loc10_7.1 [symbolic = %TB.loc10_7.2 (constants.%TB)]
|
||||
// CHECK:STDOUT: %TB.as_type.loc10_19.1: type = facet_access_type %TB.ref [symbolic = %TB.as_type.loc10_19.2 (constants.%TB.as_type)]
|
||||
// CHECK:STDOUT: %.loc10_19.2: type = converted %TB.ref, %TB.as_type.loc10_19.1 [symbolic = %TB.as_type.loc10_19.2 (constants.%TB.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %xb: @FB.%TB.as_type.loc10_19.2 (%TB.as_type) = bind_name xb, %xb.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @B {
|
||||
// CHECK:STDOUT: %Self: %B.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.783]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @C {
|
||||
// CHECK:STDOUT: %Self: %C.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.02e]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic impl @impl(%T.loc6_14.1: %B.type) {
|
||||
// CHECK:STDOUT: %T.loc6_14.2: %B.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_14.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc6_14.2: %B.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_14.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.as_type.loc6_21.2: type = facet_access_type %T.loc6_14.2 [symbolic = %T.as_type.loc6_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl(%T.loc6_14.2) [symbolic = %impl_witness (constants.%impl_witness.1431bd.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl: %.loc6 as %C.ref {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: witness = file.%impl_witness
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @FC(%TC.loc8_7.1: %C.type) {
|
||||
// CHECK:STDOUT: %TC.loc8_7.2: %C.type = bind_symbolic_name TC, 0 [symbolic = %TC.loc8_7.2 (constants.%TC)]
|
||||
// CHECK:STDOUT: %TC.patt.loc8_7.2: %C.type = symbolic_binding_pattern TC, 0 [symbolic = %TC.patt.loc8_7.2 (constants.%TC.patt)]
|
||||
// CHECK:STDOUT: %TC.as_type.loc8_19.2: type = facet_access_type %TC.loc8_7.2 [symbolic = %TC.as_type.loc8_19.2 (constants.%TC.as_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @FC.%TC.as_type.loc8_19.2 (%TC.as_type) [symbolic = %require_complete (constants.%require_complete.8ca)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%TC.patt.loc8_7.1: %C.type](%xc.param_patt: @FC.%TC.as_type.loc8_19.2 (%TC.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @FB(%TB.loc10_7.1: %B.type) {
|
||||
// CHECK:STDOUT: %TB.loc10_7.2: %B.type = bind_symbolic_name TB, 0 [symbolic = %TB.loc10_7.2 (constants.%TB)]
|
||||
// CHECK:STDOUT: %TB.patt.loc10_7.2: %B.type = symbolic_binding_pattern TB, 0 [symbolic = %TB.patt.loc10_7.2 (constants.%TB.patt)]
|
||||
// CHECK:STDOUT: %TB.as_type.loc10_19.2: type = facet_access_type %TB.loc10_7.2 [symbolic = %TB.as_type.loc10_19.2 (constants.%TB.as_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @FB.%TB.as_type.loc10_19.2 (%TB.as_type) [symbolic = %require_complete (constants.%require_complete.e08)]
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (), @impl(%TB.loc10_7.2) [symbolic = %impl_witness (constants.%impl_witness.1431bd.2)]
|
||||
// CHECK:STDOUT: %C.facet.loc11_8.3: %C.type = facet_value %TB.as_type.loc10_19.2, %impl_witness [symbolic = %C.facet.loc11_8.3 (constants.%C.facet)]
|
||||
// CHECK:STDOUT: %FC.specific_fn.loc11_3.2: <specific function> = specific_function constants.%FC, @FC(%C.facet.loc11_8.3) [symbolic = %FC.specific_fn.loc11_3.2 (constants.%FC.specific_fn)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%TB.patt.loc10_7.1: %B.type](%xb.param_patt: @FB.%TB.as_type.loc10_19.2 (%TB.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %FC.ref: %FC.type = name_ref FC, file.%FC.decl [concrete = constants.%FC]
|
||||
// CHECK:STDOUT: %xb.ref: @FB.%TB.as_type.loc10_19.2 (%TB.as_type) = name_ref xb, %xb
|
||||
// CHECK:STDOUT: %TB.as_type.loc11_8.1: type = facet_access_type constants.%TB [symbolic = %TB.as_type.loc10_19.2 (constants.%TB.as_type)]
|
||||
// CHECK:STDOUT: %.loc11_8.1: type = converted constants.%TB, %TB.as_type.loc11_8.1 [symbolic = %TB.as_type.loc10_19.2 (constants.%TB.as_type)]
|
||||
// CHECK:STDOUT: %.loc11_8.2: %B.type = converted %.loc11_8.1, constants.%TB [symbolic = %TB.loc10_7.2 (constants.%TB)]
|
||||
// CHECK:STDOUT: %.loc11_8.3: %B.type = converted constants.%TB.as_type, constants.%TB [symbolic = %TB.loc10_7.2 (constants.%TB)]
|
||||
// CHECK:STDOUT: %C.facet.loc11_8.1: %C.type = facet_value constants.%TB.as_type, constants.%impl_witness.1431bd.2 [symbolic = %C.facet.loc11_8.3 (constants.%C.facet)]
|
||||
// CHECK:STDOUT: %.loc11_8.4: %C.type = converted constants.%TB.as_type, %C.facet.loc11_8.1 [symbolic = %C.facet.loc11_8.3 (constants.%C.facet)]
|
||||
// CHECK:STDOUT: %TB.as_type.loc11_8.2: type = facet_access_type constants.%TB [symbolic = %TB.as_type.loc10_19.2 (constants.%TB.as_type)]
|
||||
// CHECK:STDOUT: %.loc11_8.5: type = converted constants.%TB, %TB.as_type.loc11_8.2 [symbolic = %TB.as_type.loc10_19.2 (constants.%TB.as_type)]
|
||||
// CHECK:STDOUT: %.loc11_8.6: %B.type = converted %.loc11_8.5, constants.%TB [symbolic = %TB.loc10_7.2 (constants.%TB)]
|
||||
// CHECK:STDOUT: %.loc11_8.7: %B.type = converted constants.%TB.as_type, constants.%TB [symbolic = %TB.loc10_7.2 (constants.%TB)]
|
||||
// CHECK:STDOUT: %C.facet.loc11_8.2: %C.type = facet_value constants.%TB.as_type, constants.%impl_witness.1431bd.2 [symbolic = %C.facet.loc11_8.3 (constants.%C.facet)]
|
||||
// CHECK:STDOUT: %.loc11_8.8: %C.type = converted constants.%TB.as_type, %C.facet.loc11_8.2 [symbolic = %C.facet.loc11_8.3 (constants.%C.facet)]
|
||||
// CHECK:STDOUT: %FC.specific_fn.loc11_3.1: <specific function> = specific_function %FC.ref, @FC(constants.%C.facet) [symbolic = %FC.specific_fn.loc11_3.2 (constants.%FC.specific_fn)]
|
||||
// CHECK:STDOUT: %FC.call: init %empty_tuple.type = call %FC.specific_fn.loc11_3.1(%xb.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc6_14.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc6_14.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.as_type.loc6_21.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1431bd.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(%T.loc6_14.2) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @FC(constants.%TC) {
|
||||
// CHECK:STDOUT: %TC.loc8_7.2 => constants.%TC
|
||||
// CHECK:STDOUT: %TC.patt.loc8_7.2 => constants.%TC
|
||||
// CHECK:STDOUT: %TC.as_type.loc8_19.2 => constants.%TC.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @FB(constants.%TB) {
|
||||
// CHECK:STDOUT: %TB.loc10_7.2 => constants.%TB
|
||||
// CHECK:STDOUT: %TB.patt.loc10_7.2 => constants.%TB
|
||||
// CHECK:STDOUT: %TB.as_type.loc10_19.2 => constants.%TB.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(constants.%TB) {
|
||||
// CHECK:STDOUT: %T.loc6_14.2 => constants.%TB
|
||||
// CHECK:STDOUT: %T.patt.loc6_14.2 => constants.%TB
|
||||
// CHECK:STDOUT: %T.as_type.loc6_21.2 => constants.%TB.as_type
|
||||
// CHECK:STDOUT: %impl_witness => constants.%impl_witness.1431bd.2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @FC(constants.%C.facet) {
|
||||
// CHECK:STDOUT: %TC.loc8_7.2 => constants.%C.facet
|
||||
// CHECK:STDOUT: %TC.patt.loc8_7.2 => constants.%C.facet
|
||||
// CHECK:STDOUT: %TC.as_type.loc8_19.2 => constants.%TB.as_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.e08
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(@FB.%TB.loc10_7.2) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @FC(@FB.%C.facet.loc11_8.3) {}
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/no_prelude/subtyping.carbon
|
||||
|
||||
// --- fail_todo_equivalent.carbon
|
||||
// This is testing `FindWitnessInFacet` from impl_lookup.cpp
|
||||
|
||||
// --- equivalent.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
interface A {}
|
||||
@@ -16,17 +18,10 @@ interface A {}
|
||||
fn TakesA[T:! A](x: T) {}
|
||||
|
||||
fn WithExtraWhere[U:! A where .Self impls type](y: U) {
|
||||
// CHECK:STDERR: fail_todo_equivalent.carbon:[[@LINE+7]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
|
||||
// CHECK:STDERR: TakesA(y);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_equivalent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn TakesA[T:! A](x: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
TakesA(y);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- fail_todo_equivalent.carbon
|
||||
// CHECK:STDOUT: --- equivalent.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
|
||||
@@ -35,6 +30,7 @@ fn WithExtraWhere[U:! A where .Self impls type](y: U) {
|
||||
// CHECK:STDOUT: %T.patt: %A.type = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
|
||||
// CHECK:STDOUT: %TakesA.type: type = fn_type @TakesA [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %TakesA: %TakesA.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.cf4: <witness> = require_complete_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %.Self: %A.type = bind_symbolic_name .Self [symbolic_self]
|
||||
@@ -46,6 +42,9 @@ fn WithExtraWhere[U:! A where .Self impls type](y: U) {
|
||||
// CHECK:STDOUT: %WithExtraWhere.type: type = fn_type @WithExtraWhere [concrete]
|
||||
// CHECK:STDOUT: %WithExtraWhere: %WithExtraWhere.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.732: <witness> = require_complete_type %U.as_type [symbolic]
|
||||
// CHECK:STDOUT: %U.as_wit: <witness> = facet_access_witness %U [symbolic]
|
||||
// CHECK:STDOUT: %A.facet: %A.type = facet_value %U.as_type, %U.as_wit [symbolic]
|
||||
// CHECK:STDOUT: %TakesA.specific_fn: <specific function> = specific_function %TakesA, @TakesA(%A.facet) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -125,12 +124,22 @@ fn WithExtraWhere[U:! A where .Self impls type](y: U) {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @WithExtraWhere.%U.as_type.loc7_52.2 (%U.as_type) [symbolic = %require_complete (constants.%require_complete.732)]
|
||||
// CHECK:STDOUT: %U.as_wit.loc8_11.3: <witness> = facet_access_witness %U.loc7_19.2 [symbolic = %U.as_wit.loc8_11.3 (constants.%U.as_wit)]
|
||||
// CHECK:STDOUT: %A.facet.loc8_11.3: %A.type = facet_value %U.as_type.loc7_52.2, %U.as_wit.loc8_11.3 [symbolic = %A.facet.loc8_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %TakesA.specific_fn.loc8_3.2: <specific function> = specific_function constants.%TakesA, @TakesA(%A.facet.loc8_11.3) [symbolic = %TakesA.specific_fn.loc8_3.2 (constants.%TakesA.specific_fn)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%U.patt.loc7_19.1: %A_where.type](%y.param_patt: @WithExtraWhere.%U.as_type.loc7_52.2 (%U.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %TakesA.ref: %TakesA.type = name_ref TakesA, file.%TakesA.decl [concrete = constants.%TakesA]
|
||||
// CHECK:STDOUT: %y.ref: @WithExtraWhere.%U.as_type.loc7_52.2 (%U.as_type) = name_ref y, %y
|
||||
// CHECK:STDOUT: %.loc15: %A.type = converted constants.%U.as_type, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %U.as_wit.loc8_11.1: <witness> = facet_access_witness constants.%U [symbolic = %U.as_wit.loc8_11.3 (constants.%U.as_wit)]
|
||||
// CHECK:STDOUT: %A.facet.loc8_11.1: %A.type = facet_value constants.%U.as_type, %U.as_wit.loc8_11.1 [symbolic = %A.facet.loc8_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %.loc8_11.1: %A.type = converted constants.%U.as_type, %A.facet.loc8_11.1 [symbolic = %A.facet.loc8_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %U.as_wit.loc8_11.2: <witness> = facet_access_witness constants.%U [symbolic = %U.as_wit.loc8_11.3 (constants.%U.as_wit)]
|
||||
// CHECK:STDOUT: %A.facet.loc8_11.2: %A.type = facet_value constants.%U.as_type, %U.as_wit.loc8_11.2 [symbolic = %A.facet.loc8_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %.loc8_11.2: %A.type = converted constants.%U.as_type, %A.facet.loc8_11.2 [symbolic = %A.facet.loc8_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %TakesA.specific_fn.loc8_3.1: <specific function> = specific_function %TakesA.ref, @TakesA(constants.%A.facet) [symbolic = %TakesA.specific_fn.loc8_3.2 (constants.%TakesA.specific_fn)]
|
||||
// CHECK:STDOUT: %TakesA.call: init %empty_tuple.type = call %TakesA.specific_fn.loc8_3.1(%y.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -147,3 +156,14 @@ fn WithExtraWhere[U:! A where .Self impls type](y: U) {
|
||||
// CHECK:STDOUT: %U.as_type.loc7_52.2 => constants.%U.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesA(constants.%A.facet) {
|
||||
// CHECK:STDOUT: %T.loc5_11.2 => constants.%A.facet
|
||||
// CHECK:STDOUT: %T.patt.loc5_11.2 => constants.%A.facet
|
||||
// CHECK:STDOUT: %T.as_type.loc5_21.2 => constants.%U.as_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.732
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesA(@WithExtraWhere.%A.facet.loc8_11.3) {}
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user