Implement unused pattern bindings, continued (#6518)

Implementation of unused pattern bindings #2022, continued.

Whereas previous PR #6460 took care of parsing, and PR #6479 prepared
the stage by using _ in some test cases, this PR has the the actual
implementation, using a simple dataflow analysis.

---------

Co-authored-by: Burak Emir <bqe@google.com>
Co-authored-by: jonmeow <jperkins@google.com>
This commit is contained in:
Burak Emir
2026-02-19 23:33:36 +00:00
committed by GitHub
co-authored by Burak Emir jonmeow
parent bea24a8bee
commit fdb188ccfd
366 changed files with 8453 additions and 7996 deletions
+9 -9
View File
@@ -52,7 +52,7 @@ interface I {
class C {}
impl () as Core.ImplicitAs(C) {
fn Convert[self: ()]() -> C { return {}; }
fn Convert[unused self: ()]() -> C { return {}; }
}
// CHECK:STDERR: fail_assoc_const_not_constant_after_conversion.carbon:[[@LINE+4]]:11: error: associated constant V given value `()` that is not constant after conversion to `C` [AssociatedConstantNotConstantAfterConversion]
@@ -501,11 +501,11 @@ fn CallF() {
// CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %.loc11_29: Core.Form = init_form %C.ref, call_param1 [concrete = constants.%.b89]
// CHECK:STDOUT: %.loc11_36: Core.Form = init_form %C.ref, call_param1 [concrete = constants.%.b89]
// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
// CHECK:STDOUT: %.loc11_21.1: type = splice_block %.loc11_21.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc11_21.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc11_21.3: type = converted %.loc11_21.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc11_28.1: type = splice_block %.loc11_28.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc11_28.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc11_28.3: type = converted %.loc11_28.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
// CHECK:STDOUT: %return.param: ref %C = out_param call_param1
@@ -546,10 +546,10 @@ fn CallF() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.ImplicitAs.impl.Convert(%self.param: %empty_tuple.type) -> out %return.param: %C {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_41.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc11_41.2: init %C to %return.param = class_init () [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc11_42: init %C = converted %.loc11_41.1, %.loc11_41.2 [concrete = constants.%C.val]
// CHECK:STDOUT: return %.loc11_42 to %return.param
// CHECK:STDOUT: %.loc11_48.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc11_48.2: init %C to %return.param = class_init () [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc11_49: init %C = converted %.loc11_48.1, %.loc11_48.2 [concrete = constants.%C.val]
// CHECK:STDOUT: return %.loc11_49 to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I(constants.%Self.ab9) {
+2 -2
View File
@@ -31,7 +31,7 @@ impl C as Simple {
library "[[@TEST_NAME]]";
interface I {
fn Op[self: Self]();
fn Op[unused self: Self]();
}
class C {}
@@ -42,7 +42,7 @@ class C {}
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
impl Unknown as I {
fn Op[self: Self]() {}
fn Op[unused self: Self]() {}
}
// --- fail_import_invalid_impl.carbon
+2 -2
View File
@@ -90,7 +90,7 @@ interface Instance1 {
}
impl {.d: ()} as Instance1 {
fn G1[self: Self]() {}
fn G1[unused self: Self]() {}
}
fn InstanceCall(n: {.d: ()}) {
@@ -109,7 +109,7 @@ interface Instance2 {
}
impl {.e: ()} as Instance2 {
fn G2[self: Self]() {}
fn G2[unused self: Self]() {}
}
fn InstanceCallFail() {
+3 -3
View File
@@ -34,7 +34,7 @@ interface Z {}
// CHECK:STDERR:
impl forall [T:! type] T as Z;
fn F(U:! Z) {}
fn F(unused U:! Z) {}
//@dump-sem-ir-begin
fn G(T:! type) {
@@ -66,7 +66,7 @@ interface Z {}
// CHECK:STDERR:
impl forall [T:! type] T as Z;
fn F(U:! Z) {}
fn F(unused U:! Z) {}
//@dump-sem-ir-begin
fn G(T:! type) {
@@ -95,7 +95,7 @@ interface Z {}
// CHECK:STDERR:
impl forall [T:! type] T as Z;
fn F(U:! Z) {}
fn F(unused U:! Z) {}
fn G() {
// This impl lookup resolves to a final witness, which poisons any future
+48 -48
View File
@@ -35,19 +35,19 @@ import library "interface";
class A { adapt {}; }
impl A as Runtime {
fn F[self: Self]() -> type { return A; }
fn F[unused self: Self]() -> type { return A; }
}
impl A as Eval {
// TODO: Consider rejecting this, as compile-time evaluation would always
// fail.
fn F[self: Self]() -> type { return A; }
fn F[unused self: Self]() -> type { return A; }
}
impl A as MustEval {
// TODO: Consider rejecting this, as compile-time evaluation would always
// fail.
fn F[self: Self]() -> type { return A; }
fn F[unused self: Self]() -> type { return A; }
}
fn Call() {
@@ -65,33 +65,33 @@ import library "interface";
class A { adapt {}; }
impl A as Runtime {
fn F[self: Self]() -> type { return A; }
fn F[unused self: Self]() -> type { return A; }
}
impl A as Eval {
fn F[self: Self]() -> type { return A; }
fn F[unused self: Self]() -> type { return A; }
}
impl A as MustEval {
fn F[self: Self]() -> type { return A; }
fn F[unused self: Self]() -> type { return A; }
}
fn Call() {
// CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure]
// CHECK:STDERR: let t: ({} as A).(Runtime.F)() = {} as A;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure]
// CHECK:STDERR: let unused t: ({} as A).(Runtime.F)() = {} as A;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
let t: ({} as A).(Runtime.F)() = {} as A;
// CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure]
// CHECK:STDERR: let u: ({} as A).(Eval.F)() = {} as A;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
let unused t: ({} as A).(Runtime.F)() = {} as A;
// CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure]
// CHECK:STDERR: let unused u: ({} as A).(Eval.F)() = {} as A;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
let u: ({} as A).(Eval.F)() = {} as A;
// CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure]
// CHECK:STDERR: let v: ({} as A).(MustEval.F)() = {} as A;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
let unused u: ({} as A).(Eval.F)() = {} as A;
// CHECK:STDERR: fail_impl_runtime_eval.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure]
// CHECK:STDERR: let unused v: ({} as A).(MustEval.F)() = {} as A;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
let v: ({} as A).(MustEval.F)() = {} as A;
let unused v: ({} as A).(MustEval.F)() = {} as A;
}
// --- impl_eval.carbon
@@ -103,23 +103,23 @@ import library "interface";
class A { adapt {}; }
impl A as Runtime {
eval fn F[self: Self]() -> type { return A; }
eval fn F[unused self: Self]() -> type { return A; }
}
impl A as Eval {
eval fn F[self: Self]() -> type { return A; }
eval fn F[unused self: Self]() -> type { return A; }
}
impl A as MustEval {
eval fn F[self: Self]() -> type { return A; }
eval fn F[unused self: Self]() -> type { return A; }
}
fn Call() {
// TODO: Should we allow calling this at compile time? This is not allowed if
// we generate a thunk; see the next split for an example.
let t: ({} as A).(Runtime.F)() = {} as A;
let u: ({} as A).(Eval.F)() = {} as A;
let v: ({} as A).(MustEval.F)() = {} as A;
let unused t: ({} as A).(Runtime.F)() = {} as A;
let unused u: ({} as A).(Eval.F)() = {} as A;
let unused v: ({} as A).(MustEval.F)() = {} as A;
}
// --- fail_todo_impl_eval_from_runtime_thunk.carbon
@@ -132,21 +132,21 @@ class B {}
class BView {}
impl B as Core.ImplicitAs(BView) {
fn Convert[self: Self]() -> BView { return {}; }
fn Convert[unused self: Self]() -> BView { return {}; }
}
impl B as Runtime {
eval fn F[self: BView]() -> type { return B; }
eval fn F[unused self: BView]() -> type { return B; }
}
fn Call() {
// TODO: Should we allow calling this at compile time? This is allowed if we
// don't generate a thunk.
// CHECK:STDERR: fail_todo_impl_eval_from_runtime_thunk.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure]
// CHECK:STDERR: let t: ({} as B).(Runtime.F)() = {} as B;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_impl_eval_from_runtime_thunk.carbon:[[@LINE+4]]:17: error: cannot evaluate type expression [TypeExprEvaluationFailure]
// CHECK:STDERR: let unused t: ({} as B).(Runtime.F)() = {} as B;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
let t: ({} as B).(Runtime.F)() = {} as B;
let unused t: ({} as B).(Runtime.F)() = {} as B;
}
// --- fail_impl_musteval.carbon
@@ -159,32 +159,32 @@ class B { adapt {}; }
impl B as Runtime {
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+11]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
// CHECK:STDERR: musteval fn F[self: Self]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: musteval fn F[unused self: Self]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+8]]:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
// CHECK:STDERR: musteval fn F[self: Self]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: musteval fn F[unused self: Self]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE-11]]:1: in import [InImport]
// CHECK:STDERR: interface.carbon:5:3: note: while building thunk to match the signature of this function [ThunkSignature]
// CHECK:STDERR: fn F[self: Self]() -> type;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
musteval fn F[self: Self]() -> type { return B; }
musteval fn F[unused self: Self]() -> type { return B; }
}
impl B as Eval {
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+11]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
// CHECK:STDERR: musteval fn F[self: Self]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: musteval fn F[unused self: Self]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+8]]:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
// CHECK:STDERR: musteval fn F[self: Self]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: musteval fn F[unused self: Self]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE-26]]:1: in import [InImport]
// CHECK:STDERR: interface.carbon:9:3: note: while building thunk to match the signature of this function [ThunkSignature]
// CHECK:STDERR: eval fn F[self: Self]() -> type;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
musteval fn F[self: Self]() -> type { return B; }
musteval fn F[unused self: Self]() -> type { return B; }
}
// --- impl_musteval_from_musteval.carbon
@@ -196,11 +196,11 @@ import library "interface";
class B { adapt {}; }
impl B as MustEval {
musteval fn F[self: Self]() -> type { return B; }
musteval fn F[unused self: Self]() -> type { return B; }
}
fn Call() {
let t: ({} as B).(MustEval.F)() = {} as B;
let unused t: ({} as B).(MustEval.F)() = {} as B;
}
// --- fail_todo_impl_musteval_from_musteval_thunk.carbon
@@ -213,20 +213,20 @@ class B {}
class BView {}
impl B as Core.ImplicitAs(BView) {
fn Convert[self: Self]() -> BView { return {}; }
fn Convert[unused self: Self]() -> BView { return {}; }
}
impl B as MustEval {
// CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+11]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
// CHECK:STDERR: musteval fn F[self: BView]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: musteval fn F[unused self: BView]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+8]]:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
// CHECK:STDERR: musteval fn F[self: BView]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: musteval fn F[unused self: BView]() -> type { return B; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE-16]]:1: in import [InImport]
// CHECK:STDERR: interface.carbon:13:3: note: while building thunk to match the signature of this function [ThunkSignature]
// CHECK:STDERR: musteval fn F[self: Self]() -> type;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
musteval fn F[self: BView]() -> type { return B; }
musteval fn F[unused self: BView]() -> type { return B; }
}
+1 -1
View File
@@ -22,7 +22,7 @@ class C {
}
fn F() {
let b: C.X = ();
let unused b: C.X = ();
}
// --- fail_final_extend_impl.carbon
+47 -47
View File
@@ -33,8 +33,8 @@ class C {
}
fn G(c: C) {
let a: i32 = C.F().x;
var b: i32 = c.F().x;
let unused a: i32 = C.F().x;
var unused b: i32 = c.F().x;
}
// --- extend_impl_generic_class.carbon
@@ -47,7 +47,7 @@ interface I(T:! type) {
class X(U:! type) {
extend impl as I(U) {
fn F[self: Self](t: U) { }
fn F[unused self: Self](unused t: U) { }
}
}
@@ -134,7 +134,7 @@ class X(U:! type) {
// CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete]
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete]
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc22_20 [concrete]
// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc22_27 [concrete]
// CHECK:STDOUT: %DestroyOp.b0ebf8.1: %DestroyOp.type.3e79c2.1 = struct_value () [concrete]
// CHECK:STDOUT: %DestroyOp.type.3e79c2.2: type = fn_type @DestroyOp.loc22_3 [concrete]
// CHECK:STDOUT: %DestroyOp.b0ebf8.2: %DestroyOp.type.3e79c2.2 = struct_value () [concrete]
@@ -301,56 +301,56 @@ class X(U:! type) {
// CHECK:STDOUT: %a.patt: %pattern_type.7ce = value_binding_pattern a [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.ref.loc21: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %.loc21_17: %HasF.assoc_type.078 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param, constants.%C.type.facet) [concrete = constants.%assoc0.22c]
// CHECK:STDOUT: %F.ref.loc21: %HasF.assoc_type.078 = name_ref F, %.loc21_17 [concrete = constants.%assoc0.22c]
// CHECK:STDOUT: %.loc21_24: %HasF.assoc_type.078 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param, constants.%C.type.facet) [concrete = constants.%assoc0.22c]
// CHECK:STDOUT: %F.ref.loc21: %HasF.assoc_type.078 = name_ref F, %.loc21_24 [concrete = constants.%assoc0.22c]
// CHECK:STDOUT: %impl.elem0.loc21: %.095 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F]
// CHECK:STDOUT: %.loc21_20.1: ref %Param = temporary_storage
// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc21: init %Param to %.loc21_20.1 = call %impl.elem0.loc21()
// CHECK:STDOUT: %.loc21_20.2: ref %Param = temporary %.loc21_20.1, %C.as.HasF.impl.F.call.loc21
// CHECK:STDOUT: %.loc21_27.1: ref %Param = temporary_storage
// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc21: init %Param to %.loc21_27.1 = call %impl.elem0.loc21()
// CHECK:STDOUT: %.loc21_27.2: ref %Param = temporary %.loc21_27.1, %C.as.HasF.impl.F.call.loc21
// CHECK:STDOUT: %x.ref.loc21: %Param.elem = name_ref x, @Param.%.loc9 [concrete = @Param.%.loc9]
// CHECK:STDOUT: %.loc21_21.1: ref %i32 = class_element_access %.loc21_20.2, element0
// CHECK:STDOUT: %.loc21_10: type = splice_block %i32.loc21 [concrete = constants.%i32] {
// CHECK:STDOUT: %.loc21_28.1: ref %i32 = class_element_access %.loc21_27.2, element0
// CHECK:STDOUT: %.loc21_17: type = splice_block %i32.loc21 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc21_21.2: %i32 = acquire_value %.loc21_21.1
// CHECK:STDOUT: %a: %i32 = value_binding a, %.loc21_21.2
// CHECK:STDOUT: %.loc21_28.2: %i32 = acquire_value %.loc21_28.1
// CHECK:STDOUT: %a: %i32 = value_binding a, %.loc21_28.2
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %b.patt: %pattern_type.7ce = ref_binding_pattern b [concrete]
// CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
// CHECK:STDOUT: %.loc22_17: %HasF.assoc_type.078 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param, constants.%C.type.facet) [concrete = constants.%assoc0.22c]
// CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type.078 = name_ref F, %.loc22_17 [concrete = constants.%assoc0.22c]
// CHECK:STDOUT: %impl.elem0.loc22_17: %.095 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F]
// CHECK:STDOUT: %.loc22_20.1: ref %Param = temporary_storage
// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc22: init %Param to %.loc22_20.1 = call %impl.elem0.loc22_17()
// CHECK:STDOUT: %.loc22_20.2: ref %Param = temporary %.loc22_20.1, %C.as.HasF.impl.F.call.loc22
// CHECK:STDOUT: %.loc22_24: %HasF.assoc_type.078 = specific_constant @HasF.%assoc0.loc5_14.1, @HasF(constants.%Param, constants.%C.type.facet) [concrete = constants.%assoc0.22c]
// CHECK:STDOUT: %F.ref.loc22: %HasF.assoc_type.078 = name_ref F, %.loc22_24 [concrete = constants.%assoc0.22c]
// CHECK:STDOUT: %impl.elem0.loc22_24: %.095 = impl_witness_access constants.%HasF.impl_witness, element0 [concrete = constants.%C.as.HasF.impl.F]
// CHECK:STDOUT: %.loc22_27.1: ref %Param = temporary_storage
// CHECK:STDOUT: %C.as.HasF.impl.F.call.loc22: init %Param to %.loc22_27.1 = call %impl.elem0.loc22_24()
// CHECK:STDOUT: %.loc22_27.2: ref %Param = temporary %.loc22_27.1, %C.as.HasF.impl.F.call.loc22
// CHECK:STDOUT: %x.ref.loc22: %Param.elem = name_ref x, @Param.%.loc9 [concrete = @Param.%.loc9]
// CHECK:STDOUT: %.loc22_21.1: ref %i32 = class_element_access %.loc22_20.2, element0
// CHECK:STDOUT: %.loc22_21.2: %i32 = acquire_value %.loc22_21.1
// CHECK:STDOUT: %impl.elem0.loc22_21: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664]
// CHECK:STDOUT: %bound_method.loc22_21.1: <bound method> = bound_method %.loc22_21.2, %impl.elem0.loc22_21
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc22_21, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
// CHECK:STDOUT: %bound_method.loc22_21.2: <bound method> = bound_method %.loc22_21.2, %specific_fn
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc22_21.2(%.loc22_21.2)
// CHECK:STDOUT: %.loc22_28.1: ref %i32 = class_element_access %.loc22_27.2, element0
// CHECK:STDOUT: %.loc22_28.2: %i32 = acquire_value %.loc22_28.1
// CHECK:STDOUT: %impl.elem0.loc22_28: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664]
// CHECK:STDOUT: %bound_method.loc22_28.1: <bound method> = bound_method %.loc22_28.2, %impl.elem0.loc22_28
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc22_28, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
// CHECK:STDOUT: %bound_method.loc22_28.2: <bound method> = bound_method %.loc22_28.2, %specific_fn
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc22_28.2(%.loc22_28.2)
// CHECK:STDOUT: assign %b.var, %Int.as.Copy.impl.Op.call
// CHECK:STDOUT: %.loc22_10: type = splice_block %i32.loc22 [concrete = constants.%i32] {
// CHECK:STDOUT: %.loc22_17: type = splice_block %i32.loc22 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %b: ref %i32 = ref_binding b, %b.var
// CHECK:STDOUT: %DestroyOp.bound.loc22_20: <bound method> = bound_method %.loc22_20.2, constants.%DestroyOp.b0ebf8.1
// CHECK:STDOUT: %DestroyOp.call.loc22_20: init %empty_tuple.type = call %DestroyOp.bound.loc22_20(%.loc22_20.2)
// CHECK:STDOUT: %DestroyOp.bound.loc22_27: <bound method> = bound_method %.loc22_27.2, constants.%DestroyOp.b0ebf8.1
// CHECK:STDOUT: %DestroyOp.call.loc22_27: init %empty_tuple.type = call %DestroyOp.bound.loc22_27(%.loc22_27.2)
// CHECK:STDOUT: %DestroyOp.bound.loc22_3: <bound method> = bound_method %b.var, constants.%DestroyOp.b0ebf8.2
// CHECK:STDOUT: %DestroyOp.call.loc22_3: init %empty_tuple.type = call %DestroyOp.bound.loc22_3(%b.var)
// CHECK:STDOUT: %DestroyOp.bound.loc21: <bound method> = bound_method %.loc21_20.2, constants.%DestroyOp.b0ebf8.1
// CHECK:STDOUT: %DestroyOp.call.loc21: init %empty_tuple.type = call %DestroyOp.bound.loc21(%.loc21_20.2)
// CHECK:STDOUT: %DestroyOp.bound.loc21: <bound method> = bound_method %.loc21_27.2, constants.%DestroyOp.b0ebf8.1
// CHECK:STDOUT: %DestroyOp.call.loc21: init %empty_tuple.type = call %DestroyOp.bound.loc21(%.loc21_27.2)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @DestroyOp.loc22_20(%self.param: ref %Param) = "no_op";
// CHECK:STDOUT: fn @DestroyOp.loc22_27(%self.param: ref %Param) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @DestroyOp.loc22_3(%self.param: ref %i32) = "no_op";
// CHECK:STDOUT:
@@ -541,15 +541,15 @@ class X(U:! type) {
// CHECK:STDOUT:
// CHECK:STDOUT: impl: %Self.ref as %I.type.loc9_21.2 {
// CHECK:STDOUT: %X.as.I.impl.F.decl: @X.as.I.impl.%X.as.I.impl.F.type (%X.as.I.impl.F.type) = fn_decl @X.as.I.impl.F [symbolic = @X.as.I.impl.%X.as.I.impl.F (constants.%X.as.I.impl.F)] {
// CHECK:STDOUT: %self.patt: @X.as.I.impl.F.%pattern_type.loc10_10 (%pattern_type.e07) = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: @X.as.I.impl.F.%pattern_type.loc10_10 (%pattern_type.e07) = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %t.patt: @X.as.I.impl.F.%pattern_type.loc10_22 (%pattern_type.51d1c4.2) = value_binding_pattern t [concrete]
// CHECK:STDOUT: %t.param_patt: @X.as.I.impl.F.%pattern_type.loc10_22 (%pattern_type.51d1c4.2) = value_param_pattern %t.patt, call_param1 [concrete]
// CHECK:STDOUT: %self.patt: @X.as.I.impl.F.%pattern_type.loc10_17 (%pattern_type.e07) = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: @X.as.I.impl.F.%pattern_type.loc10_17 (%pattern_type.e07) = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %t.patt: @X.as.I.impl.F.%pattern_type.loc10_36 (%pattern_type.51d1c4.2) = value_binding_pattern t [concrete]
// CHECK:STDOUT: %t.param_patt: @X.as.I.impl.F.%pattern_type.loc10_36 (%pattern_type.51d1c4.2) = value_param_pattern %t.patt, call_param1 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: @X.as.I.impl.F.%X (%X) = value_param call_param0
// CHECK:STDOUT: %.loc10_16.1: type = splice_block %Self.ref [symbolic = %X (constants.%X)] {
// CHECK:STDOUT: %.loc10_16.2: type = specific_constant constants.%X, @X(constants.%U) [symbolic = %X (constants.%X)]
// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_16.2 [symbolic = %X (constants.%X)]
// CHECK:STDOUT: %.loc10_23.1: type = splice_block %Self.ref [symbolic = %X (constants.%X)] {
// CHECK:STDOUT: %.loc10_23.2: type = specific_constant constants.%X, @X(constants.%U) [symbolic = %X (constants.%X)]
// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_23.2 [symbolic = %X (constants.%X)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %self: @X.as.I.impl.F.%X (%X) = value_binding self, %self.param
// CHECK:STDOUT: %t.param: @X.as.I.impl.F.%U (%U) = value_param call_param1
@@ -606,14 +606,14 @@ class X(U:! type) {
// CHECK:STDOUT: generic fn @X.as.I.impl.F(@X.%U.loc8_9.2: type) {
// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic = %U (constants.%U)]
// CHECK:STDOUT: %X: type = class_type @X, @X(%U) [symbolic = %X (constants.%X)]
// CHECK:STDOUT: %pattern_type.loc10_10: type = pattern_type %X [symbolic = %pattern_type.loc10_10 (constants.%pattern_type.e07)]
// CHECK:STDOUT: %pattern_type.loc10_17: type = pattern_type %X [symbolic = %pattern_type.loc10_17 (constants.%pattern_type.e07)]
// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U)> [symbolic = %I.type (constants.%I.type.1ab3e4.2)]
// CHECK:STDOUT: %require_complete.loc10_25: <witness> = require_complete_type %I.type [symbolic = %require_complete.loc10_25 (constants.%require_complete.e36)]
// CHECK:STDOUT: %pattern_type.loc10_22: type = pattern_type %U [symbolic = %pattern_type.loc10_22 (constants.%pattern_type.51d1c4.2)]
// CHECK:STDOUT: %require_complete.loc10_39: <witness> = require_complete_type %I.type [symbolic = %require_complete.loc10_39 (constants.%require_complete.e36)]
// CHECK:STDOUT: %pattern_type.loc10_36: type = pattern_type %U [symbolic = %pattern_type.loc10_36 (constants.%pattern_type.51d1c4.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc10_14: <witness> = require_complete_type %X [symbolic = %require_complete.loc10_14 (constants.%require_complete.5dd)]
// CHECK:STDOUT: %require_complete.loc10_23: <witness> = require_complete_type %U [symbolic = %require_complete.loc10_23 (constants.%require_complete.944)]
// CHECK:STDOUT: %require_complete.loc10_21: <witness> = require_complete_type %X [symbolic = %require_complete.loc10_21 (constants.%require_complete.5dd)]
// CHECK:STDOUT: %require_complete.loc10_37: <witness> = require_complete_type %U [symbolic = %require_complete.loc10_37 (constants.%require_complete.944)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%self.param: @X.as.I.impl.F.%X (%X), %t.param: @X.as.I.impl.F.%U (%U)) {
// CHECK:STDOUT: !entry:
@@ -678,10 +678,10 @@ class X(U:! type) {
// CHECK:STDOUT: specific @X.as.I.impl.F(constants.%U) {
// CHECK:STDOUT: %U => constants.%U
// CHECK:STDOUT: %X => constants.%X
// CHECK:STDOUT: %pattern_type.loc10_10 => constants.%pattern_type.e07
// CHECK:STDOUT: %pattern_type.loc10_17 => constants.%pattern_type.e07
// CHECK:STDOUT: %I.type => constants.%I.type.1ab3e4.2
// CHECK:STDOUT: %require_complete.loc10_25 => constants.%require_complete.e36
// CHECK:STDOUT: %pattern_type.loc10_22 => constants.%pattern_type.51d1c4.2
// CHECK:STDOUT: %require_complete.loc10_39 => constants.%require_complete.e36
// CHECK:STDOUT: %pattern_type.loc10_36 => constants.%pattern_type.51d1c4.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I(constants.%U, constants.%I.facet) {
@@ -22,7 +22,7 @@ class C {
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR:
extend impl forall [T:! type] as GenericInterface(T) {
fn F(x: T) {}
fn F(unused x: T) {}
}
}
+4 -4
View File
@@ -56,14 +56,14 @@ interface Z {
// CHECK:STDERR:
impl as Z {
fn Zero() {}
fn Method[self: Self]() {}
fn Method[unused self: Self]() {}
}
}
class Point {
impl as Z {
fn Zero() {}
fn Method[self: Self]() {}
fn Method[unused self: Self]() {}
}
}
@@ -346,10 +346,10 @@ class X {
// CHECK:STDOUT: %self.param_patt: @<error>.as.Z.impl.Method.%pattern_type (%pattern_type.84b) = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: @<error>.as.Z.impl.Method.%Self.binding.as_type (%Self.binding.as_type.62d) = value_param call_param0
// CHECK:STDOUT: %.loc13_21.1: type = splice_block %.loc13_21.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)] {
// CHECK:STDOUT: %.loc13_28.1: type = splice_block %.loc13_28.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)] {
// CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self.loc3 [symbolic = %Self (constants.%Self.c59)]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)]
// CHECK:STDOUT: %.loc13_21.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)]
// CHECK:STDOUT: %.loc13_28.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.62d)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %self: @<error>.as.Z.impl.Method.%Self.binding.as_type (%Self.binding.as_type.62d) = value_binding self, %self.param
// CHECK:STDOUT: }
+19 -18
View File
@@ -153,7 +153,7 @@ interface I {}
impl D as I {}
class C(T:! I) {}
fn F(x: C(D)) {}
fn F(unused x: C(D)) {}
// --- fail_todo_two_interfaces.carbon
library "[[@TEST_NAME]]";
@@ -196,7 +196,7 @@ library "[[@TEST_NAME]]";
interface X;
// Allowed to use incomplete interfaces in function declarations.
fn F(U:! X);
fn F(_:! X);
fn G[U:! X](u: U);
class C;
@@ -224,8 +224,8 @@ fn H(c: C) {
// The above declarations require that `interface Y`, `fn F` (since it is
// generic), and `impl C as X` are defined in the same file.
interface Y {}
fn F(U:! X) {}
fn G[U:! X](u: U) {}
fn F(_:! X) {}
fn G[U:! X](unused u: U) {}
impl C as Y;
impl C as X {}
impl C as Y {}
@@ -1394,11 +1394,11 @@ interface I {
// CHECK:STDOUT: %x.param_patt: %pattern_type.b40 = value_param_pattern %x.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %x.param.loc14: %C.229 = value_param call_param0
// CHECK:STDOUT: %.loc14_12.1: type = splice_block %C.loc14 [concrete = constants.%C.229] {
// CHECK:STDOUT: %.loc14_19.1: type = splice_block %C.loc14 [concrete = constants.%C.229] {
// CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, file.%C.decl.loc6 [concrete = constants.%C.generic]
// CHECK:STDOUT: %D.ref.loc14: type = name_ref D, file.%D.decl [concrete = constants.%D]
// CHECK:STDOUT: %I.facet.loc14: %I.type = facet_value %D.ref.loc14, (constants.%I.impl_witness) [concrete = constants.%I.facet]
// CHECK:STDOUT: %.loc14_12.2: %I.type = converted %D.ref.loc14, %I.facet.loc14 [concrete = constants.%I.facet]
// CHECK:STDOUT: %.loc14_19.2: %I.type = converted %D.ref.loc14, %I.facet.loc14 [concrete = constants.%I.facet]
// CHECK:STDOUT: %C.loc14: type = class_type @C, @C(constants.%I.facet) [concrete = constants.%C.229]
// CHECK:STDOUT: }
// CHECK:STDOUT: %x.loc14: %C.229 = value_binding x, %x.param.loc14
@@ -1682,11 +1682,12 @@ interface I {
// CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %U: %X.type = symbolic_binding U, 0 [symbolic]
// CHECK:STDOUT: %_: %X.type = symbolic_binding _, 0 [symbolic]
// CHECK:STDOUT: %pattern_type.b4b: type = pattern_type %X.type [concrete]
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
// CHECK:STDOUT: %U: %X.type = symbolic_binding U, 0 [symbolic]
// CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 0, %U [symbolic]
// CHECK:STDOUT: %pattern_type.b36: type = pattern_type %U.binding.as_type [symbolic]
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
@@ -1729,13 +1730,13 @@ interface I {
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %X.decl.loc3: type = interface_decl @X [concrete = constants.%X.type] {} {}
// CHECK:STDOUT: %F.decl.loc6: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete]
// CHECK:STDOUT: %_.patt: %pattern_type.b4b = symbolic_binding_pattern _, 0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc6: type = splice_block %X.ref.loc6 [concrete = constants.%X.type] {
// CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %X.ref.loc6: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %U.loc6_6.2: %X.type = symbolic_binding U, 0 [symbolic = %U.loc6_6.1 (constants.%U)]
// CHECK:STDOUT: %_.loc6_6.2: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_6.1 (constants.%_)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl.loc7: %G.type = fn_decl @G [concrete = constants.%G] {
// CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete]
@@ -1773,13 +1774,13 @@ interface I {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Y.decl.loc33: type = interface_decl @Y [concrete = constants.%Y.type] {} {}
// CHECK:STDOUT: %F.decl.loc34: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete]
// CHECK:STDOUT: %_.patt: %pattern_type.b4b = symbolic_binding_pattern _, 0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc34: type = splice_block %X.ref.loc34 [concrete = constants.%X.type] {
// CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %X.ref.loc34: type = name_ref X, file.%X.decl.loc3 [concrete = constants.%X.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %U.loc34: %X.type = symbolic_binding U, 0 [symbolic = %U.loc6_6.1 (constants.%U)]
// CHECK:STDOUT: %_.loc34: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_6.1 (constants.%_)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl.loc35: %G.type = fn_decl @G [concrete = constants.%G] {
// CHECK:STDOUT: %U.patt: %pattern_type.b4b = symbolic_binding_pattern U, 0 [concrete]
@@ -1792,10 +1793,10 @@ interface I {
// CHECK:STDOUT: }
// CHECK:STDOUT: %U.loc35: %X.type = symbolic_binding U, 0 [symbolic = %U.loc7_6.1 (constants.%U)]
// CHECK:STDOUT: %u.param.loc35: @G.%U.binding.as_type (%U.binding.as_type) = value_param call_param0
// CHECK:STDOUT: %.loc35_16.1: type = splice_block %.loc35_16.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] {
// CHECK:STDOUT: %.loc35_23.1: type = splice_block %.loc35_23.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)] {
// CHECK:STDOUT: %U.ref.loc35: %X.type = name_ref U, %U.loc35 [symbolic = %U.loc7_6.1 (constants.%U)]
// CHECK:STDOUT: %U.as_type.loc35: type = facet_access_type %U.ref.loc35 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)]
// CHECK:STDOUT: %.loc35_16.2: type = converted %U.ref.loc35, %U.as_type.loc35 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)]
// CHECK:STDOUT: %.loc35_23.2: type = converted %U.ref.loc35, %U.as_type.loc35 [symbolic = %U.binding.as_type (constants.%U.binding.as_type)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %u.loc35: @G.%U.binding.as_type (%U.binding.as_type) = value_binding u, %u.param.loc35
// CHECK:STDOUT: }
@@ -1859,8 +1860,8 @@ interface I {
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F(%U.loc6_6.2: %X.type) {
// CHECK:STDOUT: %U.loc6_6.1: %X.type = symbolic_binding U, 0 [symbolic = %U.loc6_6.1 (constants.%U)]
// CHECK:STDOUT: generic fn @F(%_.loc6_6.2: %X.type) {
// CHECK:STDOUT: %_.loc6_6.1: %X.type = symbolic_binding _, 0 [symbolic = %_.loc6_6.1 (constants.%_)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
@@ -1903,8 +1904,8 @@ interface I {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F(constants.%U) {
// CHECK:STDOUT: %U.loc6_6.1 => constants.%U
// CHECK:STDOUT: specific @F(constants.%_) {
// CHECK:STDOUT: %_.loc6_6.1 => constants.%_
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @G(constants.%U) {
@@ -1918,7 +1919,7 @@ interface I {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F(constants.%X.facet) {
// CHECK:STDOUT: %U.loc6_6.1 => constants.%X.facet
// CHECK:STDOUT: %_.loc6_6.1 => constants.%X.facet
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
+4 -4
View File
@@ -20,7 +20,7 @@ class C {
impl as Simple {
fn F() {
// C is a complete type here.
var c: C = {};
var unused c: C = {};
}
}
}
@@ -124,9 +124,9 @@ class C {
// CHECK:STDOUT: %c.var_patt: %pattern_type.7c7 = var_pattern %c.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %c.var: ref %C = var %c.var_patt
// CHECK:STDOUT: %.loc23_19.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc23_19.2: init %C to %c.var = class_init () [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc23_7: init %C = converted %.loc23_19.1, %.loc23_19.2 [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc23_26.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc23_26.2: init %C to %c.var = class_init () [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc23_7: init %C = converted %.loc23_26.1, %.loc23_26.2 [concrete = constants.%C.val]
// CHECK:STDOUT: assign %c.var, %.loc23_7
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var
+4 -4
View File
@@ -379,11 +379,11 @@ impl C as Z where .Z1 = C {}
// Implied constraint: .Self impls Y. Should be verified against the type of the
// facet value replacing T when calling F.
//
// CHECK:STDERR: fail_todo_period_self_compared_with_concrete_self.carbon:[[@LINE+4]]:24: error: cannot convert type `.Self` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
// CHECK:STDERR: fn F(T:! Z where .Z1 = .Self) {}
// CHECK:STDERR: ^~~~~
// CHECK:STDERR: fail_todo_period_self_compared_with_concrete_self.carbon:[[@LINE+4]]:31: error: cannot convert type `.Self` that implements `Z` into type implementing `Y` [ConversionFailureFacetToFacet]
// CHECK:STDERR: fn F(unused T:! Z where .Z1 = .Self) {}
// CHECK:STDERR: ^~~~~
// CHECK:STDERR:
fn F(T:! Z where .Z1 = .Self) {}
fn F(unused T:! Z where .Z1 = .Self) {}
fn G() {
F(C);
+68 -68
View File
@@ -305,7 +305,7 @@ interface I {
impl () as I {
//@dump-sem-ir-begin
fn F[self: (), U:! Core.Copy](x: U) -> U { return x; }
fn F[unused self: (), U:! Core.Copy](x: U) -> U { return x; }
//@dump-sem-ir-end
}
@@ -998,13 +998,13 @@ impl () as I({}) {
// CHECK:STDOUT: %U.binding.as_type.14b: type = symbolic_binding_type U, 0, %U.035 [symbolic]
// CHECK:STDOUT: %pattern_type.9b9f0c.2: type = pattern_type %U.binding.as_type.14b [symbolic]
// CHECK:STDOUT: %.0e8: Core.Form = init_form %U.binding.as_type.14b, call_param2 [symbolic]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.1: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_44.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.1: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_51.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = struct_value () [concrete]
// CHECK:STDOUT: %T.67d: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic]
// CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic]
// CHECK:STDOUT: %.924: Core.Form = init_form %ptr.e8f, call_param2 [symbolic]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_44.2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.19e4b8.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_51.2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.8be29b.2: %empty_tuple.type.as.I.impl.F.type.19e4b8.2 = struct_value () [concrete]
// CHECK:STDOUT: %require_complete.67ca8d.1: <witness> = require_complete_type %U.binding.as_type.14b [symbolic]
// CHECK:STDOUT: %require_complete.ef1: <witness> = require_complete_type %ptr.e8f [symbolic]
@@ -1016,7 +1016,7 @@ impl () as I({}) {
// CHECK:STDOUT: %.2f2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.67d) [symbolic]
// CHECK:STDOUT: %Copy.lookup_impl_witness.2e6: <witness> = lookup_impl_witness %ptr.e8f, @Copy [symbolic]
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.e8f, (%Copy.lookup_impl_witness.2e6) [symbolic]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn: <specific function> = specific_function %empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_44.1(%Copy.facet) [symbolic]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn: <specific function> = specific_function %empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_51.1(%Copy.facet) [symbolic]
// CHECK:STDOUT: %Copy.WithSelf.Op.type.d82: type = fn_type @Copy.WithSelf.Op, @Copy(%Copy.facet) [symbolic]
// CHECK:STDOUT: %.299: type = fn_type_with_self_type %Copy.WithSelf.Op.type.d82, %Copy.facet [symbolic]
// CHECK:STDOUT: %impl.elem0.1c7: %.299 = impl_witness_access %Copy.lookup_impl_witness.2e6, element0 [symbolic]
@@ -1033,43 +1033,43 @@ impl () as I({}) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc8_7.2 as %I.ref {
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl.loc10_44.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_44.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1] {
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl.loc10_51.1: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_51.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1] {
// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %U.patt: %pattern_type.ce2 = symbolic_binding_pattern U, 0 [concrete]
// CHECK:STDOUT: %x.patt: @empty_tuple.type.as.I.impl.F.loc10_44.1.%pattern_type (%pattern_type.9b9f0c.2) = value_binding_pattern x [concrete]
// CHECK:STDOUT: %x.param_patt: @empty_tuple.type.as.I.impl.F.loc10_44.1.%pattern_type (%pattern_type.9b9f0c.2) = value_param_pattern %x.patt, call_param1 [concrete]
// CHECK:STDOUT: %return.patt: @empty_tuple.type.as.I.impl.F.loc10_44.1.%pattern_type (%pattern_type.9b9f0c.2) = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: @empty_tuple.type.as.I.impl.F.loc10_44.1.%pattern_type (%pattern_type.9b9f0c.2) = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: %x.patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.9b9f0c.2) = value_binding_pattern x [concrete]
// CHECK:STDOUT: %x.param_patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.9b9f0c.2) = value_param_pattern %x.patt, call_param1 [concrete]
// CHECK:STDOUT: %return.patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.9b9f0c.2) = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.9b9f0c.2) = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %U.ref.loc10_42: %Copy.type = name_ref U, %U.loc10_18.2 [symbolic = %U.loc10_18.1 (constants.%U.035)]
// CHECK:STDOUT: %U.as_type.loc10_42: type = facet_access_type %U.ref.loc10_42 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: %.loc10_42.3: type = converted %U.ref.loc10_42, %U.as_type.loc10_42 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: %.loc10_42.4: Core.Form = init_form %.loc10_42.3, call_param2 [symbolic = %.loc10_42.2 (constants.%.0e8)]
// CHECK:STDOUT: %U.ref.loc10_49: %Copy.type = name_ref U, %U.loc10_25.2 [symbolic = %U.loc10_25.1 (constants.%U.035)]
// CHECK:STDOUT: %U.as_type.loc10_49: type = facet_access_type %U.ref.loc10_49 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: %.loc10_49.3: type = converted %U.ref.loc10_49, %U.as_type.loc10_49 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: %.loc10_49.4: Core.Form = init_form %.loc10_49.3, call_param2 [symbolic = %.loc10_49.2 (constants.%.0e8)]
// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
// CHECK:STDOUT: %.loc10_15.1: type = splice_block %.loc10_15.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc10_15.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc10_15.3: type = converted %.loc10_15.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc10_22.1: type = splice_block %.loc10_22.3 [concrete = constants.%empty_tuple.type] {
// CHECK:STDOUT: %.loc10_22.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc10_22.3: type = converted %.loc10_22.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
// CHECK:STDOUT: %.loc10_26: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
// CHECK:STDOUT: %.loc10_33: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
// CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %U.loc10_18.2: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_18.1 (constants.%U.035)]
// CHECK:STDOUT: %x.param: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = value_param call_param1
// CHECK:STDOUT: %.loc10_36.1: type = splice_block %.loc10_36.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] {
// CHECK:STDOUT: %U.ref.loc10_36: %Copy.type = name_ref U, %U.loc10_18.2 [symbolic = %U.loc10_18.1 (constants.%U.035)]
// CHECK:STDOUT: %U.as_type.loc10_36: type = facet_access_type %U.ref.loc10_36 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: %.loc10_36.2: type = converted %U.ref.loc10_36, %U.as_type.loc10_36 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: %U.loc10_25.2: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_25.1 (constants.%U.035)]
// CHECK:STDOUT: %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = value_param call_param1
// CHECK:STDOUT: %.loc10_43.1: type = splice_block %.loc10_43.2 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)] {
// CHECK:STDOUT: %U.ref.loc10_43: %Copy.type = name_ref U, %U.loc10_25.2 [symbolic = %U.loc10_25.1 (constants.%U.035)]
// CHECK:STDOUT: %U.as_type.loc10_43: type = facet_access_type %U.ref.loc10_43 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: %.loc10_43.2: type = converted %U.ref.loc10_43, %U.as_type.loc10_43 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %x: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = value_binding x, %x.param
// CHECK:STDOUT: %return.param: ref @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = out_param call_param2
// CHECK:STDOUT: %return: ref @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = return_slot %return.param
// CHECK:STDOUT: %x: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = value_binding x, %x.param
// CHECK:STDOUT: %return.param: ref @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = out_param call_param2
// CHECK:STDOUT: %return: ref @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl.loc10_44.2: %empty_tuple.type.as.I.impl.F.type.19e4b8.2 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_44.2 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.2] {
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.decl.loc10_51.2: %empty_tuple.type.as.I.impl.F.type.19e4b8.2 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_51.2 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.2] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
@@ -1077,90 +1077,90 @@ impl () as I({}) {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl.loc10_44.1
// CHECK:STDOUT: .F = %empty_tuple.type.as.I.impl.F.decl.loc10_51.1
// CHECK:STDOUT: witness = %I.impl_witness
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_44.1(%U.loc10_18.2: %Copy.type) {
// CHECK:STDOUT: %U.loc10_18.1: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_18.1 (constants.%U.035)]
// CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 0, %U.loc10_18.1 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_51.1(%U.loc10_25.2: %Copy.type) {
// CHECK:STDOUT: %U.loc10_25.1: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_25.1 (constants.%U.035)]
// CHECK:STDOUT: %U.binding.as_type: type = symbolic_binding_type U, 0, %U.loc10_25.1 [symbolic = %U.binding.as_type (constants.%U.binding.as_type.14b)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %U.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.9b9f0c.2)]
// CHECK:STDOUT: %.loc10_42.2: Core.Form = init_form %U.binding.as_type, call_param2 [symbolic = %.loc10_42.2 (constants.%.0e8)]
// CHECK:STDOUT: %.loc10_49.2: Core.Form = init_form %U.binding.as_type, call_param2 [symbolic = %.loc10_49.2 (constants.%.0e8)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %U.binding.as_type [symbolic = %require_complete (constants.%require_complete.67ca8d.1)]
// CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %U.loc10_18.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.58dce0.2)]
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy(%U.loc10_18.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.735e75.3)]
// CHECK:STDOUT: %.loc10_53: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc10_18.1 [symbolic = %.loc10_53 (constants.%.023143.2)]
// CHECK:STDOUT: %impl.elem0.loc10_53.2: @empty_tuple.type.as.I.impl.F.loc10_44.1.%.loc10_53 (%.023143.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_53.2 (constants.%impl.elem0.594c59.2)]
// CHECK:STDOUT: %specific_impl_fn.loc10_53.2: <specific function> = specific_impl_function %impl.elem0.loc10_53.2, @Copy.WithSelf.Op(%U.loc10_18.1) [symbolic = %specific_impl_fn.loc10_53.2 (constants.%specific_impl_fn.bdce5c.2)]
// CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %U.loc10_25.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.58dce0.2)]
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy(%U.loc10_25.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.735e75.3)]
// CHECK:STDOUT: %.loc10_60: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc10_25.1 [symbolic = %.loc10_60 (constants.%.023143.2)]
// CHECK:STDOUT: %impl.elem0.loc10_60.2: @empty_tuple.type.as.I.impl.F.loc10_51.1.%.loc10_60 (%.023143.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.594c59.2)]
// CHECK:STDOUT: %specific_impl_fn.loc10_60.2: <specific function> = specific_impl_function %impl.elem0.loc10_60.2, @Copy.WithSelf.Op(%U.loc10_25.1) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.bdce5c.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) {
// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %x.ref: @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = name_ref x, %x
// CHECK:STDOUT: %impl.elem0.loc10_53.1: @empty_tuple.type.as.I.impl.F.loc10_44.1.%.loc10_53 (%.023143.2) = impl_witness_access constants.%Copy.lookup_impl_witness.58dce0.2, element0 [symbolic = %impl.elem0.loc10_53.2 (constants.%impl.elem0.594c59.2)]
// CHECK:STDOUT: %bound_method.loc10_53.1: <bound method> = bound_method %x.ref, %impl.elem0.loc10_53.1
// CHECK:STDOUT: %specific_impl_fn.loc10_53.1: <specific function> = specific_impl_function %impl.elem0.loc10_53.1, @Copy.WithSelf.Op(constants.%U.035) [symbolic = %specific_impl_fn.loc10_53.2 (constants.%specific_impl_fn.bdce5c.2)]
// CHECK:STDOUT: %bound_method.loc10_53.2: <bound method> = bound_method %x.ref, %specific_impl_fn.loc10_53.1
// CHECK:STDOUT: %.loc10_42.1: ref @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) = splice_block %return.param {}
// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @empty_tuple.type.as.I.impl.F.loc10_44.1.%U.binding.as_type (%U.binding.as_type.14b) to %.loc10_42.1 = call %bound_method.loc10_53.2(%x.ref)
// CHECK:STDOUT: %x.ref: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = name_ref x, %x
// CHECK:STDOUT: %impl.elem0.loc10_60.1: @empty_tuple.type.as.I.impl.F.loc10_51.1.%.loc10_60 (%.023143.2) = impl_witness_access constants.%Copy.lookup_impl_witness.58dce0.2, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.594c59.2)]
// CHECK:STDOUT: %bound_method.loc10_60.1: <bound method> = bound_method %x.ref, %impl.elem0.loc10_60.1
// CHECK:STDOUT: %specific_impl_fn.loc10_60.1: <specific function> = specific_impl_function %impl.elem0.loc10_60.1, @Copy.WithSelf.Op(constants.%U.035) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.bdce5c.2)]
// CHECK:STDOUT: %bound_method.loc10_60.2: <bound method> = bound_method %x.ref, %specific_impl_fn.loc10_60.1
// CHECK:STDOUT: %.loc10_49.1: ref @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) = splice_block %return.param {}
// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.binding.as_type (%U.binding.as_type.14b) to %.loc10_49.1 = call %bound_method.loc10_60.2(%x.ref)
// CHECK:STDOUT: return %Copy.WithSelf.Op.call to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_44.2(%T.loc5_20.2: type) {
// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_51.2(%T.loc5_20.2: type) {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %.loc10_44.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_20.1) [symbolic = %.loc10_44.3 (constants.%.2f2)]
// CHECK:STDOUT: %.loc10_51.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_20.1) [symbolic = %.loc10_51.3 (constants.%.2f2)]
// CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.2e6)]
// CHECK:STDOUT: %Copy.facet.loc10_44.3: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.2: <specific function> = specific_function constants.%empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_44.1(%Copy.facet.loc10_44.3) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)]
// CHECK:STDOUT: %Copy.facet.loc10_51.3: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2: <specific function> = specific_function constants.%empty_tuple.type.as.I.impl.F.8be29b.1, @empty_tuple.type.as.I.impl.F.loc10_51.1(%Copy.facet.loc10_51.3) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_44.2.%ptr (%ptr.e8f)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_44.2.%ptr (%ptr.e8f) [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_44.1] {
// CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f) [thunk @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_51.1] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_44.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1]
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.I.impl.F.type.19e4b8.1 = name_ref F, @empty_tuple.type.as.I.impl.%empty_tuple.type.as.I.impl.F.decl.loc10_51.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.8be29b.1]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.bound: <bound method> = bound_method %self.ref, %F.ref
// CHECK:STDOUT: %Copy.facet.loc10_44.1: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %.loc10_44.1: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc10_44.1 [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %Copy.facet.loc10_44.2: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %.loc10_44.2: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc10_44.2 [symbolic = %Copy.facet.loc10_44.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.1: <specific function> = specific_function %F.ref, @empty_tuple.type.as.I.impl.F.loc10_44.1(constants.%Copy.facet) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %self.ref, %empty_tuple.type.as.I.impl.F.specific_fn.loc10_44.1
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.call: init @empty_tuple.type.as.I.impl.F.loc10_44.2.%ptr (%ptr.e8f) = call %bound_method(%self.ref, %x.ref)
// CHECK:STDOUT: %Copy.facet.loc10_51.1: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %.loc10_51.1: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc10_51.1 [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %Copy.facet.loc10_51.2: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.2e6) [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %.loc10_51.2: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc10_51.2 [symbolic = %Copy.facet.loc10_51.3 (constants.%Copy.facet)]
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.1: <specific function> = specific_function %F.ref, @empty_tuple.type.as.I.impl.F.loc10_51.1(constants.%Copy.facet) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %self.ref, %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.1
// CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.call: init @empty_tuple.type.as.I.impl.F.loc10_51.2.%ptr (%ptr.e8f) = call %bound_method(%self.ref, %x.ref)
// CHECK:STDOUT: return %empty_tuple.type.as.I.impl.F.call
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_44.1(constants.%U.035) {
// CHECK:STDOUT: %U.loc10_18.1 => constants.%U.035
// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.1(constants.%U.035) {
// CHECK:STDOUT: %U.loc10_25.1 => constants.%U.035
// CHECK:STDOUT: %U.binding.as_type => constants.%U.binding.as_type.14b
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.9b9f0c.2
// CHECK:STDOUT: %.loc10_42.2 => constants.%.0e8
// CHECK:STDOUT: %.loc10_49.2 => constants.%.0e8
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_44.2(constants.%T.67d) {
// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.2(constants.%T.67d) {
// CHECK:STDOUT: %T.loc5_20.1 => constants.%T.67d
// CHECK:STDOUT: %ptr => constants.%ptr.e8f
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4
// CHECK:STDOUT: %.loc5 => constants.%.924
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_44.1(constants.%Copy.facet) {
// CHECK:STDOUT: %U.loc10_18.1 => constants.%Copy.facet
// CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.1(constants.%Copy.facet) {
// CHECK:STDOUT: %U.loc10_25.1 => constants.%Copy.facet
// CHECK:STDOUT: %U.binding.as_type => constants.%ptr.e8f
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4
// CHECK:STDOUT: %.loc10_42.2 => constants.%.924
// CHECK:STDOUT: %.loc10_49.2 => constants.%.924
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%require_complete.ef1
// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.2e6
// CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.d82
// CHECK:STDOUT: %.loc10_53 => constants.%.299
// CHECK:STDOUT: %impl.elem0.loc10_53.2 => constants.%impl.elem0.1c7
// CHECK:STDOUT: %specific_impl_fn.loc10_53.2 => constants.%specific_impl_fn.366
// CHECK:STDOUT: %.loc10_60 => constants.%.299
// CHECK:STDOUT: %impl.elem0.loc10_60.2 => constants.%impl.elem0.1c7
// CHECK:STDOUT: %specific_impl_fn.loc10_60.2 => constants.%specific_impl_fn.366
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- generic_interface.carbon
@@ -31,12 +31,12 @@ class A {
}
impl ConvertsToB as Core.ImplicitAs(B) {
fn Convert[self: Self]() -> B { return {}; }
fn Convert[unused self: Self]() -> B { return {}; }
}
}
impl ConvertsToA as Core.ImplicitAs(A) {
fn Convert[self: Self]() -> A { return {}; }
fn Convert[unused self: Self]() -> A { return {}; }
}
}
@@ -40,7 +40,7 @@ interface SimpleOp {
}
impl forall [T:! type] T as SimpleOp {
fn Op[self: Self]() {}
fn Op[unused self: Self]() {}
}
// An empty interface with blanket impl for pointers.
@@ -49,7 +49,7 @@ impl forall [T:! type] T as Empty {}
// Class with a use of `SimpleOp.Op`.
class InterfaceWrap(T:! SimpleOp & Empty) {
fn UseSimpleOp[self: Self](value:! T) {
fn UseSimpleOp[unused self: Self](value:! T) {
value.(SimpleOp.Op)();
}
}
@@ -64,7 +64,7 @@ interface CombinedFacet {
// A wrapper providing `CombinedFacet`.
class TypeWrap(T:! type) {
impl as CombinedFacet where .T = T {
fn GetInterfaceWrap[self: Self]() -> InterfaceWrap(T) {
fn GetInterfaceWrap[unused self: Self]() -> InterfaceWrap(T) {
return {};
}
}
+2 -2
View File
@@ -28,7 +28,7 @@ interface Instance {
}
impl {.i: ()} as Instance {
fn G[self: Self]() {}
fn G[unused self: Self]() {}
}
// --- import_non-instance_success.carbon
@@ -630,7 +630,7 @@ fn InstanceCallImportFail() {
// CHECK:STDOUT: %Main.import_ref.344: <witness> = import_ref Main//lib, loc15_27, loaded [concrete = constants.%Instance.impl_witness]
// CHECK:STDOUT: %Main.import_ref.c9a: type = import_ref Main//lib, loc15_13, loaded [concrete = constants.%struct_type.i]
// CHECK:STDOUT: %Main.import_ref.2f8: type = import_ref Main//lib, loc15_18, loaded [concrete = constants.%Instance.type]
// CHECK:STDOUT: %Main.import_ref.22d: %struct_type.i.as.Instance.impl.G.type = import_ref Main//lib, loc16_22, loaded [concrete = constants.%struct_type.i.as.Instance.impl.G]
// CHECK:STDOUT: %Main.import_ref.22d: %struct_type.i.as.Instance.impl.G.type = import_ref Main//lib, loc16_29, loaded [concrete = constants.%struct_type.i.as.Instance.impl.G]
// CHECK:STDOUT: %Instance.impl_witness_table = impl_witness_table (%Main.import_ref.22d), @struct_type.i.as.Instance.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -26,7 +26,7 @@ interface Instance {
}
impl {.i: ()} as Instance {
fn G[self: Self]() {}
fn G[unused self: Self]() {}
}
// --- import_instance_success.carbon
+13 -13
View File
@@ -29,7 +29,7 @@ import library "a";
class C { adapt (); }
impl C as Add {
fn Op[self: Self](other: Self) -> Self { return () as C; }
fn Op[unused self: Self](unused other: Self) -> Self { return () as C; }
}
fn F(x: C, y: C) -> C {
@@ -224,13 +224,13 @@ fn F(x: C, y: C) -> C {
// CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Self.ref.loc9_37: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C]
// CHECK:STDOUT: %.loc9_37: Core.Form = init_form %Self.ref.loc9_37, call_param2 [concrete = constants.%.92f]
// CHECK:STDOUT: %Self.ref.loc9_51: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C]
// CHECK:STDOUT: %.loc9_51: Core.Form = init_form %Self.ref.loc9_51, call_param2 [concrete = constants.%.92f]
// CHECK:STDOUT: %self.param: %C = value_param call_param0
// CHECK:STDOUT: %Self.ref.loc9_15: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C]
// CHECK:STDOUT: %Self.ref.loc9_22: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C]
// CHECK:STDOUT: %self: %C = value_binding self, %self.param
// CHECK:STDOUT: %other.param: %C = value_param call_param1
// CHECK:STDOUT: %Self.ref.loc9_28: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C]
// CHECK:STDOUT: %Self.ref.loc9_42: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C]
// CHECK:STDOUT: %other: %C = value_binding other, %other.param
// CHECK:STDOUT: %return.param: ref %C = out_param call_param2
// CHECK:STDOUT: %return: ref %C = return_slot %return.param
@@ -266,16 +266,16 @@ fn F(x: C, y: C) -> C {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C.as.Add.impl.Op(%self.param: %C, %other.param: %C) -> out %return.param: %C {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc9_52: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple.af4]
// CHECK:STDOUT: %.loc9_66: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple.af4]
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple.af4]
// CHECK:STDOUT: %.loc9_54.1: %C = as_compatible %empty_tuple [concrete = constants.%empty_tuple.bfb]
// CHECK:STDOUT: %.loc9_54.2: %C = converted %.loc9_52, %.loc9_54.1 [concrete = constants.%empty_tuple.bfb]
// CHECK:STDOUT: %.loc9_58.1: %empty_tuple.type = as_compatible %.loc9_54.2 [concrete = constants.%empty_tuple.af4]
// CHECK:STDOUT: %.loc9_58.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple.af4]
// CHECK:STDOUT: %.loc9_58.3: init %C = as_compatible %.loc9_58.2 [concrete = constants.%empty_tuple.bfb]
// CHECK:STDOUT: %.loc9_58.4: init %C = converted %.loc9_54.2, %.loc9_58.3 [concrete = constants.%empty_tuple.bfb]
// CHECK:STDOUT: return %.loc9_58.4
// CHECK:STDOUT: %.loc9_68.1: %C = as_compatible %empty_tuple [concrete = constants.%empty_tuple.bfb]
// CHECK:STDOUT: %.loc9_68.2: %C = converted %.loc9_66, %.loc9_68.1 [concrete = constants.%empty_tuple.bfb]
// CHECK:STDOUT: %.loc9_72.1: %empty_tuple.type = as_compatible %.loc9_68.2 [concrete = constants.%empty_tuple.af4]
// CHECK:STDOUT: %.loc9_72.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple.af4]
// CHECK:STDOUT: %.loc9_72.3: init %C = as_compatible %.loc9_72.2 [concrete = constants.%empty_tuple.bfb]
// CHECK:STDOUT: %.loc9_72.4: init %C = converted %.loc9_68.2, %.loc9_72.3 [concrete = constants.%empty_tuple.bfb]
// CHECK:STDOUT: return %.loc9_72.4
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%x.param: %C, %y.param: %C) -> out %return.param: %C {
+4 -4
View File
@@ -59,7 +59,7 @@ class D(N:! E) {}
// impl for Z) should not be inappropriately added to this impl's generic eval
// block.
impl forall [N:! E] D(N) as I where .Assoc = () {
fn F(c: C(())) {}
fn F(unused c: C(())) {}
}
// CHECK:STDOUT: --- impl_def.carbon
@@ -528,11 +528,11 @@ impl forall [N:! E] D(N) as I where .Assoc = () {
// CHECK:STDOUT: %c.param_patt: %pattern_type.479 = value_param_pattern %c.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %c.param: %C.a44 = value_param call_param0
// CHECK:STDOUT: %.loc21_15.1: type = splice_block %C [concrete = constants.%C.a44] {
// CHECK:STDOUT: %.loc21_22.1: type = splice_block %C [concrete = constants.%C.a44] {
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [concrete = constants.%C.generic]
// CHECK:STDOUT: %.loc21_14: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc21_21: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%empty_tuple.type, (constants.%Z.impl_witness.db1) [concrete = constants.%Z.facet.8bd]
// CHECK:STDOUT: %.loc21_15.2: %Z.type = converted %.loc21_14, %Z.facet [concrete = constants.%Z.facet.8bd]
// CHECK:STDOUT: %.loc21_22.2: %Z.type = converted %.loc21_21, %Z.facet [concrete = constants.%Z.facet.8bd]
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%Z.facet.8bd) [concrete = constants.%C.a44]
// CHECK:STDOUT: }
// CHECK:STDOUT: %c: %C.a44 = value_binding c, %c.param
+48 -48
View File
@@ -28,7 +28,7 @@ import library "a";
class C(X:! ()) {}
impl forall [Y:! ()] C(Y) as I {
fn F(x: C(Y)) {}
fn F(unused x: C(Y)) {}
}
// --- c.carbon
@@ -128,15 +128,15 @@ fn G() {
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
// CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness @C.as.I.impl.%I.impl_witness_table, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %pattern_type.fb2: type = pattern_type %C.c8540f.2 [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.type.cf838e.1: type = fn_type @C.as.I.impl.F.loc8_17.1, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.type.cf838e.1: type = fn_type @C.as.I.impl.F.loc8_24.1, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.421e41.1: %C.as.I.impl.F.type.cf838e.1 = struct_value () [symbolic]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C.c8540f.2, (%I.impl_witness) [symbolic]
// CHECK:STDOUT: %I.WithSelf.F.type.81b: type = fn_type @I.WithSelf.F, @I(%I.facet) [symbolic]
// CHECK:STDOUT: %I.WithSelf.F.848: %I.WithSelf.F.type.81b = struct_value () [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.type.cf838e.2: type = fn_type @C.as.I.impl.F.loc8_17.2, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.type.cf838e.2: type = fn_type @C.as.I.impl.F.loc8_24.2, @C.as.I.impl(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.421e41.2: %C.as.I.impl.F.type.cf838e.2 = struct_value () [symbolic]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.c8540f.2 [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.specific_fn: <specific function> = specific_function %C.as.I.impl.F.421e41.1, @C.as.I.impl.F.loc8_17.1(%Y) [symbolic]
// CHECK:STDOUT: %C.as.I.impl.F.specific_fn: <specific function> = specific_function %C.as.I.impl.F.421e41.1, @C.as.I.impl.F.loc8_24.1(%Y) [symbolic]
// CHECK:STDOUT: %C.val: %C.c8540f.2 = struct_value () [symbolic]
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
// CHECK:STDOUT: %Self.765: %Destroy.type = symbolic_binding Self, 0 [symbolic]
@@ -217,38 +217,38 @@ fn G() {
// CHECK:STDOUT: %I.impl_witness.loc7_32.2: <witness> = impl_witness %I.impl_witness_table, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %I.impl_witness.loc7_32.2 (constants.%I.impl_witness)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.1: type = fn_type @C.as.I.impl.F.loc8_17.1, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_17.1 (constants.%C.as.I.impl.F.type.cf838e.1)]
// CHECK:STDOUT: %C.as.I.impl.F.loc8_17.1: @C.as.I.impl.%C.as.I.impl.F.type.loc8_17.1 (%C.as.I.impl.F.type.cf838e.1) = struct_value () [symbolic = %C.as.I.impl.F.loc8_17.1 (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.2: type = fn_type @C.as.I.impl.F.loc8_17.2, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_17.2 (constants.%C.as.I.impl.F.type.cf838e.2)]
// CHECK:STDOUT: %C.as.I.impl.F.loc8_17.2: @C.as.I.impl.%C.as.I.impl.F.type.loc8_17.2 (%C.as.I.impl.F.type.cf838e.2) = struct_value () [symbolic = %C.as.I.impl.F.loc8_17.2 (constants.%C.as.I.impl.F.421e41.2)]
// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_24.1: type = fn_type @C.as.I.impl.F.loc8_24.1, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_24.1 (constants.%C.as.I.impl.F.type.cf838e.1)]
// CHECK:STDOUT: %C.as.I.impl.F.loc8_24.1: @C.as.I.impl.%C.as.I.impl.F.type.loc8_24.1 (%C.as.I.impl.F.type.cf838e.1) = struct_value () [symbolic = %C.as.I.impl.F.loc8_24.1 (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_24.2: type = fn_type @C.as.I.impl.F.loc8_24.2, @C.as.I.impl(%Y.loc7_14.1) [symbolic = %C.as.I.impl.F.type.loc8_24.2 (constants.%C.as.I.impl.F.type.cf838e.2)]
// CHECK:STDOUT: %C.as.I.impl.F.loc8_24.2: @C.as.I.impl.%C.as.I.impl.F.type.loc8_24.2 (%C.as.I.impl.F.type.cf838e.2) = struct_value () [symbolic = %C.as.I.impl.F.loc8_24.2 (constants.%C.as.I.impl.F.421e41.2)]
// CHECK:STDOUT:
// CHECK:STDOUT: impl: %C.loc7_25.2 as %I.ref {
// CHECK:STDOUT: %C.as.I.impl.F.decl.loc8_17.1: @C.as.I.impl.%C.as.I.impl.F.type.loc8_17.1 (%C.as.I.impl.F.type.cf838e.1) = fn_decl @C.as.I.impl.F.loc8_17.1 [symbolic = @C.as.I.impl.%C.as.I.impl.F.loc8_17.1 (constants.%C.as.I.impl.F.421e41.1)] {
// CHECK:STDOUT: %x.patt: @C.as.I.impl.F.loc8_17.1.%pattern_type (%pattern_type.fb2) = value_binding_pattern x [concrete]
// CHECK:STDOUT: %x.param_patt: @C.as.I.impl.F.loc8_17.1.%pattern_type (%pattern_type.fb2) = value_param_pattern %x.patt, call_param0 [concrete]
// CHECK:STDOUT: %C.as.I.impl.F.decl.loc8_24.1: @C.as.I.impl.%C.as.I.impl.F.type.loc8_24.1 (%C.as.I.impl.F.type.cf838e.1) = fn_decl @C.as.I.impl.F.loc8_24.1 [symbolic = @C.as.I.impl.%C.as.I.impl.F.loc8_24.1 (constants.%C.as.I.impl.F.421e41.1)] {
// CHECK:STDOUT: %x.patt: @C.as.I.impl.F.loc8_24.1.%pattern_type (%pattern_type.fb2) = value_binding_pattern x [concrete]
// CHECK:STDOUT: %x.param_patt: @C.as.I.impl.F.loc8_24.1.%pattern_type (%pattern_type.fb2) = value_param_pattern %x.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %x.param: @C.as.I.impl.F.loc8_17.1.%C.loc8_14.1 (%C.c8540f.2) = value_param call_param0
// CHECK:STDOUT: %.loc8: type = splice_block %C.loc8_14.2 [symbolic = %C.loc8_14.1 (constants.%C.c8540f.2)] {
// CHECK:STDOUT: %x.param: @C.as.I.impl.F.loc8_24.1.%C.loc8_21.1 (%C.c8540f.2) = value_param call_param0
// CHECK:STDOUT: %.loc8: type = splice_block %C.loc8_21.2 [symbolic = %C.loc8_21.1 (constants.%C.c8540f.2)] {
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
// CHECK:STDOUT: %Y.ref: %empty_tuple.type = name_ref Y, @C.as.I.impl.%Y.loc7_14.2 [symbolic = %Y (constants.%Y)]
// CHECK:STDOUT: %C.loc8_14.2: type = class_type @C, @C(constants.%Y) [symbolic = %C.loc8_14.1 (constants.%C.c8540f.2)]
// CHECK:STDOUT: %C.loc8_21.2: type = class_type @C, @C(constants.%Y) [symbolic = %C.loc8_21.1 (constants.%C.c8540f.2)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %x: @C.as.I.impl.F.loc8_17.1.%C.loc8_14.1 (%C.c8540f.2) = value_binding x, %x.param
// CHECK:STDOUT: %x: @C.as.I.impl.F.loc8_24.1.%C.loc8_21.1 (%C.c8540f.2) = value_binding x, %x.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.as.I.impl.F.decl.loc8_17.2: @C.as.I.impl.%C.as.I.impl.F.type.loc8_17.2 (%C.as.I.impl.F.type.cf838e.2) = fn_decl @C.as.I.impl.F.loc8_17.2 [symbolic = @C.as.I.impl.%C.as.I.impl.F.loc8_17.2 (constants.%C.as.I.impl.F.421e41.2)] {
// CHECK:STDOUT: %C.as.I.impl.F.decl.loc8_24.2: @C.as.I.impl.%C.as.I.impl.F.type.loc8_24.2 (%C.as.I.impl.F.type.cf838e.2) = fn_decl @C.as.I.impl.F.loc8_24.2 [symbolic = @C.as.I.impl.%C.as.I.impl.F.loc8_24.2 (constants.%C.as.I.impl.F.421e41.2)] {
// CHECK:STDOUT: %x.patt: %pattern_type.a96 = value_binding_pattern x [concrete]
// CHECK:STDOUT: %x.param_patt: %pattern_type.a96 = value_param_pattern %x.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %x.param: %empty_struct_type = value_param call_param0
// CHECK:STDOUT: %x: %empty_struct_type = value_binding x, %x.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl.loc8_17.2), @C.as.I.impl [concrete]
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%C.as.I.impl.F.decl.loc8_24.2), @C.as.I.impl [concrete]
// CHECK:STDOUT: %I.impl_witness.loc7_32.1: <witness> = impl_witness %I.impl_witness_table, @C.as.I.impl(constants.%Y) [symbolic = %I.impl_witness.loc7_32.2 (constants.%I.impl_witness)]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .C = <poisoned>
// CHECK:STDOUT: .Y = <poisoned>
// CHECK:STDOUT: .F = %C.as.I.impl.F.decl.loc8_17.1
// CHECK:STDOUT: .F = %C.as.I.impl.F.decl.loc8_24.1
// CHECK:STDOUT: witness = %I.impl_witness.loc7_32.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -271,50 +271,50 @@ fn G() {
// CHECK:STDOUT: fn;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @C.as.I.impl.F.loc8_17.1(@C.as.I.impl.%Y.loc7_14.2: %empty_tuple.type) {
// CHECK:STDOUT: generic fn @C.as.I.impl.F.loc8_24.1(@C.as.I.impl.%Y.loc7_14.2: %empty_tuple.type) {
// CHECK:STDOUT: %Y: %empty_tuple.type = symbolic_binding Y, 0 [symbolic = %Y (constants.%Y)]
// CHECK:STDOUT: %C.loc8_14.1: type = class_type @C, @C(%Y) [symbolic = %C.loc8_14.1 (constants.%C.c8540f.2)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc8_14.1 [symbolic = %pattern_type (constants.%pattern_type.fb2)]
// CHECK:STDOUT: %C.loc8_21.1: type = class_type @C, @C(%Y) [symbolic = %C.loc8_21.1 (constants.%C.c8540f.2)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc8_21.1 [symbolic = %pattern_type (constants.%pattern_type.fb2)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.loc8_14.1 [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C.loc8_21.1 [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%x.param: @C.as.I.impl.F.loc8_17.1.%C.loc8_14.1 (%C.c8540f.2)) {
// CHECK:STDOUT: fn(%x.param: @C.as.I.impl.F.loc8_24.1.%C.loc8_21.1 (%C.c8540f.2)) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @C.as.I.impl.F.loc8_17.2(@C.as.I.impl.%Y.loc7_14.2: %empty_tuple.type) {
// CHECK:STDOUT: generic fn @C.as.I.impl.F.loc8_24.2(@C.as.I.impl.%Y.loc7_14.2: %empty_tuple.type) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Y: %empty_tuple.type = symbolic_binding Y, 0 [symbolic = %Y (constants.%Y)]
// CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F.loc8_17.1, @C.as.I.impl(%Y) [symbolic = %C.as.I.impl.F.type (constants.%C.as.I.impl.F.type.cf838e.1)]
// CHECK:STDOUT: %C.as.I.impl.F: @C.as.I.impl.F.loc8_17.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = struct_value () [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_17.2: <specific function> = specific_function %C.as.I.impl.F, @C.as.I.impl.F.loc8_17.1(%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_17.2 (constants.%C.as.I.impl.F.specific_fn)]
// CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F.loc8_24.1, @C.as.I.impl(%Y) [symbolic = %C.as.I.impl.F.type (constants.%C.as.I.impl.F.type.cf838e.1)]
// CHECK:STDOUT: %C.as.I.impl.F: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = struct_value () [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_24.2: <specific function> = specific_function %C.as.I.impl.F, @C.as.I.impl.F.loc8_24.1(%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_24.2 (constants.%C.as.I.impl.F.specific_fn)]
// CHECK:STDOUT: %C: type = class_type @C, @C(%Y) [symbolic = %C (constants.%C.c8540f.2)]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %C [symbolic = %require_complete (constants.%require_complete)]
// CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = struct_value () [symbolic = %C.val (constants.%C.val)]
// CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = struct_value () [symbolic = %C.val (constants.%C.val)]
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %C, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)]
// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.155)]
// CHECK:STDOUT: %.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.6 (constants.%.371)]
// CHECK:STDOUT: %impl.elem0.2: @C.as.I.impl.F.loc8_17.2.%.6 (%.371) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)]
// CHECK:STDOUT: %impl.elem0.2: @C.as.I.impl.F.loc8_24.2.%.6 (%.371) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)]
// CHECK:STDOUT: %specific_impl_fn.2: <specific function> = specific_impl_function %impl.elem0.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%x.param: %empty_struct_type) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc8_17.1] {
// CHECK:STDOUT: fn(%x.param: %empty_struct_type) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc8: @C.as.I.impl.F.loc8_17.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = specific_constant @C.as.I.impl.%C.as.I.impl.F.decl.loc8_17.1, @C.as.I.impl(constants.%Y) [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %F.ref: @C.as.I.impl.F.loc8_17.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = name_ref F, %.loc8 [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %.loc8: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = specific_constant @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1, @C.as.I.impl(constants.%Y) [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %F.ref: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.cf838e.1) = name_ref F, %.loc8 [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %x.ref: %empty_struct_type = name_ref x, %x.param
// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_17.1: <specific function> = specific_function %F.ref, @C.as.I.impl.F.loc8_17.1(constants.%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_17.2 (constants.%C.as.I.impl.F.specific_fn)]
// CHECK:STDOUT: %.1: ref @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = temporary_storage
// CHECK:STDOUT: %.2: init @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) to %.1 = class_init () [symbolic = %C.val (constants.%C.val)]
// CHECK:STDOUT: %.3: ref @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = temporary %.1, %.2
// CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = converted %x.ref, %.3
// CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_17.2.%C (%C.c8540f.2) = acquire_value %.4
// CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_17.1(%.5)
// CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_24.1: <specific function> = specific_function %F.ref, @C.as.I.impl.F.loc8_24.1(constants.%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_24.2 (constants.%C.as.I.impl.F.specific_fn)]
// CHECK:STDOUT: %.1: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary_storage
// CHECK:STDOUT: %.2: init @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) to %.1 = class_init () [symbolic = %C.val (constants.%C.val)]
// CHECK:STDOUT: %.3: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary %.1, %.2
// CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = converted %x.ref, %.3
// CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = acquire_value %.4
// CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_24.1(%.5)
// CHECK:STDOUT: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.06b [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_17.2.%.6 (%.371) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)]
// CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_24.2.%.6 (%.371) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)]
// CHECK:STDOUT: %bound_method.1: <bound method> = bound_method %.3, %impl.elem0.1
// CHECK:STDOUT: %specific_impl_fn.1: <specific function> = specific_impl_function %impl.elem0.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)]
// CHECK:STDOUT: %bound_method.2: <bound method> = bound_method %.3, %specific_impl_fn.1
@@ -348,15 +348,15 @@ fn G() {
// CHECK:STDOUT: %I.impl_witness.loc7_32.2 => constants.%I.impl_witness
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.1 => constants.%C.as.I.impl.F.type.cf838e.1
// CHECK:STDOUT: %C.as.I.impl.F.loc8_17.1 => constants.%C.as.I.impl.F.421e41.1
// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_17.2 => constants.%C.as.I.impl.F.type.cf838e.2
// CHECK:STDOUT: %C.as.I.impl.F.loc8_17.2 => constants.%C.as.I.impl.F.421e41.2
// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_24.1 => constants.%C.as.I.impl.F.type.cf838e.1
// CHECK:STDOUT: %C.as.I.impl.F.loc8_24.1 => constants.%C.as.I.impl.F.421e41.1
// CHECK:STDOUT: %C.as.I.impl.F.type.loc8_24.2 => constants.%C.as.I.impl.F.type.cf838e.2
// CHECK:STDOUT: %C.as.I.impl.F.loc8_24.2 => constants.%C.as.I.impl.F.421e41.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C.as.I.impl.F.loc8_17.1(constants.%Y) {
// CHECK:STDOUT: specific @C.as.I.impl.F.loc8_24.1(constants.%Y) {
// CHECK:STDOUT: %Y => constants.%Y
// CHECK:STDOUT: %C.loc8_14.1 => constants.%C.c8540f.2
// CHECK:STDOUT: %C.loc8_21.1 => constants.%C.c8540f.2
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.fb2
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -372,7 +372,7 @@ fn G() {
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @C.as.I.impl.F.loc8_17.2(constants.%Y) {}
// CHECK:STDOUT: specific @C.as.I.impl.F.loc8_24.2(constants.%Y) {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- c.carbon
// CHECK:STDOUT:
@@ -450,7 +450,7 @@ fn G() {
// CHECK:STDOUT: %Main.import_ref.c82 = import_ref Main//a, loc4_13, unloaded
// CHECK:STDOUT: %Main.import_ref.972: @I.%I.WithSelf.F.type (%I.WithSelf.F.type.a1f) = import_ref Main//a, loc5_14, loaded [symbolic = @I.%I.WithSelf.F (constants.%I.WithSelf.F.cc3)]
// CHECK:STDOUT: %Main.import_ref.e97: <witness> = import_ref Main//b, loc7_32, loaded [symbolic = @C.as.I.impl.%I.impl_witness (constants.%I.impl_witness.a8f)]
// CHECK:STDOUT: %Main.import_ref.045: @C.as.I.impl.%C.as.I.impl.F.type.2 (%C.as.I.impl.F.type.cf838e.1) = import_ref Main//b, loc8_17, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.2 (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %Main.import_ref.045: @C.as.I.impl.%C.as.I.impl.F.type.2 (%C.as.I.impl.F.type.cf838e.1) = import_ref Main//b, loc8_24, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.2 (constants.%C.as.I.impl.F.421e41.1)]
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.045), @C.as.I.impl [concrete]
// CHECK:STDOUT: %Main.F.13b: @C.as.I.impl.%C.as.I.impl.F.type.1 (%C.as.I.impl.F.type.cf838e.2) = import_ref Main//b, F, loaded [symbolic = @C.as.I.impl.%C.as.I.impl.F.1 (constants.%C.as.I.impl.F.421e41.2)]
// CHECK:STDOUT: %Main.import_ref.c90e1a.2: %empty_tuple.type = import_ref Main//b, loc7_14, loaded [symbolic = @C.as.I.impl.%Y (constants.%Y)]
+11 -11
View File
@@ -192,7 +192,7 @@ interface X {
}
// Requires `X` to be complete, doesn't require Z to be complete.
fn F(T:! X where .X1 = {}) {}
fn F(unused T:! X where .X1 = {}) {}
// --- fail_incomplete_constraint.carbon
library "[[@TEST_NAME]]";
@@ -803,23 +803,23 @@ interface B {
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc16_12.1: type = splice_block %.loc16_12.2 [concrete = constants.%X_where.type] {
// CHECK:STDOUT: %.loc16_19.1: type = splice_block %.loc16_19.2 [concrete = constants.%X_where.type] {
// CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X.type]
// CHECK:STDOUT: %.Self.2: %X.type = symbolic_binding .Self [symbolic_self = constants.%.Self.637]
// CHECK:STDOUT: %.Self.ref: %X.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self.637]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
// CHECK:STDOUT: %.loc16_18: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
// CHECK:STDOUT: %.loc16_25: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
// CHECK:STDOUT: %X1.ref: %X.assoc_type = name_ref X1, @X1.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%X.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
// CHECK:STDOUT: %.loc16_25.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc16_25.2: type = converted %.loc16_25.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %.loc16_12.2: type = where_expr %.Self.2 [concrete = constants.%X_where.type] {
// CHECK:STDOUT: %.loc16_32.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc16_32.2: type = converted %.loc16_32.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %.loc16_19.2: type = where_expr %.Self.2 [concrete = constants.%X_where.type] {
// CHECK:STDOUT: requirement_base_facet_type constants.%X.type
// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc16_25.2
// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc16_32.2
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc16_6.2: %X_where.type = symbolic_binding T, 0 [symbolic = %T.loc16_6.1 (constants.%T)]
// CHECK:STDOUT: %T.loc16_13.2: %X_where.type = symbolic_binding T, 0 [symbolic = %T.loc16_13.1 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -886,8 +886,8 @@ interface B {
// CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 0, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.806)]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F(%T.loc16_6.2: %X_where.type) {
// CHECK:STDOUT: %T.loc16_6.1: %X_where.type = symbolic_binding T, 0 [symbolic = %T.loc16_6.1 (constants.%T)]
// CHECK:STDOUT: generic fn @F(%T.loc16_13.2: %X_where.type) {
// CHECK:STDOUT: %T.loc16_13.1: %X_where.type = symbolic_binding T, 0 [symbolic = %T.loc16_13.1 (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
@@ -929,7 +929,7 @@ interface B {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F(constants.%T) {
// CHECK:STDOUT: %T.loc16_6.1 => constants.%T
// CHECK:STDOUT: %T.loc16_13.1 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_incomplete_constraint.carbon
+4 -4
View File
@@ -32,7 +32,7 @@ class B {}
class C {}
impl A as Action(B) {
fn Op[self: Self]() {}
fn Op[unused self: Self]() {}
}
fn F(a: A) { a.(Action(B).Op)(); }
@@ -514,9 +514,9 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.450 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.d04: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A]
// CHECK:STDOUT: %Main.import_ref.5ad: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.879]
// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_23, unloaded
// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_30, unloaded
// CHECK:STDOUT: %Main.import_ref.04b = import_ref Main//action, loc5_22, unloaded
// CHECK:STDOUT: %Main.import_ref.4e3: %A.as.Action.impl.Op.type = import_ref Main//action, loc13_23, loaded [concrete = constants.%A.as.Action.impl.Op]
// CHECK:STDOUT: %Main.import_ref.4e3: %A.as.Action.impl.Op.type = import_ref Main//action, loc13_30, loaded [concrete = constants.%A.as.Action.impl.Op]
// CHECK:STDOUT: %Action.impl_witness_table = impl_witness_table (%Main.import_ref.4e3), @A.as.Action.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -706,7 +706,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: %Main.import_ref.450 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.d04: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A]
// CHECK:STDOUT: %Main.import_ref.5ad: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.879]
// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_23, unloaded
// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_30, unloaded
// CHECK:STDOUT: %Main.import_ref.8f24d3.3: <witness> = import_ref Main//action, loc10_10, loaded [concrete = constants.%complete_type]
// CHECK:STDOUT: %Main.import_ref.743 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.04b = import_ref Main//action, loc5_22, unloaded
@@ -29,10 +29,10 @@ fn F(T:! I & J, t: T) {
fn G() {
class C {
extend impl as I {
fn II[self: Self]() {}
fn II[unused self: Self]() {}
}
extend impl as J {
fn JJ[self: Self]() {}
fn JJ[unused self: Self]() {}
}
}
// Nesting FacetValue and FacetAccessTypes, the impl lookup for `JJ` resolves
+3 -3
View File
@@ -41,7 +41,7 @@ fn F(ZZ:! Z where .X = ()) {
// Z.Y is unspecified on `ZZ` so it's found on the final impl where it's known
// to be the concrete type (), which can then be used in this generic
// function.
let a: ZZ.Y = ();
let unused a: ZZ.Y = ();
}
// --- final_impl_precedence_over_facet_access_type_with_where.carbon
@@ -58,7 +58,7 @@ fn F[T:! Z where .X = ()](z: T) {
// z.Y is unspecified on `ZZ` so it's found on the final impl where it's known
// to be the concrete type (), which can then be used in this generic
// function.
let a: z.Y = ();
let unused a: z.Y = ();
}
// --- final_impl_makes_compatible_facet_values.carbon
@@ -125,4 +125,4 @@ final impl forall [T:! type] T as Z where .X = () {}
// TODO: This should be diagnosed as there is a final impl defining `.X = ()`,
// which makes the LHS of this rewrite constraint concrete. And since the RHS is
// not the same (or convertible from), the rewrite is impossible.
fn F(ZZ:! Z where .X = {.r: ()}) {}
fn F(unused ZZ:! Z where .X = {.r: ()}) {}
+5 -5
View File
@@ -21,7 +21,7 @@ interface HasF {
}
impl forall [T:! type] T as HasF {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
fn G(x: {}) {
@@ -55,7 +55,7 @@ interface HasF {
class C(T:! type) {}
impl forall [T:! type] C(T) as HasF {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
fn G(x: C({})) {
@@ -71,7 +71,7 @@ interface HasF(T:! type) {
}
impl forall [T:! type] {} as HasF(T) {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
fn G(x: {}) {
@@ -91,7 +91,7 @@ interface HasF {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
impl forall [T:! type, U:! type] T as HasF {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
fn G(x: {}) {
@@ -111,7 +111,7 @@ interface HasF(T:! type) {
}
impl forall [T:! type] T as HasF(T) {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
class A {}
+14 -14
View File
@@ -138,7 +138,7 @@ impl forall [U:! type, T:! ComparableWith(U)]
class C {}
class D {}
fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {}
fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {}
fn F() {
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+17]]:3: error: cycle found in search for impl of `ComparableWith(C)` for type `C` [ImplLookupCycle]
@@ -148,15 +148,15 @@ fn F() {
// CHECK:STDERR: impl forall [U:! type, T:! ComparableWith(U)]
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-9]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `ComparableWith(C)` [ConversionFailureTypeToFacet]
// CHECK:STDERR: Compare({} as C, {} as C);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-16]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
Compare({} as C, {} as C);
@@ -170,15 +170,15 @@ fn F() {
// CHECK:STDERR: impl forall [U:! type, T:! ComparableWith(U)]
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-31]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+7]]:3: error: cannot convert type `D` into type implementing `ComparableWith(C)` [ConversionFailureTypeToFacet]
// CHECK:STDERR: Compare({} as C, {} as D);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-38]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
Compare({} as C, {} as D);
@@ -192,15 +192,15 @@ fn F() {
// CHECK:STDERR: impl forall [U:! type, T:! ComparableWith(U)]
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-53]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `ComparableWith(D)` [ConversionFailureTypeToFacet]
// CHECK:STDERR: Compare({} as D, {} as C);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-60]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
Compare({} as D, {} as C);
}
@@ -286,7 +286,7 @@ impl forall [T:! type, U:! ComparableTo(T)] U as ComparableWith(T) {}
// CHECK:STDERR:
impl forall [T:! type, U:! ComparableTo(T)] T as ComparableWith(U) {}
fn Compare[T:! type, U:! ComparableWith(T)](t: T, u: U) {}
fn Compare[T:! type, U:! ComparableWith(T)](unused t: T, unused u: U) {}
fn F() {
Compare({} as C, {} as C);
+26 -26
View File
@@ -24,7 +24,7 @@ class C {}
// Same library as the class and interface.
impl C as HasF {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
// --- package_b.carbon
@@ -41,17 +41,17 @@ class D {}
// Same library as the interface.
impl PackageA.C as HasG {
fn G[self: Self]() {}
fn G[unused self: Self]() {}
}
// Same library as the class.
impl D as PackageA.HasF {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
// Same library as the class and interface.
impl D as HasG {
fn G[self: Self]() {}
fn G[unused self: Self]() {}
}
// --- use_cf.carbon
@@ -106,7 +106,7 @@ interface Z {
}
impl () as Z {
fn H[self: Self]() {}
fn H[unused self: Self]() {}
}
// --- import_associated_interface.carbon
@@ -126,7 +126,7 @@ package PackageHasParam;
class AnyParam[T:! type](X:! T) {}
interface Y {
fn K[self: Self]() {}
fn K[unused self: Self]() {}
}
// --- has_generic_interface.carbon
@@ -138,7 +138,7 @@ import PackageHasParam;
interface GenericInterface(U:! type) {}
impl PackageHasParam.AnyParam(GenericInterface) as PackageHasParam.Y {
fn K[self: Self]() {}
fn K[unused self: Self]() {}
}
fn L() {
@@ -168,7 +168,7 @@ import PackageHasParam;
class GenericClass(U:! type) {}
impl PackageHasParam.AnyParam(GenericClass) as PackageHasParam.Y {
fn K[self: Self]() {}
fn K[unused self: Self]() {}
}
fn L() {
@@ -205,7 +205,7 @@ class C(T:! type) {}
interface I { fn F[self: Self](); }
impl C((Extra1, Extra2, Extra3, Extra4, Extra5, Extra6, Extra7, Extra8)) as I {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
// --- fail_use_has_extra_interfaces.carbon
@@ -696,7 +696,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageA.import_ref.45d: <witness> = import_ref PackageA//default, loc11_16, loaded [concrete = constants.%HasF.impl_witness]
// CHECK:STDOUT: %PackageA.import_ref.83d: type = import_ref PackageA//default, loc11_6, loaded [concrete = constants.%C]
// CHECK:STDOUT: %PackageA.import_ref.4b0: type = import_ref PackageA//default, loc11_11, loaded [concrete = constants.%HasF.type]
// CHECK:STDOUT: %PackageA.import_ref.a28: %C.as.HasF.impl.F.type = import_ref PackageA//default, loc12_22, loaded [concrete = constants.%C.as.HasF.impl.F]
// CHECK:STDOUT: %PackageA.import_ref.a28: %C.as.HasF.impl.F.type = import_ref PackageA//default, loc12_29, loaded [concrete = constants.%C.as.HasF.impl.F]
// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageA.import_ref.a28), @C.as.HasF.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -842,7 +842,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageB.import_ref.3de: <witness> = import_ref PackageB//default, loc18_25, loaded [concrete = constants.%HasF.impl_witness]
// CHECK:STDOUT: %PackageB.import_ref.106: type = import_ref PackageB//default, loc18_6, loaded [concrete = constants.%D]
// CHECK:STDOUT: %PackageB.import_ref.7b1: type = import_ref PackageB//default, loc18_19, loaded [concrete = constants.%HasF.type]
// CHECK:STDOUT: %PackageB.import_ref.97f: %D.as.HasF.impl.F.type = import_ref PackageB//default, loc19_22, loaded [concrete = constants.%D.as.HasF.impl.F]
// CHECK:STDOUT: %PackageB.import_ref.97f: %D.as.HasF.impl.F.type = import_ref PackageB//default, loc19_29, loaded [concrete = constants.%D.as.HasF.impl.F]
// CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageB.import_ref.97f), @D.as.HasF.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1002,7 +1002,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageB.import_ref.468 = import_ref PackageB//default, inst{{[0-9A-F]+}} [no loc], unloaded
// CHECK:STDOUT: %PackageB.import_ref.106: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D]
// CHECK:STDOUT: %PackageB.import_ref.d31a52.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type]
// CHECK:STDOUT: %PackageB.import_ref.bb3: %C.as.HasG.impl.G.type = import_ref PackageB//default, loc14_22, loaded [concrete = constants.%C.as.HasG.impl.G]
// CHECK:STDOUT: %PackageB.import_ref.bb3: %C.as.HasG.impl.G.type = import_ref PackageB//default, loc14_29, loaded [concrete = constants.%C.as.HasG.impl.G]
// CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.bb3), @C.as.HasG.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1159,7 +1159,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageB.import_ref.608: <witness> = import_ref PackageB//default, loc23_16, loaded [concrete = constants.%HasG.impl_witness]
// CHECK:STDOUT: %PackageB.import_ref.106: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D]
// CHECK:STDOUT: %PackageB.import_ref.d31a52.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type]
// CHECK:STDOUT: %PackageB.import_ref.83e: %D.as.HasG.impl.G.type = import_ref PackageB//default, loc24_22, loaded [concrete = constants.%D.as.HasG.impl.G]
// CHECK:STDOUT: %PackageB.import_ref.83e: %D.as.HasG.impl.G.type = import_ref PackageB//default, loc24_29, loaded [concrete = constants.%D.as.HasG.impl.G]
// CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.83e), @D.as.HasG.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1428,7 +1428,7 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.5f5: <witness> = import_ref PackageAssociatedInterface//default, loc8_14, loaded [concrete = constants.%Z.impl_witness]
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.e5c: type = import_ref PackageAssociatedInterface//default, loc8_7, loaded [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.5fa: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [concrete = constants.%Z.type]
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.d43: %empty_tuple.type.as.Z.impl.H.type = import_ref PackageAssociatedInterface//default, loc9_22, loaded [concrete = constants.%empty_tuple.type.as.Z.impl.H]
// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.d43: %empty_tuple.type.as.Z.impl.H.type = import_ref PackageAssociatedInterface//default, loc9_29, loaded [concrete = constants.%empty_tuple.type.as.Z.impl.H]
// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%PackageAssociatedInterface.import_ref.d43), @empty_tuple.type.as.Z.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1565,10 +1565,10 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %self.param_patt: @Y.WithSelf.K.%pattern_type (%pattern_type.880) = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: @Y.WithSelf.K.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
// CHECK:STDOUT: %.loc7_14.1: type = splice_block %.loc7_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
// CHECK:STDOUT: %.loc7_21.1: type = splice_block %.loc7_21.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
// CHECK:STDOUT: %Self.ref: %Y.type = name_ref Self, @Y.%Self.loc6 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
// CHECK:STDOUT: %.loc7_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
// CHECK:STDOUT: %.loc7_21.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %self: @Y.WithSelf.K.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
// CHECK:STDOUT: }
@@ -1695,11 +1695,11 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageHasParam.import_ref.b3b: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
// CHECK:STDOUT: %PackageHasParam.import_ref.b42: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
// CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.633]
// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.633]
// CHECK:STDOUT: %PackageHasParam.K: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, K, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %PackageHasParam.import_ref.71dd35.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.079]
// CHECK:STDOUT: %PackageHasParam.import_ref.9b4 = import_ref PackageHasParam//default, loc6_13, unloaded
// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_22, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1952,15 +1952,15 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageGenericInterface.import_ref.116 = import_ref PackageGenericInterface//default, loc6_38, unloaded
// CHECK:STDOUT: %PackageGenericInterface.import_ref.b3bc94.2: type = import_ref PackageGenericInterface//default, loc6_28, loaded [symbolic = @GenericInterface.%U (constants.%U)]
// CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.633]
// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.633]
// CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded
// CHECK:STDOUT: %PackageHasParam.import_ref.71dd35.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.079]
// CHECK:STDOUT: %PackageHasParam.import_ref.9b4 = import_ref PackageHasParam//default, loc6_13, unloaded
// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_22, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.564: <witness> = import_ref PackageGenericInterface//default, loc8_70, loaded [concrete = constants.%Y.impl_witness]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.2fb: type = import_ref PackageGenericInterface//default, loc8_47, loaded [concrete = constants.%AnyParam.861]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.6c1: type = import_ref PackageGenericInterface//default, loc8_67, loaded [concrete = constants.%Y.type]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.ac9: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericInterface//default, loc9_22, loaded [concrete = constants.%AnyParam.as.Y.impl.K]
// CHECK:STDOUT: %PackageGenericInterface.import_ref.ac9: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericInterface//default, loc9_29, loaded [concrete = constants.%AnyParam.as.Y.impl.K]
// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericInterface.import_ref.ac9), @AnyParam.as.Y.impl [concrete]
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
// CHECK:STDOUT: }
@@ -2173,11 +2173,11 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageHasParam.import_ref.b3b: type = import_ref PackageHasParam//default, loc4_16, loaded [symbolic = @AnyParam.%T (constants.%T)]
// CHECK:STDOUT: %PackageHasParam.import_ref.b42: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)]
// CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.633]
// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.633]
// CHECK:STDOUT: %PackageHasParam.K: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, K, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %PackageHasParam.import_ref.71dd35.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.079]
// CHECK:STDOUT: %PackageHasParam.import_ref.9b4 = import_ref PackageHasParam//default, loc6_13, unloaded
// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_22, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -2422,15 +2422,15 @@ fn Test(c: HasExtraInterfaces.C(type)) {
// CHECK:STDOUT: %PackageGenericClass.import_ref.7ce = import_ref PackageGenericClass//default, inst{{[0-9A-F]+}} [no loc], unloaded
// CHECK:STDOUT: %PackageGenericClass.import_ref.b3b: type = import_ref PackageGenericClass//default, loc6_20, loaded [symbolic = @GenericClass.%U (constants.%U)]
// CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type]
// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_22, loaded [concrete = constants.%assoc0.633]
// CHECK:STDOUT: %PackageHasParam.import_ref.274: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.633]
// CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded
// CHECK:STDOUT: %PackageHasParam.import_ref.71dd35.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.079]
// CHECK:STDOUT: %PackageHasParam.import_ref.9b4 = import_ref PackageHasParam//default, loc6_13, unloaded
// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_22, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %PackageHasParam.import_ref.0e4: @Y.%Y.WithSelf.K.type (%Y.WithSelf.K.type.1bb) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.%Y.WithSelf.K (constants.%Y.WithSelf.K.378)]
// CHECK:STDOUT: %PackageGenericClass.import_ref.f5f: <witness> = import_ref PackageGenericClass//default, loc8_66, loaded [concrete = constants.%Y.impl_witness]
// CHECK:STDOUT: %PackageGenericClass.import_ref.1b3: type = import_ref PackageGenericClass//default, loc8_43, loaded [concrete = constants.%AnyParam.d71]
// CHECK:STDOUT: %PackageGenericClass.import_ref.6c1: type = import_ref PackageGenericClass//default, loc8_63, loaded [concrete = constants.%Y.type]
// CHECK:STDOUT: %PackageGenericClass.import_ref.6b4: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericClass//default, loc9_22, loaded [concrete = constants.%AnyParam.as.Y.impl.K]
// CHECK:STDOUT: %PackageGenericClass.import_ref.6b4: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericClass//default, loc9_29, loaded [concrete = constants.%AnyParam.as.Y.impl.K]
// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericClass.import_ref.6b4), @AnyParam.as.Y.impl [concrete]
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
// CHECK:STDOUT: }
+8 -8
View File
@@ -29,15 +29,15 @@ library "[[@TEST_NAME]]";
import library "error_interface_z";
fn F[U:! type](T:! Z) {
fn F[unused U:! type](T:! Z) {
// The value of `.X` is an error. It should not crash though.
//
// CHECK:STDERR: fail_import_error.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `()` to `T.(Z.X)` [ConversionFailure]
// CHECK:STDERR: let a: T.X = ();
// CHECK:STDERR: ^~
// CHECK:STDERR: fail_import_error.carbon:[[@LINE+4]]:16: note: type `()` does not implement interface `Core.ImplicitAs(T.(Z.X))` [MissingImplInMemberAccessNote]
// CHECK:STDERR: let a: T.X = ();
// CHECK:STDERR: ^~
// CHECK:STDERR: fail_import_error.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `()` to `T.(Z.X)` [ConversionFailure]
// CHECK:STDERR: let unused a: T.X = ();
// CHECK:STDERR: ^~
// CHECK:STDERR: fail_import_error.carbon:[[@LINE+4]]:23: note: type `()` does not implement interface `Core.ImplicitAs(T.(Z.X))` [MissingImplInMemberAccessNote]
// CHECK:STDERR: let unused a: T.X = ();
// CHECK:STDERR: ^~
// CHECK:STDERR:
let a: T.X = ();
let unused a: T.X = ();
}
+2 -2
View File
@@ -25,8 +25,8 @@ library "[[@TEST_NAME]]";
import library "interface_z";
fn F[U:! type](T:! Z) {
fn F[unused U:! type](T:! Z) {
// The value of `.X` can be known to be `C` here when the impl `T as Z(C)` is
// final.
let a: T.X = {} as C;
let unused a: T.X = {} as C;
}
@@ -66,7 +66,7 @@ class Outer(OuterParam:! type) {
let T:! type;
}
fn G(H:! Y where .T = ()) {}
fn G(unused H:! Y where .T = ()) {}
}
class C;
@@ -87,7 +87,7 @@ class Outer(OuterParam:! Z1) {
let T:! type;
}
fn G(H:! Y where .T = ()) {}
fn G(unused H:! Y where .T = ()) {}
class C;
impl C as Y where .T = () {}
@@ -244,25 +244,25 @@ fn F() {
// CHECK:STDOUT: %Outer.G.decl: @Outer.%Outer.G.type (%Outer.G.type.20d) = fn_decl @Outer.G [symbolic = @Outer.%Outer.G (constants.%Outer.G.b44)] {
// CHECK:STDOUT: %H.patt: @Outer.G.%pattern_type (%pattern_type.b97) = symbolic_binding_pattern H, 1 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc54_14.1: type = splice_block %.loc54_14.2 [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] {
// CHECK:STDOUT: %.loc54_21.1: type = splice_block %.loc54_21.2 [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] {
// CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
// CHECK:STDOUT: %.loc54_12: type = specific_constant @Outer.%Y.decl, @Outer(constants.%OuterParam) [symbolic = %Y.type (constants.%Y.type.6b3)]
// CHECK:STDOUT: %Y.ref: type = name_ref Y, %.loc54_12 [symbolic = %Y.type (constants.%Y.type.6b3)]
// CHECK:STDOUT: %.loc54_19: type = specific_constant @Outer.%Y.decl, @Outer(constants.%OuterParam) [symbolic = %Y.type (constants.%Y.type.6b3)]
// CHECK:STDOUT: %Y.ref: type = name_ref Y, %.loc54_19 [symbolic = %Y.type (constants.%Y.type.6b3)]
// CHECK:STDOUT: %.Self.3: @Outer.G.%Y.type (%Y.type.6b3) = symbolic_binding .Self [symbolic = %.Self.1 (constants.%.Self.cf7)]
// CHECK:STDOUT: %.Self.ref: @Outer.G.%Y.type (%Y.type.6b3) = name_ref .Self, %.Self.3 [symbolic = %.Self.1 (constants.%.Self.cf7)]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b3c)]
// CHECK:STDOUT: %.loc54_20.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b3c)]
// CHECK:STDOUT: %.loc54_20.2: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = specific_constant @T.%assoc0, @Y(constants.%OuterParam, constants.%.Self.cf7) [symbolic = %assoc0 (constants.%assoc0.049)]
// CHECK:STDOUT: %T.ref: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = name_ref T, %.loc54_20.2 [symbolic = %assoc0 (constants.%assoc0.049)]
// CHECK:STDOUT: %impl.elem0.loc54_20.2: type = impl_witness_access constants.%Y.lookup_impl_witness.3b9, element0 [symbolic = %impl.elem0.loc54_20.1 (constants.%impl.elem0.284)]
// CHECK:STDOUT: %.loc54_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc54_26.2: type = converted %.loc54_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc54_14.2: type = where_expr %.Self.3 [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] {
// CHECK:STDOUT: %.loc54_27.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.b3c)]
// CHECK:STDOUT: %.loc54_27.2: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = specific_constant @T.%assoc0, @Y(constants.%OuterParam, constants.%.Self.cf7) [symbolic = %assoc0 (constants.%assoc0.049)]
// CHECK:STDOUT: %T.ref: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = name_ref T, %.loc54_27.2 [symbolic = %assoc0 (constants.%assoc0.049)]
// CHECK:STDOUT: %impl.elem0.loc54_27.2: type = impl_witness_access constants.%Y.lookup_impl_witness.3b9, element0 [symbolic = %impl.elem0.loc54_27.1 (constants.%impl.elem0.284)]
// CHECK:STDOUT: %.loc54_33.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc54_33.2: type = converted %.loc54_33.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc54_21.2: type = where_expr %.Self.3 [symbolic = %Y_where.type (constants.%Y_where.type.7c7)] {
// CHECK:STDOUT: requirement_base_facet_type constants.%Y.type.6b3
// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc54_20.2, %.loc54_26.2
// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc54_27.2, %.loc54_33.2
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %H.loc54_8.2: @Outer.G.%Y_where.type (%Y_where.type.7c7) = symbolic_binding H, 1 [symbolic = %H.loc54_8.1 (constants.%H)]
// CHECK:STDOUT: %H.loc54_15.2: @Outer.G.%Y_where.type (%Y_where.type.7c7) = symbolic_binding H, 1 [symbolic = %H.loc54_15.1 (constants.%H)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
// CHECK:STDOUT: complete_type_witness = %complete_type
@@ -276,7 +276,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: class @C;
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Outer.G(@Outer.%OuterParam.loc49_13.2: type, %H.loc54_8.2: @Outer.G.%Y_where.type (%Y_where.type.7c7)) {
// CHECK:STDOUT: generic fn @Outer.G(@Outer.%OuterParam.loc49_13.2: type, %H.loc54_15.2: @Outer.G.%Y_where.type (%Y_where.type.7c7)) {
// CHECK:STDOUT: %OuterParam: type = symbolic_binding OuterParam, 0 [symbolic = %OuterParam (constants.%OuterParam)]
// CHECK:STDOUT: %Y.type: type = facet_type <@Y, @Y(%OuterParam)> [symbolic = %Y.type (constants.%Y.type.6b3)]
// CHECK:STDOUT: %.Self.1: @Outer.G.%Y.type (%Y.type.6b3) = symbolic_binding .Self [symbolic = %.Self.1 (constants.%.Self.cf7)]
@@ -285,9 +285,9 @@ fn F() {
// CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y, @Y(%OuterParam) [symbolic = %Y.assoc_type (constants.%Y.assoc_type.978)]
// CHECK:STDOUT: %assoc0: @Outer.G.%Y.assoc_type (%Y.assoc_type.978) = assoc_entity element0, @Y.%T [symbolic = %assoc0 (constants.%assoc0.049)]
// CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.1, @Y, @Y(%OuterParam) [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness.3b9)]
// CHECK:STDOUT: %impl.elem0.loc54_20.1: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc54_20.1 (constants.%impl.elem0.284)]
// CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc54_20.1 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.7c7)]
// CHECK:STDOUT: %H.loc54_8.1: @Outer.G.%Y_where.type (%Y_where.type.7c7) = symbolic_binding H, 1 [symbolic = %H.loc54_8.1 (constants.%H)]
// CHECK:STDOUT: %impl.elem0.loc54_27.1: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc54_27.1 (constants.%impl.elem0.284)]
// CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc54_27.1 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.7c7)]
// CHECK:STDOUT: %H.loc54_15.1: @Outer.G.%Y_where.type (%Y_where.type.7c7) = symbolic_binding H, 1 [symbolic = %H.loc54_15.1 (constants.%H)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %Y_where.type [symbolic = %pattern_type (constants.%pattern_type.b97)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -353,9 +353,9 @@ fn F() {
// CHECK:STDOUT: %Y.assoc_type => constants.%Y.assoc_type.978
// CHECK:STDOUT: %assoc0 => constants.%assoc0.049
// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.3b9
// CHECK:STDOUT: %impl.elem0.loc54_20.1 => constants.%impl.elem0.284
// CHECK:STDOUT: %impl.elem0.loc54_27.1 => constants.%impl.elem0.284
// CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.7c7
// CHECK:STDOUT: %H.loc54_8.1 => constants.%H
// CHECK:STDOUT: %H.loc54_15.1 => constants.%H
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.b97
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -405,9 +405,9 @@ fn F() {
// CHECK:STDOUT: %Y.assoc_type => constants.%Y.assoc_type.4bc
// CHECK:STDOUT: %assoc0 => constants.%assoc0.7fe
// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.b08
// CHECK:STDOUT: %impl.elem0.loc54_20.1 => constants.%impl.elem0.48b
// CHECK:STDOUT: %impl.elem0.loc54_27.1 => constants.%impl.elem0.48b
// CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.ad5
// CHECK:STDOUT: %H.loc54_8.1 => constants.%facet_value
// CHECK:STDOUT: %H.loc54_15.1 => constants.%facet_value
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.c51
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -635,25 +635,25 @@ fn F() {
// CHECK:STDOUT: %Outer.G.decl: @Outer.%Outer.G.type (%Outer.G.type.e0a) = fn_decl @Outer.G [symbolic = @Outer.%Outer.G (constants.%Outer.G.dc4)] {
// CHECK:STDOUT: %H.patt: @Outer.G.%pattern_type (%pattern_type.6bf) = symbolic_binding_pattern H, 1 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc11_14.1: type = splice_block %.loc11_14.2 [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] {
// CHECK:STDOUT: %.loc11_21.1: type = splice_block %.loc11_21.2 [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] {
// CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
// CHECK:STDOUT: %.loc11_12: type = specific_constant @Outer.%Y.decl, @Outer(constants.%OuterParam) [symbolic = %Y.type (constants.%Y.type.6ae)]
// CHECK:STDOUT: %Y.ref: type = name_ref Y, %.loc11_12 [symbolic = %Y.type (constants.%Y.type.6ae)]
// CHECK:STDOUT: %.loc11_19: type = specific_constant @Outer.%Y.decl, @Outer(constants.%OuterParam) [symbolic = %Y.type (constants.%Y.type.6ae)]
// CHECK:STDOUT: %Y.ref: type = name_ref Y, %.loc11_19 [symbolic = %Y.type (constants.%Y.type.6ae)]
// CHECK:STDOUT: %.Self.3: @Outer.G.%Y.type (%Y.type.6ae) = symbolic_binding .Self [symbolic = %.Self.1 (constants.%.Self.997)]
// CHECK:STDOUT: %.Self.ref: @Outer.G.%Y.type (%Y.type.6ae) = name_ref .Self, %.Self.3 [symbolic = %.Self.1 (constants.%.Self.997)]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.238)]
// CHECK:STDOUT: %.loc11_20.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.238)]
// CHECK:STDOUT: %.loc11_20.2: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = specific_constant @T.%assoc0, @Y(constants.%OuterParam, constants.%.Self.997) [symbolic = %assoc0 (constants.%assoc0.43a)]
// CHECK:STDOUT: %T.ref: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = name_ref T, %.loc11_20.2 [symbolic = %assoc0 (constants.%assoc0.43a)]
// CHECK:STDOUT: %impl.elem0.loc11_20.2: type = impl_witness_access constants.%Y.lookup_impl_witness.5bf, element0 [symbolic = %impl.elem0.loc11_20.1 (constants.%impl.elem0.63e)]
// CHECK:STDOUT: %.loc11_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc11_26.2: type = converted %.loc11_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc11_14.2: type = where_expr %.Self.3 [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] {
// CHECK:STDOUT: %.loc11_27.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.binding.as_type (constants.%.Self.binding.as_type.238)]
// CHECK:STDOUT: %.loc11_27.2: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = specific_constant @T.%assoc0, @Y(constants.%OuterParam, constants.%.Self.997) [symbolic = %assoc0 (constants.%assoc0.43a)]
// CHECK:STDOUT: %T.ref: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = name_ref T, %.loc11_27.2 [symbolic = %assoc0 (constants.%assoc0.43a)]
// CHECK:STDOUT: %impl.elem0.loc11_27.2: type = impl_witness_access constants.%Y.lookup_impl_witness.5bf, element0 [symbolic = %impl.elem0.loc11_27.1 (constants.%impl.elem0.63e)]
// CHECK:STDOUT: %.loc11_33.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc11_33.2: type = converted %.loc11_33.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc11_21.2: type = where_expr %.Self.3 [symbolic = %Y_where.type (constants.%Y_where.type.b0f)] {
// CHECK:STDOUT: requirement_base_facet_type constants.%Y.type.6ae
// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11_20.2, %.loc11_26.2
// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc11_27.2, %.loc11_33.2
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %H.loc11_8.2: @Outer.G.%Y_where.type (%Y_where.type.b0f) = symbolic_binding H, 1 [symbolic = %H.loc11_8.1 (constants.%H)]
// CHECK:STDOUT: %H.loc11_15.2: @Outer.G.%Y_where.type (%Y_where.type.b0f) = symbolic_binding H, 1 [symbolic = %H.loc11_15.1 (constants.%H)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl: type = class_decl @C [symbolic = @Outer.%C (constants.%C.521)] {} {}
// CHECK:STDOUT: impl_decl @C.as.Y.impl [concrete] {} {
@@ -690,7 +690,7 @@ fn F() {
// CHECK:STDOUT: class;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Outer.G(@Outer.%OuterParam.loc6_13.2: %Z1.type, %H.loc11_8.2: @Outer.G.%Y_where.type (%Y_where.type.b0f)) {
// CHECK:STDOUT: generic fn @Outer.G(@Outer.%OuterParam.loc6_13.2: %Z1.type, %H.loc11_15.2: @Outer.G.%Y_where.type (%Y_where.type.b0f)) {
// CHECK:STDOUT: %OuterParam: %Z1.type = symbolic_binding OuterParam, 0 [symbolic = %OuterParam (constants.%OuterParam)]
// CHECK:STDOUT: %Y.type: type = facet_type <@Y, @Y(%OuterParam)> [symbolic = %Y.type (constants.%Y.type.6ae)]
// CHECK:STDOUT: %.Self.1: @Outer.G.%Y.type (%Y.type.6ae) = symbolic_binding .Self [symbolic = %.Self.1 (constants.%.Self.997)]
@@ -699,9 +699,9 @@ fn F() {
// CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y, @Y(%OuterParam) [symbolic = %Y.assoc_type (constants.%Y.assoc_type.aab)]
// CHECK:STDOUT: %assoc0: @Outer.G.%Y.assoc_type (%Y.assoc_type.aab) = assoc_entity element0, @Y.%T [symbolic = %assoc0 (constants.%assoc0.43a)]
// CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.1, @Y, @Y(%OuterParam) [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness.5bf)]
// CHECK:STDOUT: %impl.elem0.loc11_20.1: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_20.1 (constants.%impl.elem0.63e)]
// CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc11_20.1 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.b0f)]
// CHECK:STDOUT: %H.loc11_8.1: @Outer.G.%Y_where.type (%Y_where.type.b0f) = symbolic_binding H, 1 [symbolic = %H.loc11_8.1 (constants.%H)]
// CHECK:STDOUT: %impl.elem0.loc11_27.1: type = impl_witness_access %Y.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_27.1 (constants.%impl.elem0.63e)]
// CHECK:STDOUT: %Y_where.type: type = facet_type <@Y, @Y(%OuterParam) where %impl.elem0.loc11_27.1 = constants.%empty_tuple.type> [symbolic = %Y_where.type (constants.%Y_where.type.b0f)]
// CHECK:STDOUT: %H.loc11_15.1: @Outer.G.%Y_where.type (%Y_where.type.b0f) = symbolic_binding H, 1 [symbolic = %H.loc11_15.1 (constants.%H)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %Y_where.type [symbolic = %pattern_type (constants.%pattern_type.6bf)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
@@ -803,9 +803,9 @@ fn F() {
// CHECK:STDOUT: %Y.assoc_type => constants.%Y.assoc_type.aab
// CHECK:STDOUT: %assoc0 => constants.%assoc0.43a
// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.5bf
// CHECK:STDOUT: %impl.elem0.loc11_20.1 => constants.%impl.elem0.63e
// CHECK:STDOUT: %impl.elem0.loc11_27.1 => constants.%impl.elem0.63e
// CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.b0f
// CHECK:STDOUT: %H.loc11_8.1 => constants.%H
// CHECK:STDOUT: %H.loc11_15.1 => constants.%H
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bf
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -894,9 +894,9 @@ fn F() {
// CHECK:STDOUT: %Y.assoc_type => constants.%Y.assoc_type.748
// CHECK:STDOUT: %assoc0 => constants.%assoc0.5a7
// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness.249
// CHECK:STDOUT: %impl.elem0.loc11_20.1 => constants.%impl.elem0.9e9
// CHECK:STDOUT: %impl.elem0.loc11_27.1 => constants.%impl.elem0.9e9
// CHECK:STDOUT: %Y_where.type => constants.%Y_where.type.c95
// CHECK:STDOUT: %H.loc11_8.1 => constants.%facet_value.256
// CHECK:STDOUT: %H.loc11_15.1 => constants.%facet_value.256
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.81f
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
+37 -37
View File
@@ -26,7 +26,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket impl
// of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here.
let a: C.(Z(C).X) = {} as C;
let unused a: C.(Z(C).X) = {} as C;
}
// --- specialized_self_second.carbon
@@ -45,7 +45,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket impl
// of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here.
let a: C.(Z(C).X) = {} as C;
let unused a: C.(Z(C).X) = {} as C;
}
// --- specialized_constraint_first.carbon
@@ -64,7 +64,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket impl
// of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here.
let a: C.(Z(C).X) = {} as C;
let unused a: C.(Z(C).X) = {} as C;
}
// --- specialized_constraint_second.carbon
@@ -83,7 +83,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket impl
// of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here.
let a: C.(Z(C).X) = {} as C;
let unused a: C.(Z(C).X) = {} as C;
}
// --- specialized_self_vs_constraint_self_first.carbon
@@ -102,7 +102,7 @@ fn F() {
// The specialization of `C(())` should match in preference to the blanket impl
// of `C(T)`. If the blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here.
let a: C(()).(Z(C(())).X) = {} as C(());
let unused a: C(()).(Z(C(())).X) = {} as C(());
}
// --- specialized_self_vs_constraint_self_second.carbon
@@ -121,7 +121,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket impl
// of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here.
let a: C(()).(Z(C(())).X) = {} as C(());
let unused a: C(()).(Z(C(())).X) = {} as C(());
}
// --- generic_class_with_fully_specified_impl.carbon
@@ -142,7 +142,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket
// impls of `Z(T)`. If a blanket impl is chosen, then `a` will have a struct
// type which will fail to typecheck here when constructed from a `C` value.
let a: C(()).(Z(()).X) = {} as C(());
let unused a: C(()).(Z(()).X) = {} as C(());
}
// --- generic_class_with_blanket_impl_first.carbon
@@ -162,7 +162,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket
// impls of `Z(T)`. If a blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here when constructed from a `C` value.
let a: C(()).(Z(()).X) = {} as C(());
let unused a: C(()).(Z(()).X) = {} as C(());
}
// --- generic_class_with_blanket_impl_second.carbon
@@ -182,7 +182,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket
// impls of `Z(T)`. If a blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here when constructed from a `C` value.
let a: C(()).(Z(()).X) = {} as C(());
let unused a: C(()).(Z(()).X) = {} as C(());
}
// --- specialized_class_with_facet_value_param.carbon
@@ -211,7 +211,7 @@ impl forall [T:! Z] C(D(E), T) as Z where .X = C(E, E) {}
impl forall [T:! Z] C(T, T) as Z where .X = () {}
fn F() {
let a: C(D(E), D(E)).(Z.X) = {} as C(E, E);
let unused a: C(D(E), D(E)).(Z.X) = {} as C(E, E);
}
// --- fail_specialized_class_with_symbolic_facet_value_param.carbon
@@ -232,19 +232,19 @@ impl D as Y {}
// caller has.
impl forall [D:! Y] C(D) as Z where .X = () {}
fn F[D:! Y](d: D) {
fn F[D:! Y](unused d: D) {
// The FacetValue deduced for the param of `C` will be a symbolic FacetValue
// because we are in a generic where `D` is an unknown type, which will cause
// the query and impl self type to be C(FacetValue) for a symbolic FacetValue.
//
// CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `()` to `C(D).(Z.X)` [ConversionFailure]
// CHECK:STDERR: let a: C(D).(Z.X) = ();
// CHECK:STDERR: ^~
// CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+4]]:23: note: type `()` does not implement interface `Core.ImplicitAs(C(D).(Z.X))` [MissingImplInMemberAccessNote]
// CHECK:STDERR: let a: C(D).(Z.X) = ();
// CHECK:STDERR: ^~
// CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+7]]:30: error: cannot implicitly convert expression of type `()` to `C(D).(Z.X)` [ConversionFailure]
// CHECK:STDERR: let unused a: C(D).(Z.X) = ();
// CHECK:STDERR: ^~
// CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+4]]:30: note: type `()` does not implement interface `Core.ImplicitAs(C(D).(Z.X))` [MissingImplInMemberAccessNote]
// CHECK:STDERR: let unused a: C(D).(Z.X) = ();
// CHECK:STDERR: ^~
// CHECK:STDERR:
let a: C(D).(Z.X) = ();
let unused a: C(D).(Z.X) = ();
}
// --- pointer_specialization_first.carbon
@@ -263,7 +263,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket impl
// of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here.
let a: (C*).(Z.X) = {} as C;
let unused a: (C*).(Z.X) = {} as C;
}
// --- pointer_specialization_second.carbon
@@ -282,7 +282,7 @@ fn F() {
// The specialization of `Z(C)` should match in preference to the blanket impl
// of `Z(T)`. If the blanket impl is chosen, then `a` will have type `()`
// which will fail to typecheck here.
let a: (C*).(Z.X) = {} as C;
let unused a: (C*).(Z.X) = {} as C;
}
// --- cycle_in_deduce_avoided_by_specialization.carbon
@@ -304,7 +304,7 @@ impl forall [T:! Z] C(T) as Z where .X = () {}
impl C(()) as Z where .X = C(()) {}
fn F() {
let a: C(()).(Z.X) = {} as C(());
let unused a: C(()).(Z.X) = {} as C(());
}
// --- final_specialization_before_generic_use_of_type_constant.carbon
@@ -320,10 +320,10 @@ impl forall [T:! type, U:! type] T as Z(U) where .X = () {}
final impl forall [T:! type] T as Z(C) where .X = C {}
fn F[U:! type](T:! Z(C)) {
fn F[unused U:! type](T:! Z(C)) {
// The value of `.X` can be known to be `C` here when the impl `T as Z(C)` is
// final.
let a: T.X = {} as C;
let unused a: T.X = {} as C;
}
// --- fail_specialization_written_after_generic_use_of_type_constant.carbon
@@ -337,16 +337,16 @@ class C {}
impl forall [T:! type, U:! type] T as Z(U) where .X = () {}
fn F[U:! type](T:! Z(C)) {
fn F[unused U:! type](T:! Z(C)) {
// The value of `.X` is symbolic, it can't be assigned a value of type `C`.
// CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `C` to `T.(Z(C).X)` [ConversionFailure]
// CHECK:STDERR: let a: T.X = {} as C;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+4]]:16: note: type `C` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote]
// CHECK:STDERR: let a: T.X = {} as C;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `C` to `T.(Z(C).X)` [ConversionFailure]
// CHECK:STDERR: let unused a: T.X = {} as C;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+4]]:23: note: type `C` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote]
// CHECK:STDERR: let unused a: T.X = {} as C;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
let a: T.X = {} as C;
let unused a: T.X = {} as C;
}
final impl forall [T:! type] T as Z(C) where .X = C {}
@@ -385,7 +385,7 @@ impl C as Z where .V = {} {
}
fn F() {
let x: {}* = G(C);
let unused x: {}* = G(C);
}
// --- specialization_written_after_generic_use_with_generic_interface.carbon
@@ -422,7 +422,7 @@ impl C as Z(C) where .V = {} {
}
fn F() {
let x: {}* = G(C);
let unused x: {}* = G(C);
}
// --- type_structure_first_difference.carbon
@@ -451,7 +451,7 @@ fn F(T:! Z(C)) -> T.(Z(C).X) {
fn G() {
// This won't typecheck if the first impl is selected.
let a: () = F(C);
let unused a: () = F(C);
}
// --- extend_impl_as_specialization.carbon
@@ -471,7 +471,7 @@ class C(S:! type) {
fn F() {
var t: ();
let a: ()* = C(()).CC(&t);
let b: C(()).X = *a;
let unused b: C(()).X = *a;
}
// --- final_impl_as_specialization.carbon
@@ -489,7 +489,7 @@ class C(S:! type) {
}
fn F() {
let a: () = C(()).CC();
let unused a: () = C(()).CC();
}
// --- final_extend_impl_as_specialization.carbon
@@ -508,5 +508,5 @@ class C(S:! type) {
fn F() {
let a: () = C(()).CC();
let b: C(()).X = a;
let unused b: C(()).X = a;
}
@@ -19,7 +19,7 @@ interface I {
}
impl forall [U:! type] U as I where .T = () {
fn F[self: Self]() -> () { return (); }
fn F[unused self: Self]() -> () { return (); }
}
// CHECK:STDERR: fail_final_poisoned_concrete_query_in_specific.carbon:[[@LINE+3]]:25: error: found `impl` that would change the result of an earlier use of `C* as I` [PoisonedImplLookupConcreteResult]
@@ -58,12 +58,12 @@ impl forall [U:! type] U as I where .T = () {}
class C {}
fn H[W:! type](v: W) {
fn H[W:! type](unused v: W) {
// This concrete impl lookup query poisons any further specializations.
// CHECK:STDERR: fail_final_poisoned_concrete_query_in_generic.carbon:[[@LINE+3]]:10: error: found `impl` that would change the result of an earlier use of `C as I` [PoisonedImplLookupConcreteResult]
// CHECK:STDERR: let a: C.(I.T) = ();
// CHECK:STDERR: ^~~~~~~
let a: C.(I.T) = ();
// CHECK:STDERR: fail_final_poisoned_concrete_query_in_generic.carbon:[[@LINE+3]]:17: error: found `impl` that would change the result of an earlier use of `C as I` [PoisonedImplLookupConcreteResult]
// CHECK:STDERR: let unused a: C.(I.T) = ();
// CHECK:STDERR: ^~~~~~~
let unused a: C.(I.T) = ();
}
// CHECK:STDERR: fail_final_poisoned_concrete_query_in_generic.carbon:[[@LINE+7]]:1: note: the use would select the `impl` here but it was not found yet [PoisonedImplLookupConcreteResultNoteBadImpl]
@@ -86,7 +86,7 @@ interface I {
class C(U:! type) {}
impl forall [U:! type] C(U) as I where .T = () {
fn F[self: Self]() -> () { return (); }
fn F[unused self: Self]() -> () { return (); }
}
fn G(c: C(())) -> () {
@@ -105,7 +105,7 @@ fn G(c: C(())) -> () {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
impl C(()) as I where .T = {} {
fn F[self: Self]() -> {} { return {}; }
fn F[unused self: Self]() -> {} { return {}; }
}
// --- fail_final_poisoned_concrete_query_nested_type_in_interface.carbon
@@ -117,7 +117,7 @@ interface I(U:! type) {
}
impl forall [U:! type] U as I(U) where .T = () {
fn F[self: Self]() -> () { return (); }
fn F[unused self: Self]() -> () { return (); }
}
class C {}
@@ -138,7 +138,7 @@ fn G(c: C) -> () {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
impl C as I(C) where .T = {} {
fn F[self: Self]() -> {} { return {}; }
fn F[unused self: Self]() -> {} { return {}; }
}
// --- todo_fail_final_poisoned_by_generic_query.carbon
@@ -150,7 +150,7 @@ interface I {
}
impl forall [U:! type] U as I where .T = () {
fn F[self: Self]() -> () { return (); }
fn F[unused self: Self]() -> () { return (); }
}
fn H[W:! type](v: W) -> W.(I.T) {
@@ -27,7 +27,7 @@ final impl forall [T:! type] T as Z(C) where .X = T {}
fn F(T:! Z(C), t: T) {
// This should typecheck, the `final impl` should give the same `T`.
let a: T.X = t;
let unused a: T.X = t;
}
// --- fail_nonfinal_specialized_symbolic_rewrite.carbon
@@ -45,14 +45,14 @@ impl forall [T:! type, S:! type] T as Z(S) where .X = () {}
impl forall [T:! type] T as Z(C) where .X = T {}
fn F(T:! Z(C), t: T) {
// CHECK:STDERR: fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `T` to `T.(Z(C).X)` [ConversionFailure]
// CHECK:STDERR: let a: T.X = t;
// CHECK:STDERR: ^
// CHECK:STDERR: fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+4]]:16: note: type `T` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote]
// CHECK:STDERR: let a: T.X = t;
// CHECK:STDERR: ^
// CHECK:STDERR: fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `T` to `T.(Z(C).X)` [ConversionFailure]
// CHECK:STDERR: let unused a: T.X = t;
// CHECK:STDERR: ^
// CHECK:STDERR: fail_nonfinal_specialized_symbolic_rewrite.carbon:[[@LINE+4]]:23: note: type `T` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote]
// CHECK:STDERR: let unused a: T.X = t;
// CHECK:STDERR: ^
// CHECK:STDERR:
let a: T.X = t;
let unused a: T.X = t;
}
// --- final_impl_rewrite_of_symbolic_through_impl_lookup.carbon
@@ -328,7 +328,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete (constants.%require_complete.f3b)]
// CHECK:STDOUT: %.loc15_11.4: require_specific_def_type = require_specific_def @T.as.Z.impl.cf0(%T.binding.as_type) [symbolic = %.loc15_11.4 (constants.%.7b3)]
// CHECK:STDOUT: %.loc15_18.4: require_specific_def_type = require_specific_def @T.as.Z.impl.cf0(%T.binding.as_type) [symbolic = %.loc15_18.4 (constants.%.7b3)]
// CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness @T.as.Z.impl.cf0.%Z.impl_witness_table, @T.as.Z.impl.cf0(%T.binding.as_type) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.5a3)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%t.param: @F.%T.binding.as_type (%T.binding.as_type)) {
@@ -337,12 +337,12 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
// CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.bb9) = value_binding_pattern a [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %t.ref: @F.%T.binding.as_type (%T.binding.as_type) = name_ref t, %t
// CHECK:STDOUT: %.loc15_11.1: type = splice_block %impl.elem0 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
// CHECK:STDOUT: %.loc15_18.1: type = splice_block %impl.elem0 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)] {
// CHECK:STDOUT: %T.ref.loc15: %Z.type.be4 = name_ref T, %T.loc13_6.2 [symbolic = %T.loc13_6.1 (constants.%T.fe5)]
// CHECK:STDOUT: %T.as_type.loc15: type = facet_access_type %T.ref.loc15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
// CHECK:STDOUT: %.loc15_11.2: type = converted %T.ref.loc15, %T.as_type.loc15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
// CHECK:STDOUT: %.loc15_11.3: %Z.assoc_type.553 = specific_constant @X.%assoc0, @Z(constants.%C, constants.%T.fe5) [concrete = constants.%assoc0.1e0]
// CHECK:STDOUT: %X.ref: %Z.assoc_type.553 = name_ref X, %.loc15_11.3 [concrete = constants.%assoc0.1e0]
// CHECK:STDOUT: %.loc15_18.2: type = converted %T.ref.loc15, %T.as_type.loc15 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
// CHECK:STDOUT: %.loc15_18.3: %Z.assoc_type.553 = specific_constant @X.%assoc0, @Z(constants.%C, constants.%T.fe5) [concrete = constants.%assoc0.1e0]
// CHECK:STDOUT: %X.ref: %Z.assoc_type.553 = name_ref X, %.loc15_18.3 [concrete = constants.%assoc0.1e0]
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.5a3, element0 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a: @F.%T.binding.as_type (%T.binding.as_type) = value_binding a, %t.ref
@@ -725,12 +725,12 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc14: <witness> = require_complete_type %T.binding.as_type [symbolic = %require_complete.loc14 (constants.%require_complete.f3b)]
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc14_6.1, @Z, @Z(constants.%C) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness.1cb)]
// CHECK:STDOUT: %impl.elem0.loc22_11.2: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_11.2 (constants.%impl.elem0.a5e)]
// CHECK:STDOUT: %require_complete.loc22_11: <witness> = require_complete_type %impl.elem0.loc22_11.2 [symbolic = %require_complete.loc22_11 (constants.%require_complete.7cf)]
// CHECK:STDOUT: %pattern_type.loc22: type = pattern_type %impl.elem0.loc22_11.2 [symbolic = %pattern_type.loc22 (constants.%pattern_type.7ae)]
// CHECK:STDOUT: %ImplicitAs.type.loc22_16.2: type = facet_type <@ImplicitAs, @ImplicitAs(%impl.elem0.loc22_11.2)> [symbolic = %ImplicitAs.type.loc22_16.2 (constants.%ImplicitAs.type.7e4)]
// CHECK:STDOUT: %require_complete.loc22_16: <witness> = require_complete_type %ImplicitAs.type.loc22_16.2 [symbolic = %require_complete.loc22_16 (constants.%require_complete.591)]
// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%impl.elem0.loc22_11.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ac6)]
// CHECK:STDOUT: %impl.elem0.loc22_18.2: type = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_18.2 (constants.%impl.elem0.a5e)]
// CHECK:STDOUT: %require_complete.loc22_18: <witness> = require_complete_type %impl.elem0.loc22_18.2 [symbolic = %require_complete.loc22_18 (constants.%require_complete.7cf)]
// CHECK:STDOUT: %pattern_type.loc22: type = pattern_type %impl.elem0.loc22_18.2 [symbolic = %pattern_type.loc22 (constants.%pattern_type.7ae)]
// CHECK:STDOUT: %ImplicitAs.type.loc22_23.2: type = facet_type <@ImplicitAs, @ImplicitAs(%impl.elem0.loc22_18.2)> [symbolic = %ImplicitAs.type.loc22_23.2 (constants.%ImplicitAs.type.7e4)]
// CHECK:STDOUT: %require_complete.loc22_23: <witness> = require_complete_type %ImplicitAs.type.loc22_23.2 [symbolic = %require_complete.loc22_23 (constants.%require_complete.591)]
// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%impl.elem0.loc22_18.2) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ac6)]
// CHECK:STDOUT: %assoc0: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = assoc_entity element0, imports.%Core.import_ref.201 [symbolic = %assoc0 (constants.%assoc0.ae8)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%t.param: @F.%T.binding.as_type (%T.binding.as_type)) {
@@ -739,19 +739,19 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) {
// CHECK:STDOUT: %a.patt: @F.%pattern_type.loc22 (%pattern_type.7ae) = value_binding_pattern a [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %t.ref: @F.%T.binding.as_type (%T.binding.as_type) = name_ref t, %t
// CHECK:STDOUT: %.loc22_11.1: type = splice_block %impl.elem0.loc22_11.1 [symbolic = %impl.elem0.loc22_11.2 (constants.%impl.elem0.a5e)] {
// CHECK:STDOUT: %.loc22_18.1: type = splice_block %impl.elem0.loc22_18.1 [symbolic = %impl.elem0.loc22_18.2 (constants.%impl.elem0.a5e)] {
// CHECK:STDOUT: %T.ref.loc22: %Z.type.be4 = name_ref T, %T.loc14_6.2 [symbolic = %T.loc14_6.1 (constants.%T.fe5)]
// CHECK:STDOUT: %T.as_type.loc22: type = facet_access_type %T.ref.loc22 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
// CHECK:STDOUT: %.loc22_11.2: type = converted %T.ref.loc22, %T.as_type.loc22 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
// CHECK:STDOUT: %.loc22_11.3: %Z.assoc_type.553 = specific_constant @X.%assoc0, @Z(constants.%C, constants.%T.fe5) [concrete = constants.%assoc0.1e0]
// CHECK:STDOUT: %X.ref: %Z.assoc_type.553 = name_ref X, %.loc22_11.3 [concrete = constants.%assoc0.1e0]
// CHECK:STDOUT: %impl.elem0.loc22_11.1: type = impl_witness_access constants.%Z.lookup_impl_witness.1cb, element0 [symbolic = %impl.elem0.loc22_11.2 (constants.%impl.elem0.a5e)]
// CHECK:STDOUT: %.loc22_18.2: type = converted %T.ref.loc22, %T.as_type.loc22 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
// CHECK:STDOUT: %.loc22_18.3: %Z.assoc_type.553 = specific_constant @X.%assoc0, @Z(constants.%C, constants.%T.fe5) [concrete = constants.%assoc0.1e0]
// CHECK:STDOUT: %X.ref: %Z.assoc_type.553 = name_ref X, %.loc22_18.3 [concrete = constants.%assoc0.1e0]
// CHECK:STDOUT: %impl.elem0.loc22_18.1: type = impl_witness_access constants.%Z.lookup_impl_witness.1cb, element0 [symbolic = %impl.elem0.loc22_18.2 (constants.%impl.elem0.a5e)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %ImplicitAs.type.loc22_16.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%impl.elem0.a5e)> [symbolic = %ImplicitAs.type.loc22_16.2 (constants.%ImplicitAs.type.7e4)]
// CHECK:STDOUT: %.loc22_16.1: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = specific_constant imports.%Core.import_ref.178, @ImplicitAs(constants.%impl.elem0.a5e, constants.%Self.738) [symbolic = %assoc0 (constants.%assoc0.ae8)]
// CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = name_ref Convert, %.loc22_16.1 [symbolic = %assoc0 (constants.%assoc0.ae8)]
// CHECK:STDOUT: %.loc22_16.2: @F.%impl.elem0.loc22_11.2 (%impl.elem0.a5e) = converted %t.ref, <error> [concrete = <error>]
// CHECK:STDOUT: %a: @F.%impl.elem0.loc22_11.2 (%impl.elem0.a5e) = value_binding a, <error> [concrete = <error>]
// CHECK:STDOUT: %ImplicitAs.type.loc22_23.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%impl.elem0.a5e)> [symbolic = %ImplicitAs.type.loc22_23.2 (constants.%ImplicitAs.type.7e4)]
// CHECK:STDOUT: %.loc22_23.1: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = specific_constant imports.%Core.import_ref.178, @ImplicitAs(constants.%impl.elem0.a5e, constants.%Self.738) [symbolic = %assoc0 (constants.%assoc0.ae8)]
// CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ac6) = name_ref Convert, %.loc22_23.1 [symbolic = %assoc0 (constants.%assoc0.ae8)]
// CHECK:STDOUT: %.loc22_23.2: @F.%impl.elem0.loc22_18.2 (%impl.elem0.a5e) = converted %t.ref, <error> [concrete = <error>]
// CHECK:STDOUT: %a: @F.%impl.elem0.loc22_18.2 (%impl.elem0.a5e) = value_binding a, <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: }
+4 -4
View File
@@ -28,7 +28,7 @@ import library "types";
class InInterfaceArgs {}
impl X as I(InInterfaceArgs) { fn F[self: Self]() {} }
impl X as I(InInterfaceArgs) { fn F[unused self: Self]() {} }
// --- use_impl_in_interface_args.carbon
@@ -45,7 +45,7 @@ import library "types";
class InClassArgs {}
impl C(InClassArgs) as I(X) { fn F[self: Self]() {} }
impl C(InClassArgs) as I(X) { fn F[unused self: Self]() {} }
// --- use_impl_in_class_args.carbon
@@ -423,7 +423,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %Main.import_ref.d1b: <witness> = import_ref Main//impl_in_interface_args, loc7_30, loaded [concrete = constants.%I.impl_witness]
// CHECK:STDOUT: %Main.import_ref.044: type = import_ref Main//impl_in_interface_args, loc7_6, loaded [concrete = constants.%X]
// CHECK:STDOUT: %Main.import_ref.acb: type = import_ref Main//impl_in_interface_args, loc7_28, loaded [concrete = constants.%I.type.39c]
// CHECK:STDOUT: %Main.import_ref.95d: %X.as.I.impl.F.type = import_ref Main//impl_in_interface_args, loc7_51, loaded [concrete = constants.%X.as.I.impl.F]
// CHECK:STDOUT: %Main.import_ref.95d: %X.as.I.impl.F.type = import_ref Main//impl_in_interface_args, loc7_58, loaded [concrete = constants.%X.as.I.impl.F]
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.95d), @X.as.I.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -825,7 +825,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %Main.import_ref.5ca: <witness> = import_ref Main//impl_in_class_args, loc7_29, loaded [concrete = constants.%I.impl_witness]
// CHECK:STDOUT: %Main.import_ref.7f4: type = import_ref Main//impl_in_class_args, loc7_19, loaded [concrete = constants.%C.83f]
// CHECK:STDOUT: %Main.import_ref.15e: type = import_ref Main//impl_in_class_args, loc7_27, loaded [concrete = constants.%I.type.03e]
// CHECK:STDOUT: %Main.import_ref.e57: %C.as.I.impl.F.type = import_ref Main//impl_in_class_args, loc7_50, loaded [concrete = constants.%C.as.I.impl.F]
// CHECK:STDOUT: %Main.import_ref.e57: %C.as.I.impl.F.type = import_ref Main//impl_in_class_args, loc7_57, loaded [concrete = constants.%C.as.I.impl.F]
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.e57), @C.as.I.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+3 -3
View File
@@ -42,7 +42,7 @@ fn F(T:! Z) -> T.X {
fn G() {
// Check which impl is selected for struct literals with different field
// names.
let c1: C = F({.a: (), .b: ()});
let d1: D = F({.aa: (), .bb: ()});
let d2: D = F({.b: (), .a: ()});
let unused c1: C = F({.a: (), .b: ()});
let unused d1: D = F({.aa: (), .bb: ()});
let unused d2: D = F({.b: (), .a: ()});
}
@@ -50,7 +50,7 @@ class C(T:! X) {}
// with a `FacetAccessType` when evaluating the instruction.
class D(T:! Y) { adapt C(T); }
fn Test(T:! Y & Z, d: D(T)) {}
fn Test(T:! Y & Z, unused d: D(T)) {}
// --- final_symbolic_rewrite.carbon
library "[[@TEST_NAME]]";
@@ -67,5 +67,5 @@ class C {}
fn F(T:! Z(C), t: T) {
// This should typecheck, the `final impl` should give the same `T`.
let a: T.X = t;
let unused a: T.X = t;
}
+2 -2
View File
@@ -25,7 +25,7 @@ library "[[@TEST_NAME]]";
import library "i";
class C {}
impl C as I { fn F[self: Self]() {} }
impl C as I { fn F[unused self: Self]() {} }
// --- get.carbon
@@ -339,7 +339,7 @@ fn Call() {
// CHECK:STDOUT: %Main.import_ref.31c: <witness> = import_ref Main//c, loc7_13, loaded [concrete = constants.%I.impl_witness]
// CHECK:STDOUT: %Main.import_ref.61c: type = import_ref Main//c, loc7_6, loaded [concrete = constants.%C]
// CHECK:STDOUT: %Main.import_ref.91f: type = import_ref Main//c, loc7_11, loaded [concrete = constants.%I.type]
// CHECK:STDOUT: %Main.import_ref.706: %C.as.I.impl.F.type = import_ref Main//c, loc7_34, loaded [concrete = constants.%C.as.I.impl.F]
// CHECK:STDOUT: %Main.import_ref.706: %C.as.I.impl.F.type = import_ref Main//c, loc7_41, loaded [concrete = constants.%C.as.I.impl.F]
// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.706), @C.as.I.impl [concrete]
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
// CHECK:STDOUT: }
@@ -35,7 +35,7 @@ fn F() {
// second is more specific. But since it has an unused generic parameter, it
// will never match. If the second was matched, this line would not type
// check.
let x: C.(I.T) = ();
let unused x: C.(I.T) = ();
}
// --- fail_one_binding_unused.carbon
@@ -63,7 +63,7 @@ fn F() {
// This shows that the first impl declaration was matched even though the
// second is more specific. If the second was matched, it would not type
// check.
let x: C.(I.T) = ();
let unused x: C.(I.T) = ();
}
// --- fail_inherited_binding_unused.carbon
@@ -89,7 +89,7 @@ class C(U:! type) {
}
fn F() {
let x: C(()).(I.T) = ();
let unused x: C(()).(I.T) = ();
}
// --- fail_inherited_binding_in_forall_unused.carbon
@@ -115,7 +115,7 @@ class C(U:! type) {
}
fn F() {
let x: C(()).(I.T) = ();
let unused x: C(()).(I.T) = ();
}
// --- inherited_binding_used.carbon
@@ -134,7 +134,7 @@ class C(U:! type) {
fn F() {
// The `impl` inside C is matched here.
let x: C(()).(I.T) = ();
let unused x: C(()).(I.T) = ();
}
// --- inherited_binding_in_forall_used.carbon
@@ -153,5 +153,5 @@ class C(U:! type) {
fn F() {
// The `impl` inside C is matched here.
let x: C(()).(I({}).T) = ();
let unused x: C(()).(I({}).T) = ();
}
+18 -18
View File
@@ -21,11 +21,11 @@ class C {}
class D {}
impl C as UseSelf {
fn F[self: C](x: C) -> C { return {}; }
fn F[unused self: C](unused x: C) -> C { return {}; }
}
impl D as UseSelf {
fn F[self: Self](x: Self) -> Self { return {}; }
fn F[unused self: Self](unused x: Self) -> Self { return {}; }
}
interface SelfNested {
@@ -232,13 +232,13 @@ impl D as SelfNested {
// CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %C.ref.loc24_26: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %.loc24_26: Core.Form = init_form %C.ref.loc24_26, call_param2 [concrete = constants.%.92f]
// CHECK:STDOUT: %C.ref.loc24_40: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %.loc24_40: Core.Form = init_form %C.ref.loc24_40, call_param2 [concrete = constants.%.92f]
// CHECK:STDOUT: %self.param: %C = value_param call_param0
// CHECK:STDOUT: %C.ref.loc24_14: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %C.ref.loc24_21: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %self: %C = value_binding self, %self.param
// CHECK:STDOUT: %x.param: %C = value_param call_param1
// CHECK:STDOUT: %C.ref.loc24_20: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %C.ref.loc24_34: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %x: %C = value_binding x, %x.param
// CHECK:STDOUT: %return.param: ref %C = out_param call_param2
// CHECK:STDOUT: %return: ref %C = return_slot %return.param
@@ -261,13 +261,13 @@ impl D as SelfNested {
// CHECK:STDOUT: %return.patt: %pattern_type.9c8 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.9c8 = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Self.ref.loc28_32: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D]
// CHECK:STDOUT: %.loc28_32: Core.Form = init_form %Self.ref.loc28_32, call_param2 [concrete = constants.%.513]
// CHECK:STDOUT: %Self.ref.loc28_46: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D]
// CHECK:STDOUT: %.loc28_46: Core.Form = init_form %Self.ref.loc28_46, call_param2 [concrete = constants.%.513]
// CHECK:STDOUT: %self.param: %D = value_param call_param0
// CHECK:STDOUT: %Self.ref.loc28_14: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D]
// CHECK:STDOUT: %Self.ref.loc28_21: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D]
// CHECK:STDOUT: %self: %D = value_binding self, %self.param
// CHECK:STDOUT: %x.param: %D = value_param call_param1
// CHECK:STDOUT: %Self.ref.loc28_23: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D]
// CHECK:STDOUT: %Self.ref.loc28_37: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D]
// CHECK:STDOUT: %x: %D = value_binding x, %x.param
// CHECK:STDOUT: %return.param: ref %D = out_param call_param2
// CHECK:STDOUT: %return: ref %D = return_slot %return.param
@@ -360,18 +360,18 @@ impl D as SelfNested {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C.as.UseSelf.impl.F(%self.param: %C, %x.param: %C) -> out %return.param: %C {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc24_38.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc24_38.2: init %C to %return.param = class_init () [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc24_39: init %C = converted %.loc24_38.1, %.loc24_38.2 [concrete = constants.%C.val]
// CHECK:STDOUT: return %.loc24_39 to %return.param
// CHECK:STDOUT: %.loc24_52.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc24_52.2: init %C to %return.param = class_init () [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc24_53: init %C = converted %.loc24_52.1, %.loc24_52.2 [concrete = constants.%C.val]
// CHECK:STDOUT: return %.loc24_53 to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @D.as.UseSelf.impl.F(%self.param: %D, %x.param: %D) -> out %return.param: %D {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc28_47.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc28_47.2: init %D to %return.param = class_init () [concrete = constants.%D.val]
// CHECK:STDOUT: %.loc28_48: init %D = converted %.loc28_47.1, %.loc28_47.2 [concrete = constants.%D.val]
// CHECK:STDOUT: return %.loc28_48 to %return.param
// CHECK:STDOUT: %.loc28_61.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc28_61.2: init %D to %return.param = class_init () [concrete = constants.%D.val]
// CHECK:STDOUT: %.loc28_62: init %D = converted %.loc28_61.1, %.loc28_61.2 [concrete = constants.%D.val]
// CHECK:STDOUT: return %.loc28_62 to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @SelfNested.WithSelf.F(@SelfNested.%Self.loc31: %SelfNested.type) {
+192 -192
View File
@@ -21,7 +21,7 @@ interface J {
}
impl () as J where .U = i32 {
fn F[self: Self](u: i32) -> i32 { return -u; }
fn F[unused self: Self](u: i32) -> i32 { return -u; }
}
fn CallMethod(x: ()) -> i32 {
@@ -34,7 +34,7 @@ class C {
}
impl C as J where .U = C {
fn F[self: Self](u: C) -> C { return self; }
fn F[self: Self](unused u: C) -> C { return self; }
}
// --- associated_type_in_function_signature.carbon
@@ -69,18 +69,18 @@ class E {
fn F(u: i32) -> i32 {
return -u;
}
fn G[self: Self](v: i32) -> i32 {
fn G[unused self: Self](v: i32) -> i32 {
return -v;
}
}
}
fn CallBoth(e: E) {
let e1: i32 = e.F(2);
let e2: i32 = e.G(3);
let e3: i32 = E.F(4);
let e4: i32 = e.(E.G)(5);
let e5: i32 = e.(J.G)(6);
let unused e1: i32 = e.F(2);
let unused e2: i32 = e.G(3);
let unused e3: i32 = E.F(4);
let unused e4: i32 = e.(E.G)(5);
let unused e5: i32 = e.(J.G)(6);
}
fn GenericCallF[T:! J](t: T, u: T.U) -> T.U {
@@ -187,12 +187,12 @@ class E {
library "[[@TEST_NAME]]";
interface J {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
class E {
extend impl as J {
fn F[self: Self]() {}
fn F[unused self: Self]() {}
}
fn G[self: Self]() { self.F(); }
@@ -242,7 +242,7 @@ interface J2 {
}
impl () as J2 where .U2 = {} {
fn F[self: Self](z: {}) -> {} { return z; }
fn F[unused self: Self](z: {}) -> {} { return z; }
}
class C2 {
@@ -251,7 +251,7 @@ class C2 {
}
impl C2 as J2 where .U2 = C2 {
fn F[self: Self](z: C2) -> C2 { return self; }
fn F[self: Self](unused z: C2) -> C2 { return self; }
}
// --- fail_associated_type_in_signature_mismatch.carbon
@@ -266,21 +266,21 @@ interface K {
}
impl () as K where .V = {.a: ()} {
// CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+14]]:20: note: initializing function parameter [InCallToFunctionParam]
// CHECK:STDERR: fn F[self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+14]]:27: note: initializing function parameter [InCallToFunctionParam]
// CHECK:STDERR: fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-7]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
// CHECK:STDERR: fn F[self: Self](v: V) -> V;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+7]]:3: error: cannot convert from struct type `{.x: ()}` to `{.a: ()}`: missing field `a` in source type [StructInitMissingFieldInConversion]
// CHECK:STDERR: fn F[self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE-14]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
// CHECK:STDERR: fn F[self: Self](v: V) -> V;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
fn F[self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; }
}
// --- use_non-type_in_function.carbon
@@ -328,7 +328,7 @@ interface I {
}
impl () as I where .N = 2 {
fn F[self: Self]() -> array(bool, 2) { return (true, false); }
fn F[unused self: Self]() -> array(bool, 2) { return (true, false); }
}
// --- symbolic_associated_type_in_concrete_context.carbon
@@ -343,7 +343,7 @@ class D {}
impl forall [T:! type] T as Z where .X = C(T) {}
fn F() {
let a: D.(Z.X) = {} as C(D);
let unused a: D.(Z.X) = {} as C(D);
}
// CHECK:STDOUT: --- associated_type_in_method_signature.carbon
@@ -567,16 +567,16 @@ fn F() {
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc9_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc9_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc9_31: Core.Form = init_form %i32.loc9_31, call_param2 [concrete = constants.%.8ef]
// CHECK:STDOUT: %int_32.loc9_38: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc9_38: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc9_38: Core.Form = init_form %i32.loc9_38, call_param2 [concrete = constants.%.8ef]
// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.J.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
// CHECK:STDOUT: %u.param: %i32 = value_param call_param1
// CHECK:STDOUT: %.loc9_23: type = splice_block %i32.loc9_23 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc9_23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc9_23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc9_30: type = splice_block %i32.loc9_30 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc9_30: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc9_30: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %u: %i32 = value_binding u, %u.param
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
@@ -600,13 +600,13 @@ fn F() {
// CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %C.ref.loc22_29: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %.loc22_29: Core.Form = init_form %C.ref.loc22_29, call_param2 [concrete = constants.%.92f]
// CHECK:STDOUT: %C.ref.loc22_36: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %.loc22_36: Core.Form = init_form %C.ref.loc22_36, call_param2 [concrete = constants.%.92f]
// CHECK:STDOUT: %self.param: %C = value_param call_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.J.impl.%C.ref.loc21_6 [concrete = constants.%C]
// CHECK:STDOUT: %self: %C = value_binding self, %self.param
// CHECK:STDOUT: %u.param: %C = value_param call_param1
// CHECK:STDOUT: %C.ref.loc22_23: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %C.ref.loc22_30: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %u: %C = value_binding u, %u.param
// CHECK:STDOUT: %return.param: ref %C = out_param call_param2
// CHECK:STDOUT: %return: ref %C = return_slot %return.param
@@ -648,10 +648,10 @@ fn F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u
// CHECK:STDOUT: %impl.elem1: %.5dd = impl_witness_access constants.%Negate.impl_witness.11c, element1 [concrete = constants.%Int.as.Negate.impl.Op.e7f]
// CHECK:STDOUT: %bound_method.loc9_44.1: <bound method> = bound_method %u.ref, %impl.elem1
// CHECK:STDOUT: %bound_method.loc9_51.1: <bound method> = bound_method %u.ref, %impl.elem1
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem1, @Int.as.Negate.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Negate.impl.Op.specific_fn]
// CHECK:STDOUT: %bound_method.loc9_44.2: <bound method> = bound_method %u.ref, %specific_fn
// CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc9_44.2(%u.ref)
// CHECK:STDOUT: %bound_method.loc9_51.2: <bound method> = bound_method %u.ref, %specific_fn
// CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc9_51.2(%u.ref)
// CHECK:STDOUT: return %Int.as.Negate.impl.Op.call
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -677,11 +677,11 @@ fn F() {
// CHECK:STDOUT: fn @C.as.J.impl.F(%self.param: %C, %u.param: %C) -> out %return.param: %C {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %self.ref: %C = name_ref self, %self
// CHECK:STDOUT: %.loc22_44.1: %empty_struct_type = as_compatible %self.ref
// CHECK:STDOUT: %.loc22_44.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc22_44.3: init %C = as_compatible %.loc22_44.2 [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc22_44.4: init %C = converted %self.ref, %.loc22_44.3 [concrete = constants.%C.val]
// CHECK:STDOUT: return %.loc22_44.4
// CHECK:STDOUT: %.loc22_51.1: %empty_struct_type = as_compatible %self.ref
// CHECK:STDOUT: %.loc22_51.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc22_51.3: init %C = as_compatible %.loc22_51.2 [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc22_51.4: init %C = converted %self.ref, %.loc22_51.3 [concrete = constants.%C.val]
// CHECK:STDOUT: return %.loc22_51.4
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @J(constants.%Self.8a1) {
@@ -1338,16 +1338,16 @@ fn F() {
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc14_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc14_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc14_33: Core.Form = init_form %i32.loc14_33, call_param2 [concrete = constants.%.8ef]
// CHECK:STDOUT: %int_32.loc14_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc14_40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc14_40: Core.Form = init_form %i32.loc14_40, call_param2 [concrete = constants.%.8ef]
// CHECK:STDOUT: %self.param: %E = value_param call_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [concrete = constants.%E]
// CHECK:STDOUT: %self: %E = value_binding self, %self.param
// CHECK:STDOUT: %v.param: %i32 = value_param call_param1
// CHECK:STDOUT: %.loc14_25: type = splice_block %i32.loc14_25 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc14_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc14_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc14_32: type = splice_block %i32.loc14_32 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc14_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc14_32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %v: %i32 = value_binding v, %v.param
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
@@ -1445,43 +1445,43 @@ fn F() {
// CHECK:STDOUT: %impl.elem1.loc21: %.ff2 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%E.as.J.impl.F]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
// CHECK:STDOUT: %impl.elem0.loc21: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
// CHECK:STDOUT: %bound_method.loc21_21.1: <bound method> = bound_method %int_2, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
// CHECK:STDOUT: %bound_method.loc21_28.1: <bound method> = bound_method %int_2, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
// CHECK:STDOUT: %specific_fn.loc21: <specific function> = specific_function %impl.elem0.loc21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc21_21.2: <bound method> = bound_method %int_2, %specific_fn.loc21 [concrete = constants.%bound_method.646]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_21.2(%int_2) [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc21_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc21_21.2: %i32 = converted %int_2, %.loc21_21.1 [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %E.as.J.impl.F.call.loc21: init %i32 = call %impl.elem1.loc21(%.loc21_21.2)
// CHECK:STDOUT: %.loc21_11: type = splice_block %i32.loc21 [concrete = constants.%i32] {
// CHECK:STDOUT: %bound_method.loc21_28.2: <bound method> = bound_method %int_2, %specific_fn.loc21 [concrete = constants.%bound_method.646]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_28.2(%int_2) [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc21_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc21_28.2: %i32 = converted %int_2, %.loc21_28.1 [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %E.as.J.impl.F.call.loc21: init %i32 = call %impl.elem1.loc21(%.loc21_28.2)
// CHECK:STDOUT: %.loc21_18: type = splice_block %i32.loc21 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc21_22.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc21
// CHECK:STDOUT: %.loc21_22.2: %i32 = converted %E.as.J.impl.F.call.loc21, %.loc21_22.1
// CHECK:STDOUT: %e1: %i32 = value_binding e1, %.loc21_22.2
// CHECK:STDOUT: %.loc21_29.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc21
// CHECK:STDOUT: %.loc21_29.2: %i32 = converted %E.as.J.impl.F.call.loc21, %.loc21_29.1
// CHECK:STDOUT: %e1: %i32 = value_binding e1, %.loc21_29.2
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %e2.patt: %pattern_type.7ce = value_binding_pattern e2 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %e.ref.loc22: %E = name_ref e, %e
// CHECK:STDOUT: %G.ref.loc22: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2]
// CHECK:STDOUT: %impl.elem2.loc22: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
// CHECK:STDOUT: %bound_method.loc22_18: <bound method> = bound_method %e.ref.loc22, %impl.elem2.loc22
// CHECK:STDOUT: %bound_method.loc22_25: <bound method> = bound_method %e.ref.loc22, %impl.elem2.loc22
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
// CHECK:STDOUT: %impl.elem0.loc22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
// CHECK:STDOUT: %bound_method.loc22_21.1: <bound method> = bound_method %int_3, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
// CHECK:STDOUT: %bound_method.loc22_28.1: <bound method> = bound_method %int_3, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
// CHECK:STDOUT: %specific_fn.loc22: <specific function> = specific_function %impl.elem0.loc22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc22_21.2: <bound method> = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.fa7]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_21.2(%int_3) [concrete = constants.%int_3.822]
// CHECK:STDOUT: %.loc22_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822]
// CHECK:STDOUT: %.loc22_21.2: %i32 = converted %int_3, %.loc22_21.1 [concrete = constants.%int_3.822]
// CHECK:STDOUT: %E.as.J.impl.G.call.loc22: init %i32 = call %bound_method.loc22_18(%e.ref.loc22, %.loc22_21.2)
// CHECK:STDOUT: %.loc22_11: type = splice_block %i32.loc22 [concrete = constants.%i32] {
// CHECK:STDOUT: %bound_method.loc22_28.2: <bound method> = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.fa7]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_28.2(%int_3) [concrete = constants.%int_3.822]
// CHECK:STDOUT: %.loc22_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822]
// CHECK:STDOUT: %.loc22_28.2: %i32 = converted %int_3, %.loc22_28.1 [concrete = constants.%int_3.822]
// CHECK:STDOUT: %E.as.J.impl.G.call.loc22: init %i32 = call %bound_method.loc22_25(%e.ref.loc22, %.loc22_28.2)
// CHECK:STDOUT: %.loc22_18: type = splice_block %i32.loc22 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc22_22.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc22
// CHECK:STDOUT: %.loc22_22.2: %i32 = converted %E.as.J.impl.G.call.loc22, %.loc22_22.1
// CHECK:STDOUT: %e2: %i32 = value_binding e2, %.loc22_22.2
// CHECK:STDOUT: %.loc22_29.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc22
// CHECK:STDOUT: %.loc22_29.2: %i32 = converted %E.as.J.impl.G.call.loc22, %.loc22_29.1
// CHECK:STDOUT: %e2: %i32 = value_binding e2, %.loc22_29.2
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %e3.patt: %pattern_type.7ce = value_binding_pattern e3 [concrete]
// CHECK:STDOUT: }
@@ -1490,20 +1490,20 @@ fn F() {
// CHECK:STDOUT: %impl.elem1.loc23: %.ff2 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%E.as.J.impl.F]
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
// CHECK:STDOUT: %impl.elem0.loc23: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
// CHECK:STDOUT: %bound_method.loc23_21.1: <bound method> = bound_method %int_4, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c]
// CHECK:STDOUT: %bound_method.loc23_28.1: <bound method> = bound_method %int_4, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c]
// CHECK:STDOUT: %specific_fn.loc23: <specific function> = specific_function %impl.elem0.loc23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc23_21.2: <bound method> = bound_method %int_4, %specific_fn.loc23 [concrete = constants.%bound_method.6d7]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_21.2(%int_4) [concrete = constants.%int_4.940]
// CHECK:STDOUT: %.loc23_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_4.940]
// CHECK:STDOUT: %.loc23_21.2: %i32 = converted %int_4, %.loc23_21.1 [concrete = constants.%int_4.940]
// CHECK:STDOUT: %E.as.J.impl.F.call.loc23: init %i32 = call %impl.elem1.loc23(%.loc23_21.2)
// CHECK:STDOUT: %.loc23_11: type = splice_block %i32.loc23 [concrete = constants.%i32] {
// CHECK:STDOUT: %bound_method.loc23_28.2: <bound method> = bound_method %int_4, %specific_fn.loc23 [concrete = constants.%bound_method.6d7]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_28.2(%int_4) [concrete = constants.%int_4.940]
// CHECK:STDOUT: %.loc23_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_4.940]
// CHECK:STDOUT: %.loc23_28.2: %i32 = converted %int_4, %.loc23_28.1 [concrete = constants.%int_4.940]
// CHECK:STDOUT: %E.as.J.impl.F.call.loc23: init %i32 = call %impl.elem1.loc23(%.loc23_28.2)
// CHECK:STDOUT: %.loc23_18: type = splice_block %i32.loc23 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc23_22.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc23
// CHECK:STDOUT: %.loc23_22.2: %i32 = converted %E.as.J.impl.F.call.loc23, %.loc23_22.1
// CHECK:STDOUT: %e3: %i32 = value_binding e3, %.loc23_22.2
// CHECK:STDOUT: %.loc23_29.1: %i32 = value_of_initializer %E.as.J.impl.F.call.loc23
// CHECK:STDOUT: %.loc23_29.2: %i32 = converted %E.as.J.impl.F.call.loc23, %.loc23_29.1
// CHECK:STDOUT: %e3: %i32 = value_binding e3, %.loc23_29.2
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %e4.patt: %pattern_type.7ce = value_binding_pattern e4 [concrete]
// CHECK:STDOUT: }
@@ -1511,23 +1511,23 @@ fn F() {
// CHECK:STDOUT: %E.ref.loc24: type = name_ref E, file.%E.decl [concrete = constants.%E]
// CHECK:STDOUT: %G.ref.loc24: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2]
// CHECK:STDOUT: %impl.elem2.loc24: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
// CHECK:STDOUT: %bound_method.loc24_18: <bound method> = bound_method %e.ref.loc24, %impl.elem2.loc24
// CHECK:STDOUT: %bound_method.loc24_25: <bound method> = bound_method %e.ref.loc24, %impl.elem2.loc24
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
// CHECK:STDOUT: %impl.elem0.loc24: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
// CHECK:STDOUT: %bound_method.loc24_25.1: <bound method> = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005]
// CHECK:STDOUT: %bound_method.loc24_32.1: <bound method> = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005]
// CHECK:STDOUT: %specific_fn.loc24: <specific function> = specific_function %impl.elem0.loc24, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc24_25.2: <bound method> = bound_method %int_5, %specific_fn.loc24 [concrete = constants.%bound_method.e9d]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24: init %i32 = call %bound_method.loc24_25.2(%int_5) [concrete = constants.%int_5.0f6]
// CHECK:STDOUT: %.loc24_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_5.0f6]
// CHECK:STDOUT: %.loc24_25.2: %i32 = converted %int_5, %.loc24_25.1 [concrete = constants.%int_5.0f6]
// CHECK:STDOUT: %E.as.J.impl.G.call.loc24: init %i32 = call %bound_method.loc24_18(%e.ref.loc24, %.loc24_25.2)
// CHECK:STDOUT: %.loc24_11: type = splice_block %i32.loc24 [concrete = constants.%i32] {
// CHECK:STDOUT: %bound_method.loc24_32.2: <bound method> = bound_method %int_5, %specific_fn.loc24 [concrete = constants.%bound_method.e9d]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24: init %i32 = call %bound_method.loc24_32.2(%int_5) [concrete = constants.%int_5.0f6]
// CHECK:STDOUT: %.loc24_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc24 [concrete = constants.%int_5.0f6]
// CHECK:STDOUT: %.loc24_32.2: %i32 = converted %int_5, %.loc24_32.1 [concrete = constants.%int_5.0f6]
// CHECK:STDOUT: %E.as.J.impl.G.call.loc24: init %i32 = call %bound_method.loc24_25(%e.ref.loc24, %.loc24_32.2)
// CHECK:STDOUT: %.loc24_18: type = splice_block %i32.loc24 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc24_26.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc24
// CHECK:STDOUT: %.loc24_26.2: %i32 = converted %E.as.J.impl.G.call.loc24, %.loc24_26.1
// CHECK:STDOUT: %e4: %i32 = value_binding e4, %.loc24_26.2
// CHECK:STDOUT: %.loc24_33.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc24
// CHECK:STDOUT: %.loc24_33.2: %i32 = converted %E.as.J.impl.G.call.loc24, %.loc24_33.1
// CHECK:STDOUT: %e4: %i32 = value_binding e4, %.loc24_33.2
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %e5.patt: %pattern_type.7ce = value_binding_pattern e5 [concrete]
// CHECK:STDOUT: }
@@ -1535,23 +1535,23 @@ fn F() {
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
// CHECK:STDOUT: %G.ref.loc25: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2]
// CHECK:STDOUT: %impl.elem2.loc25: %.825 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%E.as.J.impl.G]
// CHECK:STDOUT: %bound_method.loc25_18: <bound method> = bound_method %e.ref.loc25, %impl.elem2.loc25
// CHECK:STDOUT: %bound_method.loc25_25: <bound method> = bound_method %e.ref.loc25, %impl.elem2.loc25
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
// CHECK:STDOUT: %impl.elem0.loc25: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
// CHECK:STDOUT: %bound_method.loc25_25.1: <bound method> = bound_method %int_6, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.502]
// CHECK:STDOUT: %bound_method.loc25_32.1: <bound method> = bound_method %int_6, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.502]
// CHECK:STDOUT: %specific_fn.loc25: <specific function> = specific_function %impl.elem0.loc25, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc25_25.2: <bound method> = bound_method %int_6, %specific_fn.loc25 [concrete = constants.%bound_method.bc2]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i32 = call %bound_method.loc25_25.2(%int_6) [concrete = constants.%int_6.e56]
// CHECK:STDOUT: %.loc25_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_6.e56]
// CHECK:STDOUT: %.loc25_25.2: %i32 = converted %int_6, %.loc25_25.1 [concrete = constants.%int_6.e56]
// CHECK:STDOUT: %E.as.J.impl.G.call.loc25: init %i32 = call %bound_method.loc25_18(%e.ref.loc25, %.loc25_25.2)
// CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] {
// CHECK:STDOUT: %bound_method.loc25_32.2: <bound method> = bound_method %int_6, %specific_fn.loc25 [concrete = constants.%bound_method.bc2]
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25: init %i32 = call %bound_method.loc25_32.2(%int_6) [concrete = constants.%int_6.e56]
// CHECK:STDOUT: %.loc25_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25 [concrete = constants.%int_6.e56]
// CHECK:STDOUT: %.loc25_32.2: %i32 = converted %int_6, %.loc25_32.1 [concrete = constants.%int_6.e56]
// CHECK:STDOUT: %E.as.J.impl.G.call.loc25: init %i32 = call %bound_method.loc25_25(%e.ref.loc25, %.loc25_32.2)
// CHECK:STDOUT: %.loc25_18: type = splice_block %i32.loc25 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc25_26.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc25
// CHECK:STDOUT: %.loc25_26.2: %i32 = converted %E.as.J.impl.G.call.loc25, %.loc25_26.1
// CHECK:STDOUT: %e5: %i32 = value_binding e5, %.loc25_26.2
// CHECK:STDOUT: %.loc25_33.1: %i32 = value_of_initializer %E.as.J.impl.G.call.loc25
// CHECK:STDOUT: %.loc25_33.2: %i32 = converted %E.as.J.impl.G.call.loc25, %.loc25_33.1
// CHECK:STDOUT: %e5: %i32 = value_binding e5, %.loc25_33.2
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -3004,10 +3004,10 @@ fn F() {
// CHECK:STDOUT: %self.param_patt: @J.WithSelf.F.%pattern_type (%pattern_type.832) = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: @J.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
// CHECK:STDOUT: %.loc4_14.1: type = splice_block %.loc4_14.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
// CHECK:STDOUT: %.loc4_21.1: type = splice_block %.loc4_21.2 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
// CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self.loc3 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
// CHECK:STDOUT: %.loc4_14.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
// CHECK:STDOUT: %.loc4_21.2: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %self: @J.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type) = value_binding self, %self.param
// CHECK:STDOUT: }
@@ -3272,12 +3272,12 @@ fn F() {
// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
// CHECK:STDOUT: %.0df: Core.Form = init_form %empty_struct_type, call_param2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_33.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_40.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.7b8679.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = struct_value () [concrete]
// CHECK:STDOUT: %J2.facet.6c9: %J2.type = facet_value %empty_tuple.type, (%J2.impl_witness.941) [concrete]
// CHECK:STDOUT: %J2.WithSelf.F.type.43a: type = fn_type @J2.WithSelf.F, @J2(%J2.facet.6c9) [concrete]
// CHECK:STDOUT: %J2.WithSelf.F.2bb: %J2.WithSelf.F.type.43a = struct_value () [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_33.2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2: type = fn_type @empty_tuple.type.as.J2.impl.F.loc23_40.2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.7b8679.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = struct_value () [concrete]
// CHECK:STDOUT: %C2: type = class_type @C2 [concrete]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
@@ -3285,12 +3285,12 @@ fn F() {
// CHECK:STDOUT: %J2.impl_witness.30f: <witness> = impl_witness @C2.as.J2.impl.%J2.impl_witness_table [concrete]
// CHECK:STDOUT: %pattern_type.8df: type = pattern_type %C2 [concrete]
// CHECK:STDOUT: %.704: Core.Form = init_form %C2, call_param2 [concrete]
// CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.1: type = fn_type @C2.as.J2.impl.F.loc32_33.1 [concrete]
// CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.1: type = fn_type @C2.as.J2.impl.F.loc32_40.1 [concrete]
// CHECK:STDOUT: %C2.as.J2.impl.F.720bb2.1: %C2.as.J2.impl.F.type.d2a210.1 = struct_value () [concrete]
// CHECK:STDOUT: %J2.facet.f19: %J2.type = facet_value %C2, (%J2.impl_witness.30f) [concrete]
// CHECK:STDOUT: %J2.WithSelf.F.type.3cd: type = fn_type @J2.WithSelf.F, @J2(%J2.facet.f19) [concrete]
// CHECK:STDOUT: %J2.WithSelf.F.06e: %J2.WithSelf.F.type.3cd = struct_value () [concrete]
// CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.2: type = fn_type @C2.as.J2.impl.F.loc32_33.2 [concrete]
// CHECK:STDOUT: %C2.as.J2.impl.F.type.d2a210.2: type = fn_type @C2.as.J2.impl.F.loc32_40.2 [concrete]
// CHECK:STDOUT: %C2.as.J2.impl.F.720bb2.2: %C2.as.J2.impl.F.type.d2a210.2 = struct_value () [concrete]
// CHECK:STDOUT: %C2.val: %C2 = struct_value () [concrete]
// CHECK:STDOUT: }
@@ -3391,7 +3391,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @empty_tuple.type.as.J2.impl: %.loc22_7.2 as %.loc22_15 {
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_33.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_33.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1] {
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_40.1: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_40.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1] {
// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %z.patt: %pattern_type.a96 = value_binding_pattern z [concrete]
@@ -3399,16 +3399,16 @@ fn F() {
// CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc23_31.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc23_31.2: type = converted %.loc23_31.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %.loc23_31.3: Core.Form = init_form %.loc23_31.2, call_param2 [concrete = constants.%.0df]
// CHECK:STDOUT: %.loc23_38.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc23_38.2: type = converted %.loc23_38.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %.loc23_38.3: Core.Form = init_form %.loc23_38.2, call_param2 [concrete = constants.%.0df]
// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.J2.impl.%.loc22_7.2 [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
// CHECK:STDOUT: %z.param: %empty_struct_type = value_param call_param1
// CHECK:STDOUT: %.loc23_24.1: type = splice_block %.loc23_24.3 [concrete = constants.%empty_struct_type] {
// CHECK:STDOUT: %.loc23_24.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc23_24.3: type = converted %.loc23_24.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %.loc23_31.1: type = splice_block %.loc23_31.3 [concrete = constants.%empty_struct_type] {
// CHECK:STDOUT: %.loc23_31.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc23_31.3: type = converted %.loc23_31.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %z: %empty_struct_type = value_binding z, %z.param
// CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param2
@@ -3416,7 +3416,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: type = specific_constant <error>, @J2.WithSelf.F(constants.%J2.facet.6c9) [concrete = <error>]
// CHECK:STDOUT: %.2: type = specific_constant <error>, @J2.WithSelf.F(constants.%J2.facet.6c9) [concrete = <error>]
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_33.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_33.2 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.2] {
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.decl.loc23_40.2: %empty_tuple.type.as.J2.impl.F.type.56bdaf.2 = fn_decl @empty_tuple.type.as.J2.impl.F.loc23_40.2 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.2] {
// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %.param_patt: <error> = value_param_pattern <error>, call_param1 [concrete]
@@ -3425,17 +3425,17 @@ fn F() {
// CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
// CHECK:STDOUT: %.param: <error> = value_param call_param1
// CHECK:STDOUT: }
// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J2.impl.F.decl.loc23_33.2), @empty_tuple.type.as.J2.impl [concrete]
// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.J2.impl.F.decl.loc23_40.2), @empty_tuple.type.as.J2.impl [concrete]
// CHECK:STDOUT: %J2.impl_witness: <witness> = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.941]
// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = %empty_tuple.type.as.J2.impl.F.decl.loc23_33.1
// CHECK:STDOUT: .F = %empty_tuple.type.as.J2.impl.F.decl.loc23_40.1
// CHECK:STDOUT: witness = %J2.impl_witness
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @C2.as.J2.impl: %C2.ref.loc31_6 as %.loc31_15 {
// CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_33.1: %C2.as.J2.impl.F.type.d2a210.1 = fn_decl @C2.as.J2.impl.F.loc32_33.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1] {
// CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_40.1: %C2.as.J2.impl.F.type.d2a210.1 = fn_decl @C2.as.J2.impl.F.loc32_40.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1] {
// CHECK:STDOUT: %self.patt: %pattern_type.8df = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.8df = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %z.patt: %pattern_type.8df = value_binding_pattern z [concrete]
@@ -3443,20 +3443,20 @@ fn F() {
// CHECK:STDOUT: %return.patt: %pattern_type.8df = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.8df = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %C2.ref.loc32_30: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
// CHECK:STDOUT: %.loc32_30: Core.Form = init_form %C2.ref.loc32_30, call_param2 [concrete = constants.%.704]
// CHECK:STDOUT: %C2.ref.loc32_37: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
// CHECK:STDOUT: %.loc32_37: Core.Form = init_form %C2.ref.loc32_37, call_param2 [concrete = constants.%.704]
// CHECK:STDOUT: %self.param: %C2 = value_param call_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @C2.as.J2.impl.%C2.ref.loc31_6 [concrete = constants.%C2]
// CHECK:STDOUT: %self: %C2 = value_binding self, %self.param
// CHECK:STDOUT: %z.param: %C2 = value_param call_param1
// CHECK:STDOUT: %C2.ref.loc32_23: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
// CHECK:STDOUT: %C2.ref.loc32_30: type = name_ref C2, file.%C2.decl [concrete = constants.%C2]
// CHECK:STDOUT: %z: %C2 = value_binding z, %z.param
// CHECK:STDOUT: %return.param: ref %C2 = out_param call_param2
// CHECK:STDOUT: %return: ref %C2 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: type = specific_constant <error>, @J2.WithSelf.F(constants.%J2.facet.f19) [concrete = <error>]
// CHECK:STDOUT: %.2: type = specific_constant <error>, @J2.WithSelf.F(constants.%J2.facet.f19) [concrete = <error>]
// CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_33.2: %C2.as.J2.impl.F.type.d2a210.2 = fn_decl @C2.as.J2.impl.F.loc32_33.2 [concrete = constants.%C2.as.J2.impl.F.720bb2.2] {
// CHECK:STDOUT: %C2.as.J2.impl.F.decl.loc32_40.2: %C2.as.J2.impl.F.type.d2a210.2 = fn_decl @C2.as.J2.impl.F.loc32_40.2 [concrete = constants.%C2.as.J2.impl.F.720bb2.2] {
// CHECK:STDOUT: %self.patt: %pattern_type.8df = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.8df = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %.param_patt: <error> = value_param_pattern <error>, call_param1 [concrete]
@@ -3465,13 +3465,13 @@ fn F() {
// CHECK:STDOUT: %self: %C2 = value_binding self, %self.param
// CHECK:STDOUT: %.param: <error> = value_param call_param1
// CHECK:STDOUT: }
// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C2.as.J2.impl.F.decl.loc32_33.2), @C2.as.J2.impl [concrete]
// CHECK:STDOUT: %J2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %C2.as.J2.impl.F.decl.loc32_40.2), @C2.as.J2.impl [concrete]
// CHECK:STDOUT: %J2.impl_witness: <witness> = impl_witness %J2.impl_witness_table [concrete = constants.%J2.impl_witness.30f]
// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C2 [concrete = constants.%C2]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .C2 = <poisoned>
// CHECK:STDOUT: .F = %C2.as.J2.impl.F.decl.loc32_33.1
// CHECK:STDOUT: .F = %C2.as.J2.impl.F.decl.loc32_40.1
// CHECK:STDOUT: witness = %J2.impl_witness
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -3494,17 +3494,17 @@ fn F() {
// CHECK:STDOUT: fn(%self.param: @J2.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type), %z.param: <error>) -> <error>;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_33.1(%self.param: %empty_tuple.type, %z.param: %empty_struct_type) -> out %return.param: %empty_struct_type {
// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_40.1(%self.param: %empty_tuple.type, %z.param: %empty_struct_type) -> out %return.param: %empty_struct_type {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %z.ref: %empty_struct_type = name_ref z, %z
// CHECK:STDOUT: %.loc23_42: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc23_43: init %empty_struct_type = converted %z.ref, %.loc23_42 [concrete = constants.%empty_struct]
// CHECK:STDOUT: return %.loc23_43
// CHECK:STDOUT: %.loc23_49: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc23_50: init %empty_struct_type = converted %z.ref, %.loc23_49 [concrete = constants.%empty_struct]
// CHECK:STDOUT: return %.loc23_50
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_33.2(%self.param: %empty_tuple.type, %.param: <error>) -> <error> [thunk @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_33.1] {
// CHECK:STDOUT: fn @empty_tuple.type.as.J2.impl.F.loc23_40.2(%self.param: %empty_tuple.type, %.param: <error>) -> <error> [thunk @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = name_ref F, @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_33.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1]
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.J2.impl.F.type.56bdaf.1 = name_ref F, @empty_tuple.type.as.J2.impl.%empty_tuple.type.as.J2.impl.F.decl.loc23_40.1 [concrete = constants.%empty_tuple.type.as.J2.impl.F.7b8679.1]
// CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param
// CHECK:STDOUT: %.ref: <error> = name_ref <none>, %.param
// CHECK:STDOUT: %empty_tuple.type.as.J2.impl.F.bound: <bound method> = bound_method %self.ref, %F.ref
@@ -3512,19 +3512,19 @@ fn F() {
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_33.1(%self.param: %C2, %z.param: %C2) -> out %return.param: %C2 {
// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_40.1(%self.param: %C2, %z.param: %C2) -> out %return.param: %C2 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self
// CHECK:STDOUT: %.loc32_46.1: %empty_struct_type = as_compatible %self.ref
// CHECK:STDOUT: %.loc32_46.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc32_46.3: init %C2 = as_compatible %.loc32_46.2 [concrete = constants.%C2.val]
// CHECK:STDOUT: %.loc32_46.4: init %C2 = converted %self.ref, %.loc32_46.3 [concrete = constants.%C2.val]
// CHECK:STDOUT: return %.loc32_46.4
// CHECK:STDOUT: %.loc32_53.1: %empty_struct_type = as_compatible %self.ref
// CHECK:STDOUT: %.loc32_53.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc32_53.3: init %C2 = as_compatible %.loc32_53.2 [concrete = constants.%C2.val]
// CHECK:STDOUT: %.loc32_53.4: init %C2 = converted %self.ref, %.loc32_53.3 [concrete = constants.%C2.val]
// CHECK:STDOUT: return %.loc32_53.4
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_33.2(%self.param: %C2, %.param: <error>) -> <error> [thunk @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_33.1] {
// CHECK:STDOUT: fn @C2.as.J2.impl.F.loc32_40.2(%self.param: %C2, %.param: <error>) -> <error> [thunk @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %C2.as.J2.impl.F.type.d2a210.1 = name_ref F, @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_33.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1]
// CHECK:STDOUT: %F.ref: %C2.as.J2.impl.F.type.d2a210.1 = name_ref F, @C2.as.J2.impl.%C2.as.J2.impl.F.decl.loc32_40.1 [concrete = constants.%C2.as.J2.impl.F.720bb2.1]
// CHECK:STDOUT: %self.ref: %C2 = name_ref self, %self.param
// CHECK:STDOUT: %.ref: <error> = name_ref <none>, %.param
// CHECK:STDOUT: %C2.as.J2.impl.F.bound: <bound method> = bound_method %self.ref, %F.ref
@@ -3609,14 +3609,14 @@ fn F() {
// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
// CHECK:STDOUT: %pattern_type.414: type = pattern_type %struct_type.x [concrete]
// CHECK:STDOUT: %.bdc: Core.Form = init_form %struct_type.x, call_param2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.1: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_45.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.1: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_52.1 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = struct_value () [concrete]
// CHECK:STDOUT: %K.facet: %K.type = facet_value %empty_tuple.type, (%K.impl_witness) [concrete]
// CHECK:STDOUT: %K.WithSelf.F.type.aac: type = fn_type @K.WithSelf.F, @K(%K.facet) [concrete]
// CHECK:STDOUT: %K.WithSelf.F.e22: %K.WithSelf.F.type.aac = struct_value () [concrete]
// CHECK:STDOUT: %pattern_type.e85: type = pattern_type %struct_type.a [concrete]
// CHECK:STDOUT: %.074: Core.Form = init_form %struct_type.a, call_param2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.2: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_45.2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.type.1710d5.2: type = fn_type @empty_tuple.type.as.K.impl.F.loc26_52.2 [concrete]
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.907e52.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = struct_value () [concrete]
// CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
@@ -3707,7 +3707,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @empty_tuple.type.as.K.impl: %.loc11_7.2 as %.loc11_14 {
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_45.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_45.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1] {
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_52.1: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_52.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1] {
// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %v.patt: %pattern_type.414 = value_binding_pattern v [concrete]
@@ -3715,18 +3715,18 @@ fn F() {
// CHECK:STDOUT: %return.patt: %pattern_type.414 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.414 = out_param_pattern %return.patt, call_param2 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc26_42.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_42.2: type = converted %.loc26_42.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %struct_type.x.loc26_43: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
// CHECK:STDOUT: %.loc26_43: Core.Form = init_form %struct_type.x.loc26_43, call_param2 [concrete = constants.%.bdc]
// CHECK:STDOUT: %.loc26_49.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_49.2: type = converted %.loc26_49.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %struct_type.x.loc26_50: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
// CHECK:STDOUT: %.loc26_50: Core.Form = init_form %struct_type.x.loc26_50, call_param2 [concrete = constants.%.bdc]
// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.K.impl.%.loc11_7.2 [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
// CHECK:STDOUT: %v.param: %struct_type.x = value_param call_param1
// CHECK:STDOUT: %.loc26_30: type = splice_block %struct_type.x.loc26_30 [concrete = constants.%struct_type.x] {
// CHECK:STDOUT: %.loc26_29.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_29.2: type = converted %.loc26_29.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %struct_type.x.loc26_30: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
// CHECK:STDOUT: %.loc26_37: type = splice_block %struct_type.x.loc26_37 [concrete = constants.%struct_type.x] {
// CHECK:STDOUT: %.loc26_36.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_36.2: type = converted %.loc26_36.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %struct_type.x.loc26_37: type = struct_type {.x: %empty_tuple.type} [concrete = constants.%struct_type.x]
// CHECK:STDOUT: }
// CHECK:STDOUT: %v: %struct_type.x = value_binding v, %v.param
// CHECK:STDOUT: %return.param: ref %struct_type.x = out_param call_param2
@@ -3734,7 +3734,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc8_29.1: type = specific_constant @K.WithSelf.F.%V.ref.loc8_29, @K.WithSelf.F(constants.%K.facet) [concrete = constants.%struct_type.a]
// CHECK:STDOUT: %.loc8_29.2: type = specific_constant @K.WithSelf.F.%.loc8_29.2, @K.WithSelf.F(constants.%K.facet) [concrete = constants.%.074]
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_45.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_45.2 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.2] {
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.decl.loc26_52.2: %empty_tuple.type.as.K.impl.F.type.1710d5.2 = fn_decl @empty_tuple.type.as.K.impl.F.loc26_52.2 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.2] {
// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %v.patt: %pattern_type.e85 = value_binding_pattern v [concrete]
@@ -3749,12 +3749,12 @@ fn F() {
// CHECK:STDOUT: %return.param: ref %struct_type.a = out_param call_param2
// CHECK:STDOUT: %return: ref %struct_type.a = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.K.impl.F.decl.loc26_45.2), @empty_tuple.type.as.K.impl [concrete]
// CHECK:STDOUT: %K.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, %empty_tuple.type.as.K.impl.F.decl.loc26_52.2), @empty_tuple.type.as.K.impl [concrete]
// CHECK:STDOUT: %K.impl_witness: <witness> = impl_witness %K.impl_witness_table [concrete = constants.%K.impl_witness]
// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%struct_type.a [concrete = constants.%struct_type.a]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = %empty_tuple.type.as.K.impl.F.decl.loc26_45.1
// CHECK:STDOUT: .F = %empty_tuple.type.as.K.impl.F.decl.loc26_52.1
// CHECK:STDOUT: witness = %K.impl_witness
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -3770,29 +3770,29 @@ fn F() {
// CHECK:STDOUT: fn(%self.param: @K.WithSelf.F.%Self.binding.as_type (%Self.binding.as_type.87a), %v.param: @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23)) -> out %return.param: @K.WithSelf.F.%impl.elem0.loc8_23.1 (%impl.elem0.c23);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_45.1(%self.param: %empty_tuple.type, %v.param: %struct_type.x) -> out %return.param: %struct_type.x {
// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_52.1(%self.param: %empty_tuple.type, %v.param: %struct_type.x) -> out %return.param: %struct_type.x {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %v.ref: %struct_type.x = name_ref v, %v
// CHECK:STDOUT: %.loc26_54.1: %empty_tuple.type = struct_access %v.ref, element0
// CHECK:STDOUT: %.loc26_54.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_54.3: init %empty_tuple.type = converted %.loc26_54.1, %.loc26_54.2 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_54.4: init %struct_type.x = struct_init (%.loc26_54.3) [concrete = constants.%struct]
// CHECK:STDOUT: %.loc26_55: init %struct_type.x = converted %v.ref, %.loc26_54.4 [concrete = constants.%struct]
// CHECK:STDOUT: return %.loc26_55
// CHECK:STDOUT: %.loc26_61.1: %empty_tuple.type = struct_access %v.ref, element0
// CHECK:STDOUT: %.loc26_61.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_61.3: init %empty_tuple.type = converted %.loc26_61.1, %.loc26_61.2 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_61.4: init %struct_type.x = struct_init (%.loc26_61.3) [concrete = constants.%struct]
// CHECK:STDOUT: %.loc26_62: init %struct_type.x = converted %v.ref, %.loc26_61.4 [concrete = constants.%struct]
// CHECK:STDOUT: return %.loc26_62
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_45.2(%self.param: %empty_tuple.type, %v.param: %struct_type.a) -> out %return.param: %struct_type.a [thunk @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_45.1] {
// CHECK:STDOUT: fn @empty_tuple.type.as.K.impl.F.loc26_52.2(%self.param: %empty_tuple.type, %v.param: %struct_type.a) -> out %return.param: %struct_type.a [thunk @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = name_ref F, @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_45.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1]
// CHECK:STDOUT: %F.ref: %empty_tuple.type.as.K.impl.F.type.1710d5.1 = name_ref F, @empty_tuple.type.as.K.impl.%empty_tuple.type.as.K.impl.F.decl.loc26_52.1 [concrete = constants.%empty_tuple.type.as.K.impl.F.907e52.1]
// CHECK:STDOUT: %self.ref: %empty_tuple.type = name_ref self, %self.param
// CHECK:STDOUT: %v.ref: %struct_type.a = name_ref v, %v.param
// CHECK:STDOUT: %return.ref: ref %struct_type.a = name_ref <return slot>, %return.param
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.bound: <bound method> = bound_method %self.ref, %F.ref
// CHECK:STDOUT: %empty_tuple.type.as.K.impl.F.call: init %struct_type.x = call %empty_tuple.type.as.K.impl.F.bound(%self.ref, <error>)
// CHECK:STDOUT: %.loc26_45.1: ref %struct_type.x = temporary_storage
// CHECK:STDOUT: %.loc26_45.2: ref %struct_type.x = temporary %.loc26_45.1, %empty_tuple.type.as.K.impl.F.call
// CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc26_45.2, constants.%DestroyOp
// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc26_45.2)
// CHECK:STDOUT: %.loc26_52.1: ref %struct_type.x = temporary_storage
// CHECK:STDOUT: %.loc26_52.2: ref %struct_type.x = temporary %.loc26_52.1, %empty_tuple.type.as.K.impl.F.call
// CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc26_52.2, constants.%DestroyOp
// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc26_52.2)
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -4505,10 +4505,10 @@ fn F() {
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
// CHECK:STDOUT: %.loc9_31.1: type = value_of_initializer %Bool.call [concrete = bool]
// CHECK:STDOUT: %.loc9_31.2: type = converted %Bool.call, %.loc9_31.1 [concrete = bool]
// CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc9_31.2 [concrete = constants.%array_type.c9b]
// CHECK:STDOUT: %.loc9_38: Core.Form = init_form %array_type, call_param1 [concrete = constants.%.d10]
// CHECK:STDOUT: %.loc9_38.1: type = value_of_initializer %Bool.call [concrete = bool]
// CHECK:STDOUT: %.loc9_38.2: type = converted %Bool.call, %.loc9_38.1 [concrete = bool]
// CHECK:STDOUT: %array_type: type = array_type %int_2, %.loc9_38.2 [concrete = constants.%array_type.c9b]
// CHECK:STDOUT: %.loc9_45: Core.Form = init_form %array_type, call_param1 [concrete = constants.%.d10]
// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @empty_tuple.type.as.I.impl.%.loc8_7.2 [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %self: %empty_tuple.type = value_binding self, %self.param
@@ -4544,22 +4544,22 @@ fn F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false]
// CHECK:STDOUT: %.loc9_61.1: %tuple.type.784 = tuple_literal (%true, %false) [concrete = constants.%tuple.a9a]
// CHECK:STDOUT: %impl.elem0.loc9_50: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
// CHECK:STDOUT: %bound_method.loc9_50: <bound method> = bound_method %true, %impl.elem0.loc9_50 [concrete = constants.%bool.as.Copy.impl.Op.bound.12b]
// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_50: init bool = call %bound_method.loc9_50(%true) [concrete = constants.%true]
// CHECK:STDOUT: %.loc9_68.1: %tuple.type.784 = tuple_literal (%true, %false) [concrete = constants.%tuple.a9a]
// CHECK:STDOUT: %impl.elem0.loc9_57: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
// CHECK:STDOUT: %bound_method.loc9_57: <bound method> = bound_method %true, %impl.elem0.loc9_57 [concrete = constants.%bool.as.Copy.impl.Op.bound.12b]
// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_57: init bool = call %bound_method.loc9_57(%true) [concrete = constants.%true]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
// CHECK:STDOUT: %.loc9_61.2: ref bool = array_index %return.param, %int_0
// CHECK:STDOUT: %.loc9_61.3: init bool to %.loc9_61.2 = in_place_init %bool.as.Copy.impl.Op.call.loc9_50 [concrete = constants.%true]
// CHECK:STDOUT: %impl.elem0.loc9_56: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
// CHECK:STDOUT: %bound_method.loc9_56: <bound method> = bound_method %false, %impl.elem0.loc9_56 [concrete = constants.%bool.as.Copy.impl.Op.bound.082]
// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_56: init bool = call %bound_method.loc9_56(%false) [concrete = constants.%false]
// CHECK:STDOUT: %.loc9_68.2: ref bool = array_index %return.param, %int_0
// CHECK:STDOUT: %.loc9_68.3: init bool to %.loc9_68.2 = in_place_init %bool.as.Copy.impl.Op.call.loc9_57 [concrete = constants.%true]
// CHECK:STDOUT: %impl.elem0.loc9_63: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
// CHECK:STDOUT: %bound_method.loc9_63: <bound method> = bound_method %false, %impl.elem0.loc9_63 [concrete = constants.%bool.as.Copy.impl.Op.bound.082]
// CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_63: init bool = call %bound_method.loc9_63(%false) [concrete = constants.%false]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
// CHECK:STDOUT: %.loc9_61.4: ref bool = array_index %return.param, %int_1
// CHECK:STDOUT: %.loc9_61.5: init bool to %.loc9_61.4 = in_place_init %bool.as.Copy.impl.Op.call.loc9_56 [concrete = constants.%false]
// CHECK:STDOUT: %.loc9_61.6: init %array_type.c9b to %return.param = array_init (%.loc9_61.3, %.loc9_61.5) [concrete = constants.%array]
// CHECK:STDOUT: %.loc9_62: init %array_type.c9b = converted %.loc9_61.1, %.loc9_61.6 [concrete = constants.%array]
// CHECK:STDOUT: return %.loc9_62 to %return.param
// CHECK:STDOUT: %.loc9_68.4: ref bool = array_index %return.param, %int_1
// CHECK:STDOUT: %.loc9_68.5: init bool to %.loc9_68.4 = in_place_init %bool.as.Copy.impl.Op.call.loc9_63 [concrete = constants.%false]
// CHECK:STDOUT: %.loc9_68.6: init %array_type.c9b to %return.param = array_init (%.loc9_68.3, %.loc9_68.5) [concrete = constants.%array]
// CHECK:STDOUT: %.loc9_69: init %array_type.c9b = converted %.loc9_68.1, %.loc9_68.6 [concrete = constants.%array]
// CHECK:STDOUT: return %.loc9_69 to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I(constants.%Self.ab9) {
@@ -4765,26 +4765,26 @@ fn F() {
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %a.patt: %pattern_type.a7e = value_binding_pattern a [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc12_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
// CHECK:STDOUT: %D.ref.loc12_28: type = name_ref D, file.%D.decl [concrete = constants.%D]
// CHECK:STDOUT: %D.ref.loc12_35: type = name_ref D, file.%D.decl [concrete = constants.%D]
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%D) [concrete = constants.%C.302]
// CHECK:STDOUT: %.loc12_21.2: ref %C.302 = temporary_storage
// CHECK:STDOUT: %.loc12_21.3: init %C.302 to %.loc12_21.2 = class_init () [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc12_21.4: ref %C.302 = temporary %.loc12_21.2, %.loc12_21.3
// CHECK:STDOUT: %.loc12_23.1: ref %C.302 = converted %.loc12_21.1, %.loc12_21.4
// CHECK:STDOUT: %.loc12_11.1: type = splice_block %impl.elem0 [concrete = constants.%C.302] {
// CHECK:STDOUT: %D.ref.loc12_10: type = name_ref D, file.%D.decl [concrete = constants.%D]
// CHECK:STDOUT: %.loc12_28.2: ref %C.302 = temporary_storage
// CHECK:STDOUT: %.loc12_28.3: init %C.302 to %.loc12_28.2 = class_init () [concrete = constants.%C.val]
// CHECK:STDOUT: %.loc12_28.4: ref %C.302 = temporary %.loc12_28.2, %.loc12_28.3
// CHECK:STDOUT: %.loc12_30.1: ref %C.302 = converted %.loc12_28.1, %.loc12_28.4
// CHECK:STDOUT: %.loc12_18.1: type = splice_block %impl.elem0 [concrete = constants.%C.302] {
// CHECK:STDOUT: %D.ref.loc12_17: type = name_ref D, file.%D.decl [concrete = constants.%D]
// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
// CHECK:STDOUT: %X.ref: %Z.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.cdf]
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %D.ref.loc12_10, (constants.%Z.impl_witness.63b) [concrete = constants.%Z.facet.59e]
// CHECK:STDOUT: %.loc12_11.2: %Z.type = converted %D.ref.loc12_10, %Z.facet [concrete = constants.%Z.facet.59e]
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %D.ref.loc12_17, (constants.%Z.impl_witness.63b) [concrete = constants.%Z.facet.59e]
// CHECK:STDOUT: %.loc12_18.2: %Z.type = converted %D.ref.loc12_17, %Z.facet [concrete = constants.%Z.facet.59e]
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.63b, element0 [concrete = constants.%C.302]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12_23.2: %C.302 = acquire_value %.loc12_23.1
// CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_23.2
// CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc12_21.4, constants.%DestroyOp
// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc12_21.4)
// CHECK:STDOUT: %.loc12_30.2: %C.302 = acquire_value %.loc12_30.1
// CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_30.2
// CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc12_28.4, constants.%DestroyOp
// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc12_28.4)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -40,11 +40,11 @@ class C {
// CHECK:STDERR: ^
// CHECK:STDERR:
impl as IMisuse where .Arg = T {
// CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE+4]]:35: error: name `T` not found [NameNotFound]
// CHECK:STDERR: fn Op[self: Self]() -> ArgToI(T) {
// CHECK:STDERR: ^
// CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE+4]]:42: error: name `T` not found [NameNotFound]
// CHECK:STDERR: fn Op[unused self: Self]() -> ArgToI(T) {
// CHECK:STDERR: ^
// CHECK:STDERR:
fn Op[self: Self]() -> ArgToI(T) {
fn Op[unused self: Self]() -> ArgToI(T) {
return {};
}
}
@@ -84,15 +84,15 @@ class ArgC {}
class C {
impl as IMisuse where .Arg = ArgC {
// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+8]]:28: error: cannot convert type `ArgC` into type implementing `I` [ConversionFailureTypeToFacet]
// CHECK:STDERR: fn Op[self: Self]() -> ArgToI(ArgC) {
// CHECK:STDERR: ^~~~~~~~~~~~
// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+8]]:35: error: cannot convert type `ArgC` into type implementing `I` [ConversionFailureTypeToFacet]
// CHECK:STDERR: fn Op[unused self: Self]() -> ArgToI(ArgC) {
// CHECK:STDERR: ^~~~~~~~~~~~
// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE-9]]:1: in import [InImport]
// CHECK:STDERR: fail_invalid_interface.carbon:5:14: note: initializing generic parameter `T` declared here [InitializingGenericParam]
// CHECK:STDERR: class ArgToI(T:! I) {}
// CHECK:STDERR: ^
// CHECK:STDERR:
fn Op[self: Self]() -> ArgToI(ArgC) {
fn Op[unused self: Self]() -> ArgToI(ArgC) {
return {};
}
}