mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:00:11 +01:00
Narrowing facet type conversion tests (#5172)
Merges in the "subtyping" tests from the `impl/lookup` directory along with some new tests into `convert_facet_value_to_narrowed_facet_type.carbon` in the `facet` directory. Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
Vendored
+712
@@ -49,6 +49,65 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) {
|
||||
FeedTame2(w);
|
||||
}
|
||||
|
||||
// --- equivalent.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// This is testing `FindWitnessInFacet` from impl_lookup.cpp
|
||||
|
||||
interface A {}
|
||||
|
||||
fn TakesA[T:! A](x: T) {}
|
||||
|
||||
fn WithExtraWhere[U:! A where .Self impls type](y: U) {
|
||||
TakesA(y);
|
||||
}
|
||||
|
||||
// --- no_interfaces_success.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn TakesTypeDeduced[T:! type](x: T) {}
|
||||
fn CallsWithExtraWhere[U:! type where .Self impls type](y: U) {
|
||||
TakesTypeDeduced(y);
|
||||
}
|
||||
|
||||
fn TakesTypeExplicit(T:! type) {}
|
||||
fn CallsWithExtraWhereExplicit(U:! type where .Self impls type) {
|
||||
TakesTypeExplicit(U);
|
||||
}
|
||||
|
||||
// --- fail_todo_no_interfaces.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn TakesExtraWhereDeduced[T:! type where .Self impls type](x: T) {}
|
||||
fn CallsWithType[U:! type](y: U) {
|
||||
// CHECK:STDERR: fail_todo_no_interfaces.carbon:[[@LINE+10]]:3: error: cannot implicitly convert type `U` into type implementing `type where...` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: TakesExtraWhereDeduced(y);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_no_interfaces.carbon:[[@LINE+7]]:3: note: type `type` does not implement interface `Core.ImplicitAs(type where...)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: TakesExtraWhereDeduced(y);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_no_interfaces.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn TakesExtraWhereDeduced[T:! type where .Self impls type](x: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
TakesExtraWhereDeduced(y);
|
||||
}
|
||||
|
||||
fn TakesExtraWhereExplicit(T:! type where .Self impls type) {}
|
||||
fn CallsWithTypeExplicit(U:! type) {
|
||||
// CHECK:STDERR: fail_todo_no_interfaces.carbon:[[@LINE+10]]:3: error: cannot implicitly convert type `U` into type implementing `type where...` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: TakesExtraWhereExplicit(U);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_no_interfaces.carbon:[[@LINE+7]]:3: note: type `type` does not implement interface `Core.ImplicitAs(type where...)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: TakesExtraWhereExplicit(U);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_no_interfaces.carbon:[[@LINE-8]]:28: note: initializing generic parameter `T` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn TakesExtraWhereExplicit(T:! type where .Self impls type) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
TakesExtraWhereExplicit(U);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- convert_to_narrowed_facet_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -989,6 +1048,659 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @FeedTame2(@HandleTameAnimal2.%facet_value.loc12_14.3) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- equivalent.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
|
||||
// CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T: %A.type = bind_symbolic_name T, 0 [symbolic]
|
||||
// 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]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
|
||||
// CHECK:STDOUT: %A_where.type: type = facet_type <@A where TODO> [concrete]
|
||||
// CHECK:STDOUT: %U: %A_where.type = bind_symbolic_name U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %U.patt: %A_where.type = symbolic_binding_pattern U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %U.as_type: type = facet_access_type %U [symbolic]
|
||||
// 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.iface0: <witness> = facet_access_witness %U, element0 [symbolic]
|
||||
// CHECK:STDOUT: %A.facet: %A.type = facet_value %U.as_type, (%U.as_wit.iface0) [symbolic]
|
||||
// CHECK:STDOUT: %TakesA.specific_fn: <specific function> = specific_function %TakesA, @TakesA(%A.facet) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .A = %A.decl
|
||||
// CHECK:STDOUT: .TakesA = %TakesA.decl
|
||||
// CHECK:STDOUT: .WithExtraWhere = %WithExtraWhere.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
|
||||
// CHECK:STDOUT: %TakesA.decl: %TakesA.type = fn_decl @TakesA [concrete = constants.%TakesA] {
|
||||
// CHECK:STDOUT: %T.patt.loc7_11.1: %A.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_11.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %x.patt: @TakesA.%T.as_type.loc7_21.2 (%T.as_type) = binding_pattern x
|
||||
// CHECK:STDOUT: %x.param_patt: @TakesA.%T.as_type.loc7_21.2 (%T.as_type) = value_param_pattern %x.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
|
||||
// CHECK:STDOUT: %T.loc7_11.1: %A.type = bind_symbolic_name T, 0 [symbolic = %T.loc7_11.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @TakesA.%T.as_type.loc7_21.2 (%T.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc7_21.1: type = splice_block %.loc7_21.2 [symbolic = %T.as_type.loc7_21.2 (constants.%T.as_type)] {
|
||||
// CHECK:STDOUT: %T.ref: %A.type = name_ref T, %T.loc7_11.1 [symbolic = %T.loc7_11.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type.loc7_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc7_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc7_21.2: type = converted %T.ref, %T.as_type.loc7_21.1 [symbolic = %T.as_type.loc7_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @TakesA.%T.as_type.loc7_21.2 (%T.as_type) = bind_name x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %WithExtraWhere.decl: %WithExtraWhere.type = fn_decl @WithExtraWhere [concrete = constants.%WithExtraWhere] {
|
||||
// CHECK:STDOUT: %U.patt.loc9_19.1: %A_where.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_19.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %y.patt: @WithExtraWhere.%U.as_type.loc9_52.2 (%U.as_type) = binding_pattern y
|
||||
// CHECK:STDOUT: %y.param_patt: @WithExtraWhere.%U.as_type.loc9_52.2 (%U.as_type) = value_param_pattern %y.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc9_25.1: type = splice_block %.loc9_25.2 [concrete = constants.%A_where.type] {
|
||||
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
|
||||
// CHECK:STDOUT: %.Self: %A.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: %A.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc9_31: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc9_25.2: type = where_expr %.Self [concrete = constants.%A_where.type] {
|
||||
// CHECK:STDOUT: requirement_impls %.loc9_31, type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc9_19.1: %A_where.type = bind_symbolic_name U, 0 [symbolic = %U.loc9_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %y.param: @WithExtraWhere.%U.as_type.loc9_52.2 (%U.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc9_52.1: type = splice_block %.loc9_52.2 [symbolic = %U.as_type.loc9_52.2 (constants.%U.as_type)] {
|
||||
// CHECK:STDOUT: %U.ref: %A_where.type = name_ref U, %U.loc9_19.1 [symbolic = %U.loc9_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.as_type.loc9_52.1: type = facet_access_type %U.ref [symbolic = %U.as_type.loc9_52.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: %.loc9_52.2: type = converted %U.ref, %U.as_type.loc9_52.1 [symbolic = %U.as_type.loc9_52.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: @WithExtraWhere.%U.as_type.loc9_52.2 (%U.as_type) = bind_name y, %y.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @A {
|
||||
// CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @TakesA(%T.loc7_11.1: %A.type) {
|
||||
// CHECK:STDOUT: %T.loc7_11.2: %A.type = bind_symbolic_name T, 0 [symbolic = %T.loc7_11.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc7_11.2: %A.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_11.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.as_type.loc7_21.2: type = facet_access_type %T.loc7_11.2 [symbolic = %T.as_type.loc7_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @TakesA.%T.as_type.loc7_21.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.cf4)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%T.patt.loc7_11.1: %A.type](%x.param_patt: @TakesA.%T.as_type.loc7_21.2 (%T.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @WithExtraWhere(%U.loc9_19.1: %A_where.type) {
|
||||
// CHECK:STDOUT: %U.loc9_19.2: %A_where.type = bind_symbolic_name U, 0 [symbolic = %U.loc9_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.patt.loc9_19.2: %A_where.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_19.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %U.as_type.loc9_52.2: type = facet_access_type %U.loc9_19.2 [symbolic = %U.as_type.loc9_52.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @WithExtraWhere.%U.as_type.loc9_52.2 (%U.as_type) [symbolic = %require_complete (constants.%require_complete.732)]
|
||||
// CHECK:STDOUT: %U.as_wit.iface0.loc10_11.3: <witness> = facet_access_witness %U.loc9_19.2, element0 [symbolic = %U.as_wit.iface0.loc10_11.3 (constants.%U.as_wit.iface0)]
|
||||
// CHECK:STDOUT: %A.facet.loc10_11.3: %A.type = facet_value %U.as_type.loc9_52.2, (%U.as_wit.iface0.loc10_11.3) [symbolic = %A.facet.loc10_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %TakesA.specific_fn.loc10_3.2: <specific function> = specific_function constants.%TakesA, @TakesA(%A.facet.loc10_11.3) [symbolic = %TakesA.specific_fn.loc10_3.2 (constants.%TakesA.specific_fn)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%U.patt.loc9_19.1: %A_where.type](%y.param_patt: @WithExtraWhere.%U.as_type.loc9_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.loc9_52.2 (%U.as_type) = name_ref y, %y
|
||||
// CHECK:STDOUT: %U.as_wit.iface0.loc10_11.1: <witness> = facet_access_witness constants.%U, element0 [symbolic = %U.as_wit.iface0.loc10_11.3 (constants.%U.as_wit.iface0)]
|
||||
// CHECK:STDOUT: %A.facet.loc10_11.1: %A.type = facet_value constants.%U.as_type, (%U.as_wit.iface0.loc10_11.1) [symbolic = %A.facet.loc10_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %.loc10_11.1: %A.type = converted constants.%U.as_type, %A.facet.loc10_11.1 [symbolic = %A.facet.loc10_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %U.as_wit.iface0.loc10_11.2: <witness> = facet_access_witness constants.%U, element0 [symbolic = %U.as_wit.iface0.loc10_11.3 (constants.%U.as_wit.iface0)]
|
||||
// CHECK:STDOUT: %A.facet.loc10_11.2: %A.type = facet_value constants.%U.as_type, (%U.as_wit.iface0.loc10_11.2) [symbolic = %A.facet.loc10_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %.loc10_11.2: %A.type = converted constants.%U.as_type, %A.facet.loc10_11.2 [symbolic = %A.facet.loc10_11.3 (constants.%A.facet)]
|
||||
// CHECK:STDOUT: %TakesA.specific_fn.loc10_3.1: <specific function> = specific_function %TakesA.ref, @TakesA(constants.%A.facet) [symbolic = %TakesA.specific_fn.loc10_3.2 (constants.%TakesA.specific_fn)]
|
||||
// CHECK:STDOUT: %TakesA.call: init %empty_tuple.type = call %TakesA.specific_fn.loc10_3.1(%y.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesA(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc7_11.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc7_11.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.as_type.loc7_21.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @WithExtraWhere(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc9_19.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.patt.loc9_19.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.as_type.loc9_52.2 => constants.%U.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesA(constants.%A.facet) {
|
||||
// CHECK:STDOUT: %T.loc7_11.2 => constants.%A.facet
|
||||
// CHECK:STDOUT: %T.patt.loc7_11.2 => constants.%A.facet
|
||||
// CHECK:STDOUT: %T.as_type.loc7_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.loc10_11.3) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- no_interfaces_success.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: %TakesTypeDeduced.type: type = fn_type @TakesTypeDeduced [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %TakesTypeDeduced: %TakesTypeDeduced.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where TODO> [concrete]
|
||||
// CHECK:STDOUT: %U: %type_where = bind_symbolic_name U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %U.patt: %type_where = symbolic_binding_pattern U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %U.as_type: type = facet_access_type %U [symbolic]
|
||||
// CHECK:STDOUT: %CallsWithExtraWhere.type: type = fn_type @CallsWithExtraWhere [concrete]
|
||||
// CHECK:STDOUT: %CallsWithExtraWhere: %CallsWithExtraWhere.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.220: <witness> = require_complete_type %U.as_type [symbolic]
|
||||
// CHECK:STDOUT: %TakesTypeDeduced.specific_fn: <specific function> = specific_function %TakesTypeDeduced, @TakesTypeDeduced(%U.as_type) [symbolic]
|
||||
// CHECK:STDOUT: %TakesTypeExplicit.type: type = fn_type @TakesTypeExplicit [concrete]
|
||||
// CHECK:STDOUT: %TakesTypeExplicit: %TakesTypeExplicit.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %CallsWithExtraWhereExplicit.type: type = fn_type @CallsWithExtraWhereExplicit [concrete]
|
||||
// CHECK:STDOUT: %CallsWithExtraWhereExplicit: %CallsWithExtraWhereExplicit.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %TakesTypeExplicit.specific_fn: <specific function> = specific_function %TakesTypeExplicit, @TakesTypeExplicit(%U.as_type) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .TakesTypeDeduced = %TakesTypeDeduced.decl
|
||||
// CHECK:STDOUT: .CallsWithExtraWhere = %CallsWithExtraWhere.decl
|
||||
// CHECK:STDOUT: .TakesTypeExplicit = %TakesTypeExplicit.decl
|
||||
// CHECK:STDOUT: .CallsWithExtraWhereExplicit = %CallsWithExtraWhereExplicit.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %TakesTypeDeduced.decl: %TakesTypeDeduced.type = fn_decl @TakesTypeDeduced [concrete = constants.%TakesTypeDeduced] {
|
||||
// CHECK:STDOUT: %T.patt.loc3_21.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc3_21.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %x.patt: @TakesTypeDeduced.%T.loc3_21.2 (%T) = binding_pattern x
|
||||
// CHECK:STDOUT: %x.param_patt: @TakesTypeDeduced.%T.loc3_21.2 (%T) = value_param_pattern %x.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc3_21.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc3_21.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @TakesTypeDeduced.%T.loc3_21.2 (%T) = value_param call_param0
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc3_21.1 [symbolic = %T.loc3_21.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %x: @TakesTypeDeduced.%T.loc3_21.2 (%T) = bind_name x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallsWithExtraWhere.decl: %CallsWithExtraWhere.type = fn_decl @CallsWithExtraWhere [concrete = constants.%CallsWithExtraWhere] {
|
||||
// CHECK:STDOUT: %U.patt.loc4_24.1: %type_where = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc4_24.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %y.patt: @CallsWithExtraWhere.%U.as_type.loc4_60.2 (%U.as_type) = binding_pattern y
|
||||
// CHECK:STDOUT: %y.param_patt: @CallsWithExtraWhere.%U.as_type.loc4_60.2 (%U.as_type) = value_param_pattern %y.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc4_33.1: type = splice_block %.loc4_33.2 [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.loc4_33.2: type = where_expr %.Self [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: requirement_impls %.Self.ref, type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc4_24.1: %type_where = bind_symbolic_name U, 0 [symbolic = %U.loc4_24.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %y.param: @CallsWithExtraWhere.%U.as_type.loc4_60.2 (%U.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_60.1: type = splice_block %.loc4_60.2 [symbolic = %U.as_type.loc4_60.2 (constants.%U.as_type)] {
|
||||
// CHECK:STDOUT: %U.ref: %type_where = name_ref U, %U.loc4_24.1 [symbolic = %U.loc4_24.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.as_type.loc4_60.1: type = facet_access_type %U.ref [symbolic = %U.as_type.loc4_60.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: %.loc4_60.2: type = converted %U.ref, %U.as_type.loc4_60.1 [symbolic = %U.as_type.loc4_60.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: @CallsWithExtraWhere.%U.as_type.loc4_60.2 (%U.as_type) = bind_name y, %y.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %TakesTypeExplicit.decl: %TakesTypeExplicit.type = fn_decl @TakesTypeExplicit [concrete = constants.%TakesTypeExplicit] {
|
||||
// CHECK:STDOUT: %T.patt.loc8_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_22.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc8_22.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_22.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallsWithExtraWhereExplicit.decl: %CallsWithExtraWhereExplicit.type = fn_decl @CallsWithExtraWhereExplicit [concrete = constants.%CallsWithExtraWhereExplicit] {
|
||||
// CHECK:STDOUT: %U.patt.loc9_32.1: %type_where = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_32.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc9_41.1: type = splice_block %.loc9_41.2 [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.loc9_41.2: type = where_expr %.Self [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: requirement_impls %.Self.ref, type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc9_32.1: %type_where = bind_symbolic_name U, 0 [symbolic = %U.loc9_32.2 (constants.%U)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @TakesTypeDeduced(%T.loc3_21.1: type) {
|
||||
// CHECK:STDOUT: %T.loc3_21.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc3_21.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc3_21.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc3_21.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @TakesTypeDeduced.%T.loc3_21.2 (%T) [symbolic = %require_complete (constants.%require_complete.4ae)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%T.patt.loc3_21.1: type](%x.param_patt: @TakesTypeDeduced.%T.loc3_21.2 (%T)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @CallsWithExtraWhere(%U.loc4_24.1: %type_where) {
|
||||
// CHECK:STDOUT: %U.loc4_24.2: %type_where = bind_symbolic_name U, 0 [symbolic = %U.loc4_24.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.patt.loc4_24.2: %type_where = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc4_24.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %U.as_type.loc4_60.2: type = facet_access_type %U.loc4_24.2 [symbolic = %U.as_type.loc4_60.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallsWithExtraWhere.%U.as_type.loc4_60.2 (%U.as_type) [symbolic = %require_complete (constants.%require_complete.220)]
|
||||
// CHECK:STDOUT: %TakesTypeDeduced.specific_fn.loc5_3.2: <specific function> = specific_function constants.%TakesTypeDeduced, @TakesTypeDeduced(%U.as_type.loc4_60.2) [symbolic = %TakesTypeDeduced.specific_fn.loc5_3.2 (constants.%TakesTypeDeduced.specific_fn)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%U.patt.loc4_24.1: %type_where](%y.param_patt: @CallsWithExtraWhere.%U.as_type.loc4_60.2 (%U.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %TakesTypeDeduced.ref: %TakesTypeDeduced.type = name_ref TakesTypeDeduced, file.%TakesTypeDeduced.decl [concrete = constants.%TakesTypeDeduced]
|
||||
// CHECK:STDOUT: %y.ref: @CallsWithExtraWhere.%U.as_type.loc4_60.2 (%U.as_type) = name_ref y, %y
|
||||
// CHECK:STDOUT: %TakesTypeDeduced.specific_fn.loc5_3.1: <specific function> = specific_function %TakesTypeDeduced.ref, @TakesTypeDeduced(constants.%U.as_type) [symbolic = %TakesTypeDeduced.specific_fn.loc5_3.2 (constants.%TakesTypeDeduced.specific_fn)]
|
||||
// CHECK:STDOUT: %TakesTypeDeduced.call: init %empty_tuple.type = call %TakesTypeDeduced.specific_fn.loc5_3.1(%y.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @TakesTypeExplicit(%T.loc8_22.1: type) {
|
||||
// CHECK:STDOUT: %T.loc8_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_22.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc8_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_22.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%T.patt.loc8_22.1: type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @CallsWithExtraWhereExplicit(%U.loc9_32.1: %type_where) {
|
||||
// CHECK:STDOUT: %U.loc9_32.2: %type_where = bind_symbolic_name U, 0 [symbolic = %U.loc9_32.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.patt.loc9_32.2: %type_where = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_32.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %U.as_type.loc10_22.2: type = facet_access_type %U.loc9_32.2 [symbolic = %U.as_type.loc10_22.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: %TakesTypeExplicit.specific_fn.loc10_3.2: <specific function> = specific_function constants.%TakesTypeExplicit, @TakesTypeExplicit(%U.as_type.loc10_22.2) [symbolic = %TakesTypeExplicit.specific_fn.loc10_3.2 (constants.%TakesTypeExplicit.specific_fn)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%U.patt.loc9_32.1: %type_where) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %TakesTypeExplicit.ref: %TakesTypeExplicit.type = name_ref TakesTypeExplicit, file.%TakesTypeExplicit.decl [concrete = constants.%TakesTypeExplicit]
|
||||
// CHECK:STDOUT: %U.ref: %type_where = name_ref U, %U.loc9_32.1 [symbolic = %U.loc9_32.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.as_type.loc10_22.1: type = facet_access_type %U.ref [symbolic = %U.as_type.loc10_22.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: %.loc10: type = converted %U.ref, %U.as_type.loc10_22.1 [symbolic = %U.as_type.loc10_22.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: %TakesTypeExplicit.specific_fn.loc10_3.1: <specific function> = specific_function %TakesTypeExplicit.ref, @TakesTypeExplicit(constants.%U.as_type) [symbolic = %TakesTypeExplicit.specific_fn.loc10_3.2 (constants.%TakesTypeExplicit.specific_fn)]
|
||||
// CHECK:STDOUT: %TakesTypeExplicit.call: init %empty_tuple.type = call %TakesTypeExplicit.specific_fn.loc10_3.1()
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesTypeDeduced(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc3_21.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc3_21.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @CallsWithExtraWhere(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc4_24.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.patt.loc4_24.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.as_type.loc4_60.2 => constants.%U.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesTypeDeduced(constants.%U.as_type) {
|
||||
// CHECK:STDOUT: %T.loc3_21.2 => constants.%U.as_type
|
||||
// CHECK:STDOUT: %T.patt.loc3_21.2 => constants.%U.as_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.220
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesTypeDeduced(@CallsWithExtraWhere.%U.as_type.loc4_60.2) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesTypeExplicit(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc8_22.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @CallsWithExtraWhereExplicit(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc9_32.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.patt.loc9_32.2 => constants.%U
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesTypeExplicit(constants.%U.as_type) {
|
||||
// CHECK:STDOUT: %T.loc8_22.2 => constants.%U.as_type
|
||||
// CHECK:STDOUT: %T.patt.loc8_22.2 => constants.%U.as_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesTypeExplicit(@CallsWithExtraWhereExplicit.%U.as_type.loc10_22.2) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_no_interfaces.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where TODO> [concrete]
|
||||
// CHECK:STDOUT: %T.25f: %type_where = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.patt.395: %type_where = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.25f [symbolic]
|
||||
// CHECK:STDOUT: %TakesExtraWhereDeduced.type: type = fn_type @TakesExtraWhereDeduced [concrete]
|
||||
// CHECK:STDOUT: %TakesExtraWhereDeduced: %TakesExtraWhereDeduced.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.220: <witness> = require_complete_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %CallsWithType.type: type = fn_type @CallsWithType [concrete]
|
||||
// CHECK:STDOUT: %CallsWithType: %CallsWithType.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.4aeca8.1: <witness> = require_complete_type %U [symbolic]
|
||||
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.519 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type.837: type = assoc_entity_type %ImplicitAs.type.d62 [symbolic]
|
||||
// CHECK:STDOUT: %assoc0.02f: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.1c7 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.d81: type = facet_type <@ImplicitAs, @ImplicitAs(%type_where)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.c95: type = fn_type @Convert, @ImplicitAs(%type_where) [concrete]
|
||||
// CHECK:STDOUT: %Convert.4f2: %Convert.type.c95 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type.6cf: type = assoc_entity_type %ImplicitAs.type.d81 [concrete]
|
||||
// CHECK:STDOUT: %assoc0.cf8: %ImplicitAs.assoc_type.6cf = assoc_entity element0, imports.%Core.import_ref.1c7 [concrete]
|
||||
// CHECK:STDOUT: %assoc0.43d: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207 [symbolic]
|
||||
// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [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: <witness> = impl_witness (imports.%Core.import_ref.bd4), @impl(%T.8b3) [symbolic]
|
||||
// CHECK:STDOUT: %Op.type: type = fn_type @Op, @impl(%T.8b3) [symbolic]
|
||||
// CHECK:STDOUT: %Op: %Op.type = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %require_complete.4aeca8.2: <witness> = require_complete_type %T.8b3 [symbolic]
|
||||
// CHECK:STDOUT: %TakesExtraWhereExplicit.type: type = fn_type @TakesExtraWhereExplicit [concrete]
|
||||
// CHECK:STDOUT: %TakesExtraWhereExplicit: %TakesExtraWhereExplicit.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %CallsWithTypeExplicit.type: type = fn_type @CallsWithTypeExplicit [concrete]
|
||||
// CHECK:STDOUT: %CallsWithTypeExplicit: %CallsWithTypeExplicit.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
|
||||
// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst66 [no loc], unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43d)]
|
||||
// CHECK:STDOUT: %Core.Convert = import_ref Core//prelude, Convert, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
|
||||
// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst66 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
|
||||
// CHECK:STDOUT: %Core.import_ref.1c7: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)]
|
||||
// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst101 [no loc], unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.3bf = import_ref Core//prelude, loc18_41, unloaded
|
||||
// CHECK:STDOUT: %Core.Op = import_ref Core//prelude, Op, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.f80 = import_ref Core//prelude, loc21_36, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.%T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.bd4 = import_ref Core//prelude, loc22_42, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .TakesExtraWhereDeduced = %TakesExtraWhereDeduced.decl
|
||||
// CHECK:STDOUT: .CallsWithType = %CallsWithType.decl
|
||||
// CHECK:STDOUT: .TakesExtraWhereExplicit = %TakesExtraWhereExplicit.decl
|
||||
// CHECK:STDOUT: .CallsWithTypeExplicit = %CallsWithTypeExplicit.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %TakesExtraWhereDeduced.decl: %TakesExtraWhereDeduced.type = fn_decl @TakesExtraWhereDeduced [concrete = constants.%TakesExtraWhereDeduced] {
|
||||
// CHECK:STDOUT: %T.patt.loc3_27.1: %type_where = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc3_27.2 (constants.%T.patt.395)]
|
||||
// CHECK:STDOUT: %x.patt: @TakesExtraWhereDeduced.%T.as_type.loc3_63.2 (%T.as_type) = binding_pattern x
|
||||
// CHECK:STDOUT: %x.param_patt: @TakesExtraWhereDeduced.%T.as_type.loc3_63.2 (%T.as_type) = value_param_pattern %x.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc3_36.1: type = splice_block %.loc3_36.2 [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.loc3_36.2: type = where_expr %.Self [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: requirement_impls %.Self.ref, type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc3_27.1: %type_where = bind_symbolic_name T, 0 [symbolic = %T.loc3_27.2 (constants.%T.25f)]
|
||||
// CHECK:STDOUT: %x.param: @TakesExtraWhereDeduced.%T.as_type.loc3_63.2 (%T.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc3_63.1: type = splice_block %.loc3_63.2 [symbolic = %T.as_type.loc3_63.2 (constants.%T.as_type)] {
|
||||
// CHECK:STDOUT: %T.ref: %type_where = name_ref T, %T.loc3_27.1 [symbolic = %T.loc3_27.2 (constants.%T.25f)]
|
||||
// CHECK:STDOUT: %T.as_type.loc3_63.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc3_63.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc3_63.2: type = converted %T.ref, %T.as_type.loc3_63.1 [symbolic = %T.as_type.loc3_63.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @TakesExtraWhereDeduced.%T.as_type.loc3_63.2 (%T.as_type) = bind_name x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallsWithType.decl: %CallsWithType.type = fn_decl @CallsWithType [concrete = constants.%CallsWithType] {
|
||||
// CHECK:STDOUT: %U.patt.loc4_18.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc4_18.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %y.patt: @CallsWithType.%U.loc4_18.2 (%U) = binding_pattern y
|
||||
// CHECK:STDOUT: %y.param_patt: @CallsWithType.%U.loc4_18.2 (%U) = value_param_pattern %y.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %U.loc4_18.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc4_18.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %y.param: @CallsWithType.%U.loc4_18.2 (%U) = value_param call_param0
|
||||
// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc4_18.1 [symbolic = %U.loc4_18.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %y: @CallsWithType.%U.loc4_18.2 (%U) = bind_name y, %y.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %TakesExtraWhereExplicit.decl: %TakesExtraWhereExplicit.type = fn_decl @TakesExtraWhereExplicit [concrete = constants.%TakesExtraWhereExplicit] {
|
||||
// CHECK:STDOUT: %T.patt.loc18_28.1: %type_where = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_28.2 (constants.%T.patt.395)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc18_37.1: type = splice_block %.loc18_37.2 [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.loc18_37.2: type = where_expr %.Self [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: requirement_impls %.Self.ref, type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc18_28.1: %type_where = bind_symbolic_name T, 0 [symbolic = %T.loc18_28.2 (constants.%T.25f)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallsWithTypeExplicit.decl: %CallsWithTypeExplicit.type = fn_decl @CallsWithTypeExplicit [concrete = constants.%CallsWithTypeExplicit] {
|
||||
// CHECK:STDOUT: %U.patt.loc19_26.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc19_26.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %U.loc19_26.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc19_26.2 (constants.%U)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.1: type) [from "include_files/facet_types.carbon"] {
|
||||
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
||||
// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [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(%Dest) [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.1c7 [symbolic = %assoc0 (constants.%assoc0.02f)]
|
||||
// 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: interface @BitAnd [from "include_files/facet_types.carbon"] {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0
|
||||
// CHECK:STDOUT: .Op = imports.%Core.import_ref.3bf
|
||||
// CHECK:STDOUT: witness = (imports.%Core.Op)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.3: type) [from "include_files/facet_types.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.bd4), @impl(%T) [symbolic = %impl_witness (constants.%impl_witness)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Op.type: type = fn_type @Op, @impl(%T) [symbolic = %Op.type (constants.%Op.type)]
|
||||
// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type) = struct_value () [symbolic = %Op (constants.%Op)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.%T (%T.8b3) [symbolic = %require_complete (constants.%require_complete.4aeca8.2)]
|
||||
// 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.f80
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @TakesExtraWhereDeduced(%T.loc3_27.1: %type_where) {
|
||||
// CHECK:STDOUT: %T.loc3_27.2: %type_where = bind_symbolic_name T, 0 [symbolic = %T.loc3_27.2 (constants.%T.25f)]
|
||||
// CHECK:STDOUT: %T.patt.loc3_27.2: %type_where = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc3_27.2 (constants.%T.patt.395)]
|
||||
// CHECK:STDOUT: %T.as_type.loc3_63.2: type = facet_access_type %T.loc3_27.2 [symbolic = %T.as_type.loc3_63.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @TakesExtraWhereDeduced.%T.as_type.loc3_63.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.220)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%T.patt.loc3_27.1: %type_where](%x.param_patt: @TakesExtraWhereDeduced.%T.as_type.loc3_63.2 (%T.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @CallsWithType(%U.loc4_18.1: type) {
|
||||
// CHECK:STDOUT: %U.loc4_18.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc4_18.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.patt.loc4_18.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc4_18.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallsWithType.%U.loc4_18.2 (%U) [symbolic = %require_complete (constants.%require_complete.4aeca8.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%U.patt.loc4_18.1: type](%y.param_patt: @CallsWithType.%U.loc4_18.2 (%U)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %TakesExtraWhereDeduced.ref: %TakesExtraWhereDeduced.type = name_ref TakesExtraWhereDeduced, file.%TakesExtraWhereDeduced.decl [concrete = constants.%TakesExtraWhereDeduced]
|
||||
// CHECK:STDOUT: %y.ref: @CallsWithType.%U.loc4_18.2 (%U) = name_ref y, %y
|
||||
// CHECK:STDOUT: %.loc15: %type_where = converted constants.%U, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "include_files/facet_types.carbon"] {
|
||||
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [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)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type)]() -> @Convert.%Dest (%Dest);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Op(imports.%Core.import_ref.5ab3ec.4: type) [from "include_files/facet_types.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.%T (%T.8b3)](%other.param_patt: @Op.%T (%T.8b3)) -> @Op.%T (%T.8b3) = "type.and";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @TakesExtraWhereExplicit(%T.loc18_28.1: %type_where) {
|
||||
// CHECK:STDOUT: %T.loc18_28.2: %type_where = bind_symbolic_name T, 0 [symbolic = %T.loc18_28.2 (constants.%T.25f)]
|
||||
// CHECK:STDOUT: %T.patt.loc18_28.2: %type_where = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_28.2 (constants.%T.patt.395)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%T.patt.loc18_28.1: %type_where) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @CallsWithTypeExplicit(%U.loc19_26.1: type) {
|
||||
// CHECK:STDOUT: %U.loc19_26.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc19_26.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.patt.loc19_26.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc19_26.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%U.patt.loc19_26.1: type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %TakesExtraWhereExplicit.ref: %TakesExtraWhereExplicit.type = name_ref TakesExtraWhereExplicit, file.%TakesExtraWhereExplicit.decl [concrete = constants.%TakesExtraWhereExplicit]
|
||||
// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc19_26.1 [symbolic = %U.loc19_26.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %.loc30: %type_where = converted %U.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesExtraWhereDeduced(constants.%T.25f) {
|
||||
// CHECK:STDOUT: %T.loc3_27.2 => constants.%T.25f
|
||||
// CHECK:STDOUT: %T.patt.loc3_27.2 => constants.%T.25f
|
||||
// CHECK:STDOUT: %T.as_type.loc3_63.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @CallsWithType(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc4_18.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.patt.loc4_18.2 => constants.%U
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
|
||||
// CHECK:STDOUT: %Dest => constants.%Dest
|
||||
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(%Dest) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.519) {
|
||||
// CHECK:STDOUT: %Dest => constants.%Dest
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62
|
||||
// CHECK:STDOUT: %Self => constants.%Self.519
|
||||
// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%type_where) {
|
||||
// CHECK:STDOUT: %Dest => constants.%type_where
|
||||
// CHECK:STDOUT: %Dest.patt => constants.%type_where
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d81
|
||||
// CHECK:STDOUT: %Self => constants.%Self.519
|
||||
// CHECK:STDOUT: %Convert.type => constants.%Convert.type.c95
|
||||
// CHECK:STDOUT: %Convert => constants.%Convert.4f2
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.6cf
|
||||
// CHECK:STDOUT: %assoc0 => constants.%assoc0.cf8
|
||||
// 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
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @impl(%T) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op(constants.%T.8b3) {
|
||||
// CHECK:STDOUT: %T => constants.%T.8b3
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesExtraWhereExplicit(constants.%T.25f) {
|
||||
// CHECK:STDOUT: %T.loc18_28.2 => constants.%T.25f
|
||||
// CHECK:STDOUT: %T.patt.loc18_28.2 => constants.%T.25f
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @CallsWithTypeExplicit(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc19_26.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.patt.loc19_26.2 => constants.%U
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- include_files/facet_types.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
|
||||
@@ -1,169 +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/impl/lookup/no_prelude/subtyping.carbon
|
||||
// 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
|
||||
|
||||
// This is testing `FindWitnessInFacet` from impl_lookup.cpp
|
||||
|
||||
// --- equivalent.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
interface A {}
|
||||
|
||||
fn TakesA[T:! A](x: T) {}
|
||||
|
||||
fn WithExtraWhere[U:! A where .Self impls type](y: U) {
|
||||
TakesA(y);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- equivalent.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
|
||||
// CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T: %A.type = bind_symbolic_name T, 0 [symbolic]
|
||||
// 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]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
|
||||
// CHECK:STDOUT: %A_where.type: type = facet_type <@A where TODO> [concrete]
|
||||
// CHECK:STDOUT: %U: %A_where.type = bind_symbolic_name U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %U.patt: %A_where.type = symbolic_binding_pattern U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %U.as_type: type = facet_access_type %U [symbolic]
|
||||
// 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.iface0: <witness> = facet_access_witness %U, element0 [symbolic]
|
||||
// CHECK:STDOUT: %A.facet: %A.type = facet_value %U.as_type, (%U.as_wit.iface0) [symbolic]
|
||||
// CHECK:STDOUT: %TakesA.specific_fn: <specific function> = specific_function %TakesA, @TakesA(%A.facet) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .A = %A.decl
|
||||
// CHECK:STDOUT: .TakesA = %TakesA.decl
|
||||
// CHECK:STDOUT: .WithExtraWhere = %WithExtraWhere.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
|
||||
// CHECK:STDOUT: %TakesA.decl: %TakesA.type = fn_decl @TakesA [concrete = constants.%TakesA] {
|
||||
// CHECK:STDOUT: %T.patt.loc5_11.1: %A.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_11.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %x.patt: @TakesA.%T.as_type.loc5_21.2 (%T.as_type) = binding_pattern x
|
||||
// CHECK:STDOUT: %x.param_patt: @TakesA.%T.as_type.loc5_21.2 (%T.as_type) = value_param_pattern %x.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
|
||||
// CHECK:STDOUT: %T.loc5_11.1: %A.type = bind_symbolic_name T, 0 [symbolic = %T.loc5_11.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @TakesA.%T.as_type.loc5_21.2 (%T.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc5_21.1: type = splice_block %.loc5_21.2 [symbolic = %T.as_type.loc5_21.2 (constants.%T.as_type)] {
|
||||
// CHECK:STDOUT: %T.ref: %A.type = name_ref T, %T.loc5_11.1 [symbolic = %T.loc5_11.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type.loc5_21.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc5_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc5_21.2: type = converted %T.ref, %T.as_type.loc5_21.1 [symbolic = %T.as_type.loc5_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @TakesA.%T.as_type.loc5_21.2 (%T.as_type) = bind_name x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %WithExtraWhere.decl: %WithExtraWhere.type = fn_decl @WithExtraWhere [concrete = constants.%WithExtraWhere] {
|
||||
// CHECK:STDOUT: %U.patt.loc7_19.1: %A_where.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc7_19.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %y.patt: @WithExtraWhere.%U.as_type.loc7_52.2 (%U.as_type) = binding_pattern y
|
||||
// CHECK:STDOUT: %y.param_patt: @WithExtraWhere.%U.as_type.loc7_52.2 (%U.as_type) = value_param_pattern %y.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc7_25.1: type = splice_block %.loc7_25.2 [concrete = constants.%A_where.type] {
|
||||
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
|
||||
// CHECK:STDOUT: %.Self: %A.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: %A.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc7_31: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc7_25.2: type = where_expr %.Self [concrete = constants.%A_where.type] {
|
||||
// CHECK:STDOUT: requirement_impls %.loc7_31, type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc7_19.1: %A_where.type = bind_symbolic_name U, 0 [symbolic = %U.loc7_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %y.param: @WithExtraWhere.%U.as_type.loc7_52.2 (%U.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc7_52.1: type = splice_block %.loc7_52.2 [symbolic = %U.as_type.loc7_52.2 (constants.%U.as_type)] {
|
||||
// CHECK:STDOUT: %U.ref: %A_where.type = name_ref U, %U.loc7_19.1 [symbolic = %U.loc7_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.as_type.loc7_52.1: type = facet_access_type %U.ref [symbolic = %U.as_type.loc7_52.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: %.loc7_52.2: type = converted %U.ref, %U.as_type.loc7_52.1 [symbolic = %U.as_type.loc7_52.2 (constants.%U.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: @WithExtraWhere.%U.as_type.loc7_52.2 (%U.as_type) = bind_name y, %y.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @A {
|
||||
// CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @TakesA(%T.loc5_11.1: %A.type) {
|
||||
// CHECK:STDOUT: %T.loc5_11.2: %A.type = bind_symbolic_name T, 0 [symbolic = %T.loc5_11.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc5_11.2: %A.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_11.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.as_type.loc5_21.2: type = facet_access_type %T.loc5_11.2 [symbolic = %T.as_type.loc5_21.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @TakesA.%T.as_type.loc5_21.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.cf4)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%T.patt.loc5_11.1: %A.type](%x.param_patt: @TakesA.%T.as_type.loc5_21.2 (%T.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @WithExtraWhere(%U.loc7_19.1: %A_where.type) {
|
||||
// CHECK:STDOUT: %U.loc7_19.2: %A_where.type = bind_symbolic_name U, 0 [symbolic = %U.loc7_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.patt.loc7_19.2: %A_where.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc7_19.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %U.as_type.loc7_52.2: type = facet_access_type %U.loc7_19.2 [symbolic = %U.as_type.loc7_52.2 (constants.%U.as_type)]
|
||||
// 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.iface0.loc8_11.3: <witness> = facet_access_witness %U.loc7_19.2, element0 [symbolic = %U.as_wit.iface0.loc8_11.3 (constants.%U.as_wit.iface0)]
|
||||
// CHECK:STDOUT: %A.facet.loc8_11.3: %A.type = facet_value %U.as_type.loc7_52.2, (%U.as_wit.iface0.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: %U.as_wit.iface0.loc8_11.1: <witness> = facet_access_witness constants.%U, element0 [symbolic = %U.as_wit.iface0.loc8_11.3 (constants.%U.as_wit.iface0)]
|
||||
// CHECK:STDOUT: %A.facet.loc8_11.1: %A.type = facet_value constants.%U.as_type, (%U.as_wit.iface0.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.iface0.loc8_11.2: <witness> = facet_access_witness constants.%U, element0 [symbolic = %U.as_wit.iface0.loc8_11.3 (constants.%U.as_wit.iface0)]
|
||||
// CHECK:STDOUT: %A.facet.loc8_11.2: %A.type = facet_value constants.%U.as_type, (%U.as_wit.iface0.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: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TakesA(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc5_11.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc5_11.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.as_type.loc5_21.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @WithExtraWhere(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc7_19.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.patt.loc7_19.2 => constants.%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