mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 21:31:24 +01:00
Implements proposal #7016: `self` moves from the deduced implicit list (`fn F[self: Self]()`) to the front of the explicit list. Its type may be written explicitly (`fn F(self: Self)`) or omitted, in which case it defaults to `Self` (`fn F(self)`, `fn F(ref self)`); `self` in the implicit list is rejected. Throughout checking, `self` is modeled as the first explicit parameter. Because a method is just a function whose first parameter is `self`, it can also be called as an ordinary function with the receiver passed explicitly (`Type.M(obj, ...)`), not only as `obj.M(...)`. A new `SemIR::CallArgParamPatterns` helper chooses the parameters matched against the explicit arguments, excluding a leading `self` only when it is supplied as a method-call receiver; arity checking, conversion, and generic deduction use it. The resulting SemIR and lowering are unchanged: `self` is still `call_param0`, and witnesses, thunks, and vtables are unaffected. An omitted `self` type is parsed as a `SelfBindingPattern` node with no type expression; checking synthesizes the `Self` type so it behaves exactly like `self: Self`. However, the exact spelling used must match between a forward declaration and a definition, following #3763's rules around declaration matching. Generated functions, thunks, and C++ interop import/export build `self` as the first explicit parameter, and the `self`-type override (e.g. Derived->Base for a virtual override) applies to the explicit `self`. Placement is validated by new diagnostics: `SelfInImplicitParamList`, `SelfNotFirstParam`, and `SelfOutsideParamList`. The benchmark source generator and the documentation adopt the `(self)` shorthand; the prelude, the examples, and the test data are migrated in the following commits. Assisted-by: Claude Code with Claude Opus 4.7 --------- Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>
This commit is contained in:
co-authored by
josh11b
parent
fb05da761f
commit
7871237c15
+117
-116
@@ -21,31 +21,31 @@ alias IntLiteral = MakeIntLiteral();
|
||||
fn Int(N: IntLiteral) -> type = "int.make_type_signed";
|
||||
|
||||
interface AddWith(T:! type) {
|
||||
fn Op[self: Self](other: Self) -> Self;
|
||||
fn Op(self, other: Self) -> Self;
|
||||
}
|
||||
|
||||
interface As(T:! type) {
|
||||
fn Convert[self: Self]() -> T;
|
||||
fn Convert(self) -> T;
|
||||
}
|
||||
|
||||
interface ImplicitAs(T:! type) {
|
||||
fn Convert[self: Self]() -> T;
|
||||
fn Convert(self) -> T;
|
||||
}
|
||||
|
||||
impl i32 as AddWith(i32) {
|
||||
fn Op[self: Self](other: Self) -> Self = "int.sadd";
|
||||
fn Op(self, other: Self) -> Self = "int.sadd";
|
||||
}
|
||||
|
||||
impl IntLiteral as As(i32) {
|
||||
fn Convert[self: Self]() -> i32 = "int.convert_checked";
|
||||
fn Convert(self) -> i32 = "int.convert_checked";
|
||||
}
|
||||
|
||||
impl IntLiteral as ImplicitAs(i32) {
|
||||
fn Convert[self: Self]() -> i32 = "int.convert_checked";
|
||||
fn Convert(self) -> i32 = "int.convert_checked";
|
||||
}
|
||||
|
||||
impl i32 as ImplicitAs(IntLiteral) {
|
||||
fn Convert[self: Self]() -> IntLiteral = "int.convert_checked";
|
||||
fn Convert(self) -> IntLiteral = "int.convert_checked";
|
||||
}
|
||||
|
||||
// --- user.carbon
|
||||
@@ -54,6 +54,7 @@ import Core;
|
||||
|
||||
var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- core.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -263,37 +264,37 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %other.param_patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %other.patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = at_binding_pattern other, %other.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = return_slot_pattern %return.param_patt, %.loc9_37.3 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = return_slot_pattern %return.param_patt, %.loc9_31.3 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc9_37.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.ref.loc9_37: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_37.2 [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_37: type = facet_access_type %Self.ref.loc9_37 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_37.3: type = converted %Self.ref.loc9_37, %Self.as_type.loc9_37 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_37.4: Core.Form = init_form %.loc9_37.3 [symbolic = %.loc9_37.1 (constants.%.e80)]
|
||||
// CHECK:STDOUT: %self.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc9_15.1: type = splice_block %.loc9_15.3 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] {
|
||||
// CHECK:STDOUT: %.loc9_15.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.ref.loc9_15: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_15.2 [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_15.2: type = facet_access_type %Self.ref.loc9_15 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_15.3: type = converted %Self.ref.loc9_15, %Self.as_type.loc9_15.2 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_31.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.ref.loc9_31: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_31.2 [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_31: type = facet_access_type %Self.ref.loc9_31 [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_31.3: type = converted %Self.ref.loc9_31, %Self.as_type.loc9_31 [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_31.4: Core.Form = init_form %.loc9_31.3 [symbolic = %.loc9_31.1 (constants.%.e80)]
|
||||
// CHECK:STDOUT: %self.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc9_9.1: type = splice_block %.loc9_9.3 [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)] {
|
||||
// CHECK:STDOUT: %.loc9_9.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.ref.loc9_9: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_9.2 [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_9.2: type = facet_access_type %Self.ref.loc9_9 [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_9.3: type = converted %Self.ref.loc9_9, %Self.as_type.loc9_9.2 [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc9_28.1: type = splice_block %.loc9_28.3 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] {
|
||||
// CHECK:STDOUT: %.loc9_28.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.ref.loc9_28: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_28.2 [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_28: type = facet_access_type %Self.ref.loc9_28 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_28.3: type = converted %Self.ref.loc9_28, %Self.as_type.loc9_28 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %self: @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c) = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c) = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc9_22.1: type = splice_block %.loc9_22.3 [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)] {
|
||||
// CHECK:STDOUT: %.loc9_22.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.ref.loc9_22: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_22.2 [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_22: type = facet_access_type %Self.ref.loc9_22 [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %.loc9_22.3: type = converted %Self.ref.loc9_22, %Self.as_type.loc9_22 [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %other: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = value_binding other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = return_slot %return.param
|
||||
// CHECK:STDOUT: %other: @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c) = value_binding other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c) = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %assoc0.loc9_41.1: @AddWith.WithSelf.%AddWith.assoc_type (%AddWith.assoc_type.588) = assoc_entity element0, %AddWith.WithSelf.Op.decl [symbolic = %assoc0.loc9_41.2 (constants.%assoc0.aed)]
|
||||
// CHECK:STDOUT: %assoc0.loc9_35.1: @AddWith.WithSelf.%AddWith.assoc_type (%AddWith.assoc_type.588) = assoc_entity element0, %AddWith.WithSelf.Op.decl [symbolic = %assoc0.loc9_35.2 (constants.%assoc0.aed)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.loc8_29.1
|
||||
// CHECK:STDOUT: .Op = @AddWith.WithSelf.%assoc0.loc9_41.1
|
||||
// CHECK:STDOUT: .Op = @AddWith.WithSelf.%assoc0.loc9_35.1
|
||||
// CHECK:STDOUT: witness = (@AddWith.WithSelf.%AddWith.WithSelf.Op.decl)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !requires:
|
||||
@@ -313,31 +314,31 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !with Self:
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.decl: @As.WithSelf.%As.WithSelf.Convert.type (%As.WithSelf.Convert.type.640) = fn_decl @As.WithSelf.Convert [symbolic = @As.WithSelf.%As.WithSelf.Convert (constants.%As.WithSelf.Convert.896)] {
|
||||
// CHECK:STDOUT: %self.param_patt: @As.WithSelf.Convert.%pattern_type.loc13_18 (%pattern_type.a01) = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: @As.WithSelf.Convert.%pattern_type.loc13_18 (%pattern_type.a01) = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: @As.WithSelf.Convert.%pattern_type.loc13_31 (%pattern_type.51d) = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @As.WithSelf.Convert.%pattern_type.loc13_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: @As.WithSelf.Convert.%pattern_type.loc13_14 (%pattern_type.a01) = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: @As.WithSelf.Convert.%pattern_type.loc13_14 (%pattern_type.a01) = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: @As.WithSelf.Convert.%pattern_type.loc13_23 (%pattern_type.51d) = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @As.WithSelf.Convert.%pattern_type.loc13_23 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, @As.%T.loc12_15.2 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc13_31.2: Core.Form = init_form %T.ref [symbolic = %.loc13_31.1 (constants.%.184)]
|
||||
// CHECK:STDOUT: %self.param: @As.WithSelf.Convert.%Self.as_type.loc13_20.1 (%Self.as_type.1ce) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc13_20.1: type = splice_block %.loc13_20.3 [symbolic = %Self.as_type.loc13_20.1 (constants.%Self.as_type.1ce)] {
|
||||
// CHECK:STDOUT: %.loc13_20.2: @As.WithSelf.Convert.%As.type (%As.type.c5f) = specific_constant @As.%Self.loc12_24.1, @As(constants.%T) [symbolic = %Self (constants.%Self.f80)]
|
||||
// CHECK:STDOUT: %Self.ref: @As.WithSelf.Convert.%As.type (%As.type.c5f) = name_ref Self, %.loc13_20.2 [symbolic = %Self (constants.%Self.f80)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc13_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_20.1 (constants.%Self.as_type.1ce)]
|
||||
// CHECK:STDOUT: %.loc13_20.3: type = converted %Self.ref, %Self.as_type.loc13_20.2 [symbolic = %Self.as_type.loc13_20.1 (constants.%Self.as_type.1ce)]
|
||||
// CHECK:STDOUT: %.loc13_23.2: Core.Form = init_form %T.ref [symbolic = %.loc13_23.1 (constants.%.184)]
|
||||
// CHECK:STDOUT: %self.param: @As.WithSelf.Convert.%Self.as_type.loc13_14.1 (%Self.as_type.1ce) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc13_14.1: type = splice_block %.loc13_14.3 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1ce)] {
|
||||
// CHECK:STDOUT: %.loc13_14.2: @As.WithSelf.Convert.%As.type (%As.type.c5f) = specific_constant @As.%Self.loc12_24.1, @As(constants.%T) [symbolic = %Self (constants.%Self.f80)]
|
||||
// CHECK:STDOUT: %Self.ref: @As.WithSelf.Convert.%As.type (%As.type.c5f) = name_ref Self, %.loc13_14.2 [symbolic = %Self (constants.%Self.f80)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc13_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1ce)]
|
||||
// CHECK:STDOUT: %.loc13_14.3: type = converted %Self.ref, %Self.as_type.loc13_14.2 [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1ce)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: @As.WithSelf.Convert.%Self.as_type.loc13_20.1 (%Self.as_type.1ce) = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %self: @As.WithSelf.Convert.%Self.as_type.loc13_14.1 (%Self.as_type.1ce) = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %return.param: ref @As.WithSelf.Convert.%T (%T) = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref @As.WithSelf.Convert.%T (%T) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %assoc0.loc13_32.1: @As.WithSelf.%As.assoc_type (%As.assoc_type.b40) = assoc_entity element0, %As.WithSelf.Convert.decl [symbolic = %assoc0.loc13_32.2 (constants.%assoc0.a44)]
|
||||
// CHECK:STDOUT: %assoc0.loc13_24.1: @As.WithSelf.%As.assoc_type (%As.assoc_type.b40) = assoc_entity element0, %As.WithSelf.Convert.decl [symbolic = %assoc0.loc13_24.2 (constants.%assoc0.a44)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.loc12_24.1
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .Convert = @As.WithSelf.%assoc0.loc13_32.1
|
||||
// CHECK:STDOUT: .Convert = @As.WithSelf.%assoc0.loc13_24.1
|
||||
// CHECK:STDOUT: witness = (@As.WithSelf.%As.WithSelf.Convert.decl)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !requires:
|
||||
@@ -357,31 +358,31 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !with Self:
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.decl: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.920) = fn_decl @ImplicitAs.WithSelf.Convert [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.293)] {
|
||||
// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_18 (%pattern_type.701) = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_18 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_31 (%pattern_type.51d) = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_14 (%pattern_type.701) = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_14 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_23 (%pattern_type.51d) = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_23 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc16_23.2 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc17_31.2: Core.Form = init_form %T.ref [symbolic = %.loc17_31.1 (constants.%.184)]
|
||||
// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_20.1 (%Self.as_type.5b8) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc17_20.1: type = splice_block %.loc17_20.3 [symbolic = %Self.as_type.loc17_20.1 (constants.%Self.as_type.5b8)] {
|
||||
// CHECK:STDOUT: %.loc17_20.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc16_32.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.bb1)]
|
||||
// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc17_20.2 [symbolic = %Self (constants.%Self.bb1)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc17_20.1 (constants.%Self.as_type.5b8)]
|
||||
// CHECK:STDOUT: %.loc17_20.3: type = converted %Self.ref, %Self.as_type.loc17_20.2 [symbolic = %Self.as_type.loc17_20.1 (constants.%Self.as_type.5b8)]
|
||||
// CHECK:STDOUT: %.loc17_23.2: Core.Form = init_form %T.ref [symbolic = %.loc17_23.1 (constants.%.184)]
|
||||
// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_14.1 (%Self.as_type.5b8) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc17_14.1: type = splice_block %.loc17_14.3 [symbolic = %Self.as_type.loc17_14.1 (constants.%Self.as_type.5b8)] {
|
||||
// CHECK:STDOUT: %.loc17_14.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc16_32.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.bb1)]
|
||||
// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc17_14.2 [symbolic = %Self (constants.%Self.bb1)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc17_14.1 (constants.%Self.as_type.5b8)]
|
||||
// CHECK:STDOUT: %.loc17_14.3: type = converted %Self.ref, %Self.as_type.loc17_14.2 [symbolic = %Self.as_type.loc17_14.1 (constants.%Self.as_type.5b8)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_20.1 (%Self.as_type.5b8) = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_14.1 (%Self.as_type.5b8) = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %return.param: ref @ImplicitAs.WithSelf.Convert.%T (%T) = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref @ImplicitAs.WithSelf.Convert.%T (%T) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %assoc0.loc17_32.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.fcc) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc17_32.2 (constants.%assoc0.313)]
|
||||
// CHECK:STDOUT: %assoc0.loc17_24.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.fcc) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc17_24.2 (constants.%assoc0.313)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.loc16_32.1
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc17_32.1
|
||||
// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc17_24.1
|
||||
// CHECK:STDOUT: .IntLiteral = <poisoned>
|
||||
// CHECK:STDOUT: witness = (@ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.decl)
|
||||
// CHECK:STDOUT:
|
||||
@@ -396,15 +397,15 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %other.param_patt: %pattern_type.956 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %other.patt: %pattern_type.956 = at_binding_pattern other, %other.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %Self.ref.loc21_37 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %Self.ref.loc21_31 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc21_37: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc21: Core.Form = init_form %Self.ref.loc21_37 [concrete = constants.%.9cb]
|
||||
// CHECK:STDOUT: %Self.ref.loc21_31: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc21: Core.Form = init_form %Self.ref.loc21_31 [concrete = constants.%.9cb]
|
||||
// CHECK:STDOUT: %self.param: %i32.builtin = value_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref.loc21_15: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %Self.ref.loc21_9: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %self: %i32.builtin = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %other.param: %i32.builtin = value_param call_param1
|
||||
// CHECK:STDOUT: %Self.ref.loc21_28: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %Self.ref.loc21_22: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %other: %i32.builtin = value_binding other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param
|
||||
@@ -423,10 +424,10 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.dc0 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.dc0 = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc25_31.1 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc25_23.1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc25_31.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc25_31.2: Core.Form = init_form %.loc25_31.1 [concrete = constants.%.9cb]
|
||||
// CHECK:STDOUT: %.loc25_23.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc25_23.2: Core.Form = init_form %.loc25_23.1 [concrete = constants.%.9cb]
|
||||
// CHECK:STDOUT: %self.param: Core.IntLiteral = value_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @Core.IntLiteral.as.As.impl.%IntLiteral.ref [concrete = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %self: Core.IntLiteral = value_binding self, %self.param
|
||||
@@ -447,10 +448,10 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.dc0 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.dc0 = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc29_31.1 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc29_23.1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc29_31.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc29_31.2: Core.Form = init_form %.loc29_31.1 [concrete = constants.%.9cb]
|
||||
// CHECK:STDOUT: %.loc29_23.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc29_23.2: Core.Form = init_form %.loc29_23.1 [concrete = constants.%.9cb]
|
||||
// CHECK:STDOUT: %self.param: Core.IntLiteral = value_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @Core.IntLiteral.as.ImplicitAs.impl.%IntLiteral.ref [concrete = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %self: Core.IntLiteral = value_binding self, %self.param
|
||||
@@ -499,35 +500,35 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(%T)> [symbolic = %AddWith.type (constants.%AddWith.type.7e9)]
|
||||
// CHECK:STDOUT: %Self: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.8d5)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc9_15.1 [symbolic = %pattern_type (constants.%pattern_type.131)]
|
||||
// CHECK:STDOUT: %.loc9_37.1: Core.Form = init_form %Self.as_type.loc9_15.1 [symbolic = %.loc9_37.1 (constants.%.e80)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_9.1 (constants.%Self.as_type.48c)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc9_9.1 [symbolic = %pattern_type (constants.%pattern_type.131)]
|
||||
// CHECK:STDOUT: %.loc9_31.1: Core.Form = init_form %Self.as_type.loc9_9.1 [symbolic = %.loc9_31.1 (constants.%.e80)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%self.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c), %other.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c)) -> out %return.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c);
|
||||
// CHECK:STDOUT: fn(%self.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c), %other.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c)) -> out %return.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_9.1 (%Self.as_type.48c);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @As.WithSelf.Convert(@As.%T.loc12_15.2: type, @As.%Self.loc12_24.1: @As.%As.type (%As.type.c5f)) {
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T)> [symbolic = %As.type (constants.%As.type.c5f)]
|
||||
// CHECK:STDOUT: %Self: @As.WithSelf.Convert.%As.type (%As.type.c5f) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.f80)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc13_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc13_20.1 (constants.%Self.as_type.1ce)]
|
||||
// CHECK:STDOUT: %pattern_type.loc13_18: type = pattern_type %Self.as_type.loc13_20.1 [symbolic = %pattern_type.loc13_18 (constants.%pattern_type.a01)]
|
||||
// CHECK:STDOUT: %.loc13_31.1: Core.Form = init_form %T [symbolic = %.loc13_31.1 (constants.%.184)]
|
||||
// CHECK:STDOUT: %pattern_type.loc13_31: type = pattern_type %T [symbolic = %pattern_type.loc13_31 (constants.%pattern_type.51d)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc13_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc13_14.1 (constants.%Self.as_type.1ce)]
|
||||
// CHECK:STDOUT: %pattern_type.loc13_14: type = pattern_type %Self.as_type.loc13_14.1 [symbolic = %pattern_type.loc13_14 (constants.%pattern_type.a01)]
|
||||
// CHECK:STDOUT: %.loc13_23.1: Core.Form = init_form %T [symbolic = %.loc13_23.1 (constants.%.184)]
|
||||
// CHECK:STDOUT: %pattern_type.loc13_23: type = pattern_type %T [symbolic = %pattern_type.loc13_23 (constants.%pattern_type.51d)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%self.param: @As.WithSelf.Convert.%Self.as_type.loc13_20.1 (%Self.as_type.1ce)) -> out %return.param: @As.WithSelf.Convert.%T (%T);
|
||||
// CHECK:STDOUT: fn(%self.param: @As.WithSelf.Convert.%Self.as_type.loc13_14.1 (%Self.as_type.1ce)) -> out %return.param: @As.WithSelf.Convert.%T (%T);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @ImplicitAs.WithSelf.Convert(@ImplicitAs.%T.loc16_23.2: type, @ImplicitAs.%Self.loc16_32.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3aa)) {
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3aa)]
|
||||
// CHECK:STDOUT: %Self: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.bb1)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc17_20.1 (constants.%Self.as_type.5b8)]
|
||||
// CHECK:STDOUT: %pattern_type.loc17_18: type = pattern_type %Self.as_type.loc17_20.1 [symbolic = %pattern_type.loc17_18 (constants.%pattern_type.701)]
|
||||
// CHECK:STDOUT: %.loc17_31.1: Core.Form = init_form %T [symbolic = %.loc17_31.1 (constants.%.184)]
|
||||
// CHECK:STDOUT: %pattern_type.loc17_31: type = pattern_type %T [symbolic = %pattern_type.loc17_31 (constants.%pattern_type.51d)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc17_14.1 (constants.%Self.as_type.5b8)]
|
||||
// CHECK:STDOUT: %pattern_type.loc17_14: type = pattern_type %Self.as_type.loc17_14.1 [symbolic = %pattern_type.loc17_14 (constants.%pattern_type.701)]
|
||||
// CHECK:STDOUT: %.loc17_23.1: Core.Form = init_form %T [symbolic = %.loc17_23.1 (constants.%.184)]
|
||||
// CHECK:STDOUT: %pattern_type.loc17_23: type = pattern_type %T [symbolic = %pattern_type.loc17_23 (constants.%pattern_type.51d)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_20.1 (%Self.as_type.5b8)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%T (%T);
|
||||
// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_14.1 (%Self.as_type.5b8)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%T (%T);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @i32.builtin.as.AddWith.impl.Op(%self.param: %i32.builtin, %other.param: %i32.builtin) -> out %return.param: %i32.builtin = "int.sadd";
|
||||
@@ -548,9 +549,9 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.7e9
|
||||
// CHECK:STDOUT: %Self => constants.%Self.8d5
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_15.1 => constants.%Self.as_type.48c
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_9.1 => constants.%Self.as_type.48c
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.131
|
||||
// CHECK:STDOUT: %.loc9_37.1 => constants.%.e80
|
||||
// CHECK:STDOUT: %.loc9_31.1 => constants.%.e80
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @As(constants.%T) {
|
||||
@@ -563,10 +564,10 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %As.type => constants.%As.type.c5f
|
||||
// CHECK:STDOUT: %Self => constants.%Self.f80
|
||||
// CHECK:STDOUT: %Self.as_type.loc13_20.1 => constants.%Self.as_type.1ce
|
||||
// CHECK:STDOUT: %pattern_type.loc13_18 => constants.%pattern_type.a01
|
||||
// CHECK:STDOUT: %.loc13_31.1 => constants.%.184
|
||||
// CHECK:STDOUT: %pattern_type.loc13_31 => constants.%pattern_type.51d
|
||||
// CHECK:STDOUT: %Self.as_type.loc13_14.1 => constants.%Self.as_type.1ce
|
||||
// CHECK:STDOUT: %pattern_type.loc13_14 => constants.%pattern_type.a01
|
||||
// CHECK:STDOUT: %.loc13_23.1 => constants.%.184
|
||||
// CHECK:STDOUT: %pattern_type.loc13_23 => constants.%pattern_type.51d
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%T) {
|
||||
@@ -579,10 +580,10 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3aa
|
||||
// CHECK:STDOUT: %Self => constants.%Self.bb1
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_20.1 => constants.%Self.as_type.5b8
|
||||
// CHECK:STDOUT: %pattern_type.loc17_18 => constants.%pattern_type.701
|
||||
// CHECK:STDOUT: %.loc17_31.1 => constants.%.184
|
||||
// CHECK:STDOUT: %pattern_type.loc17_31 => constants.%pattern_type.51d
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_14.1 => constants.%Self.as_type.5b8
|
||||
// CHECK:STDOUT: %pattern_type.loc17_14 => constants.%pattern_type.701
|
||||
// CHECK:STDOUT: %.loc17_23.1 => constants.%.184
|
||||
// CHECK:STDOUT: %pattern_type.loc17_23 => constants.%pattern_type.51d
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @AddWith(constants.%i32.builtin) {
|
||||
@@ -601,7 +602,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.aad
|
||||
// CHECK:STDOUT: %AddWith.WithSelf.Op => constants.%AddWith.WithSelf.Op.e15
|
||||
// CHECK:STDOUT: %AddWith.assoc_type => constants.%AddWith.assoc_type.439
|
||||
// CHECK:STDOUT: %assoc0.loc9_41.2 => constants.%assoc0.7f8
|
||||
// CHECK:STDOUT: %assoc0.loc9_35.2 => constants.%assoc0.7f8
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @AddWith.WithSelf(constants.%i32.builtin, constants.%AddWith.facet) {
|
||||
@@ -612,16 +613,16 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.2dc
|
||||
// CHECK:STDOUT: %AddWith.WithSelf.Op => constants.%AddWith.WithSelf.Op.921
|
||||
// CHECK:STDOUT: %AddWith.assoc_type => constants.%AddWith.assoc_type.439
|
||||
// CHECK:STDOUT: %assoc0.loc9_41.2 => constants.%assoc0.7f8
|
||||
// CHECK:STDOUT: %assoc0.loc9_35.2 => constants.%assoc0.7f8
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @AddWith.WithSelf.Op(constants.%i32.builtin, constants.%AddWith.facet) {
|
||||
// CHECK:STDOUT: %T => constants.%i32.builtin
|
||||
// CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.7c6
|
||||
// CHECK:STDOUT: %Self => constants.%AddWith.facet
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_15.1 => constants.%i32.builtin
|
||||
// CHECK:STDOUT: %Self.as_type.loc9_9.1 => constants.%i32.builtin
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.956
|
||||
// CHECK:STDOUT: %.loc9_37.1 => constants.%.9cb
|
||||
// CHECK:STDOUT: %.loc9_31.1 => constants.%.9cb
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @As(constants.%i32.builtin) {
|
||||
@@ -640,7 +641,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.type => constants.%As.WithSelf.Convert.type.d9c
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert => constants.%As.WithSelf.Convert.140
|
||||
// CHECK:STDOUT: %As.assoc_type => constants.%As.assoc_type.7f2
|
||||
// CHECK:STDOUT: %assoc0.loc13_32.2 => constants.%assoc0.402
|
||||
// CHECK:STDOUT: %assoc0.loc13_24.2 => constants.%assoc0.402
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @As.WithSelf(constants.%i32.builtin, constants.%As.facet) {
|
||||
@@ -651,17 +652,17 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.type => constants.%As.WithSelf.Convert.type.e08
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert => constants.%As.WithSelf.Convert.5a5
|
||||
// CHECK:STDOUT: %As.assoc_type => constants.%As.assoc_type.7f2
|
||||
// CHECK:STDOUT: %assoc0.loc13_32.2 => constants.%assoc0.402
|
||||
// CHECK:STDOUT: %assoc0.loc13_24.2 => constants.%assoc0.402
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @As.WithSelf.Convert(constants.%i32.builtin, constants.%As.facet) {
|
||||
// CHECK:STDOUT: %T => constants.%i32.builtin
|
||||
// CHECK:STDOUT: %As.type => constants.%As.type.dfb
|
||||
// CHECK:STDOUT: %Self => constants.%As.facet
|
||||
// CHECK:STDOUT: %Self.as_type.loc13_20.1 => Core.IntLiteral
|
||||
// CHECK:STDOUT: %pattern_type.loc13_18 => constants.%pattern_type.dc0
|
||||
// CHECK:STDOUT: %.loc13_31.1 => constants.%.9cb
|
||||
// CHECK:STDOUT: %pattern_type.loc13_31 => constants.%pattern_type.956
|
||||
// CHECK:STDOUT: %Self.as_type.loc13_14.1 => Core.IntLiteral
|
||||
// CHECK:STDOUT: %pattern_type.loc13_14 => constants.%pattern_type.dc0
|
||||
// CHECK:STDOUT: %.loc13_23.1 => constants.%.9cb
|
||||
// CHECK:STDOUT: %pattern_type.loc13_23 => constants.%pattern_type.956
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) {
|
||||
@@ -680,7 +681,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type => constants.%ImplicitAs.WithSelf.Convert.type.247
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert => constants.%ImplicitAs.WithSelf.Convert.e9a
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.081
|
||||
// CHECK:STDOUT: %assoc0.loc17_32.2 => constants.%assoc0.0d1
|
||||
// CHECK:STDOUT: %assoc0.loc17_24.2 => constants.%assoc0.0d1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs.WithSelf(constants.%i32.builtin, constants.%ImplicitAs.facet.18f) {
|
||||
@@ -691,17 +692,17 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type => constants.%ImplicitAs.WithSelf.Convert.type.20b
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert => constants.%ImplicitAs.WithSelf.Convert.b9f
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.081
|
||||
// CHECK:STDOUT: %assoc0.loc17_32.2 => constants.%assoc0.0d1
|
||||
// CHECK:STDOUT: %assoc0.loc17_24.2 => constants.%assoc0.0d1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs.WithSelf.Convert(constants.%i32.builtin, constants.%ImplicitAs.facet.18f) {
|
||||
// CHECK:STDOUT: %T => constants.%i32.builtin
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.9df
|
||||
// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.18f
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_20.1 => Core.IntLiteral
|
||||
// CHECK:STDOUT: %pattern_type.loc17_18 => constants.%pattern_type.dc0
|
||||
// CHECK:STDOUT: %.loc17_31.1 => constants.%.9cb
|
||||
// CHECK:STDOUT: %pattern_type.loc17_31 => constants.%pattern_type.956
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_14.1 => Core.IntLiteral
|
||||
// CHECK:STDOUT: %pattern_type.loc17_14 => constants.%pattern_type.dc0
|
||||
// CHECK:STDOUT: %.loc17_23.1 => constants.%.9cb
|
||||
// CHECK:STDOUT: %pattern_type.loc17_23 => constants.%pattern_type.956
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
|
||||
@@ -720,7 +721,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type => constants.%ImplicitAs.WithSelf.Convert.type.46f
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert => constants.%ImplicitAs.WithSelf.Convert.a78
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.e73
|
||||
// CHECK:STDOUT: %assoc0.loc17_32.2 => constants.%assoc0.a37
|
||||
// CHECK:STDOUT: %assoc0.loc17_24.2 => constants.%assoc0.a37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs.WithSelf(Core.IntLiteral, constants.%ImplicitAs.facet.776) {
|
||||
@@ -731,17 +732,17 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type => constants.%ImplicitAs.WithSelf.Convert.type.dc2
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert => constants.%ImplicitAs.WithSelf.Convert.c73
|
||||
// CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.e73
|
||||
// CHECK:STDOUT: %assoc0.loc17_32.2 => constants.%assoc0.a37
|
||||
// CHECK:STDOUT: %assoc0.loc17_24.2 => constants.%assoc0.a37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs.WithSelf.Convert(Core.IntLiteral, constants.%ImplicitAs.facet.776) {
|
||||
// CHECK:STDOUT: %T => Core.IntLiteral
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7cb
|
||||
// CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.776
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_20.1 => constants.%i32.builtin
|
||||
// CHECK:STDOUT: %pattern_type.loc17_18 => constants.%pattern_type.956
|
||||
// CHECK:STDOUT: %.loc17_31.1 => constants.%.f7d
|
||||
// CHECK:STDOUT: %pattern_type.loc17_31 => constants.%pattern_type.dc0
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_14.1 => constants.%i32.builtin
|
||||
// CHECK:STDOUT: %pattern_type.loc17_14 => constants.%pattern_type.956
|
||||
// CHECK:STDOUT: %.loc17_23.1 => constants.%.f7d
|
||||
// CHECK:STDOUT: %pattern_type.loc17_23 => constants.%pattern_type.dc0
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- user.carbon
|
||||
|
||||
+30
-29
@@ -13,15 +13,16 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/method.carbon
|
||||
|
||||
interface I {
|
||||
fn F[self: Self](other: Self) -> Self;
|
||||
fn F(self, other: Self) -> Self;
|
||||
}
|
||||
|
||||
impl i32 as I {
|
||||
fn F[self: i32](other: i32) -> i32 = "int.sadd";
|
||||
fn F(self: i32, other: i32) -> i32 = "int.sadd";
|
||||
}
|
||||
|
||||
var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- method.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -198,28 +199,28 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT: %other.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type.c60) = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %other.patt: @I.WithSelf.F.%pattern_type (%pattern_type.c60) = at_binding_pattern other, %other.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type.c60) = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @I.WithSelf.F.%pattern_type (%pattern_type.c60) = return_slot_pattern %return.param_patt, %.loc16_36.2 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @I.WithSelf.F.%pattern_type (%pattern_type.c60) = return_slot_pattern %return.param_patt, %.loc16_30.2 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc16_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.37e)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_36: type = facet_access_type %Self.ref.loc16_36 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %.loc16_36.2: type = converted %Self.ref.loc16_36, %Self.as_type.loc16_36 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %.loc16_36.3: Core.Form = init_form %.loc16_36.2 [symbolic = %.loc16_36.1 (constants.%.8fc)]
|
||||
// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc16_14.1: type = splice_block %.loc16_14.2 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)] {
|
||||
// CHECK:STDOUT: %Self.ref.loc16_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.37e)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_14.2: type = facet_access_type %Self.ref.loc16_14 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %.loc16_14.2: type = converted %Self.ref.loc16_14, %Self.as_type.loc16_14.2 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %Self.ref.loc16_30: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.37e)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_30: type = facet_access_type %Self.ref.loc16_30 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %.loc16_30.2: type = converted %Self.ref.loc16_30, %Self.as_type.loc16_30 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %.loc16_30.3: Core.Form = init_form %.loc16_30.2 [symbolic = %.loc16_30.1 (constants.%.8fc)]
|
||||
// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc16_8.1: type = splice_block %.loc16_8.2 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)] {
|
||||
// CHECK:STDOUT: %Self.ref.loc16_8: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.37e)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_8.2: type = facet_access_type %Self.ref.loc16_8 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %.loc16_8.2: type = converted %Self.ref.loc16_8, %Self.as_type.loc16_8.2 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84) = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84) = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc16_27.1: type = splice_block %.loc16_27.2 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)] {
|
||||
// CHECK:STDOUT: %Self.ref.loc16_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.37e)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_27: type = facet_access_type %Self.ref.loc16_27 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %.loc16_27.2: type = converted %Self.ref.loc16_27, %Self.as_type.loc16_27 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84) = value_binding self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84) = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc16_21.1: type = splice_block %.loc16_21.2 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)] {
|
||||
// CHECK:STDOUT: %Self.ref.loc16_21: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.37e)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_21: type = facet_access_type %Self.ref.loc16_21 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %.loc16_21.2: type = converted %Self.ref.loc16_21, %Self.as_type.loc16_21 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %other: @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84) = value_binding other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84) = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84) = return_slot %return.param
|
||||
// CHECK:STDOUT: %other: @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84) = value_binding other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84) = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0.6c9]
|
||||
// CHECK:STDOUT:
|
||||
@@ -262,11 +263,11 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @I.WithSelf.F(@I.%Self: %I.type) {
|
||||
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.37e)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_14.1 [symbolic = %pattern_type (constants.%pattern_type.c60)]
|
||||
// CHECK:STDOUT: %.loc16_36.1: Core.Form = init_form %Self.as_type.loc16_14.1 [symbolic = %.loc16_36.1 (constants.%.8fc)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.c84)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_8.1 [symbolic = %pattern_type (constants.%pattern_type.c60)]
|
||||
// CHECK:STDOUT: %.loc16_30.1: Core.Form = init_form %Self.as_type.loc16_8.1 [symbolic = %.loc16_30.1 (constants.%.8fc)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84), %other.param: @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84)) -> out %return.param: @I.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.c84);
|
||||
// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84), %other.param: @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84)) -> out %return.param: @I.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.c84);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @i32.as.I.impl.F(%self.param: %i32, %other.param: %i32) -> out %return.param: %i32 = "int.sadd";
|
||||
@@ -293,9 +294,9 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self.37e) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self.37e
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_14.1 => constants.%Self.as_type.c84
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_8.1 => constants.%Self.as_type.c84
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.c60
|
||||
// CHECK:STDOUT: %.loc16_36.1 => constants.%.8fc
|
||||
// CHECK:STDOUT: %.loc16_30.1 => constants.%.8fc
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) {
|
||||
@@ -307,8 +308,8 @@ var arr: array(i32, (1 as i32).(I.F)(2));
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) {
|
||||
// CHECK:STDOUT: %Self => constants.%I.facet
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_14.1 => constants.%i32
|
||||
// CHECK:STDOUT: %Self.as_type.loc16_8.1 => constants.%i32
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6b6
|
||||
// CHECK:STDOUT: %.loc16_36.1 => constants.%.795
|
||||
// CHECK:STDOUT: %.loc16_30.1 => constants.%.795
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/fail_explicit_self_param.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_explicit_self_param.carbon
|
||||
|
||||
// CHECK:STDERR: fail_explicit_self_param.carbon:[[@LINE+4]]:6: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList]
|
||||
// CHECK:STDERR: fn F(self: ());
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F(self: ());
|
||||
|
||||
fn Run() {
|
||||
F(());
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- fail_explicit_self_param.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete]
|
||||
// CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .Run = %Run.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc19_13.1: type = splice_block %.loc19_13.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc19_13.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc19_13.3: type = converted %.loc19_13.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: }
|
||||
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [concrete = constants.%Run] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%self.param: %empty_tuple.type);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Run() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc22_6.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc22_6.2: %empty_tuple.type = converted %.loc22_6.1, %empty_tuple [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc22_6.2)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -12,7 +12,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon
|
||||
|
||||
// CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+4]]:6: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+4]]:6: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fn F[s: ()]();
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
class C {
|
||||
fn F[ref self: Self]();
|
||||
fn F(ref self);
|
||||
}
|
||||
|
||||
fn G() {
|
||||
|
||||
@@ -63,10 +63,10 @@ class C {
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: error: `extern` not allowed; requires file or namespace scope [ModifierExternNotAllowed]
|
||||
// CHECK:STDERR: extern fn G[self: Self]();
|
||||
// CHECK:STDERR: extern fn G(self);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
extern fn G[self: Self]();
|
||||
extern fn G(self);
|
||||
}
|
||||
|
||||
// --- fail_extern_library_in_importer.carbon
|
||||
|
||||
@@ -56,7 +56,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+8]]:8: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+8]]:8: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fn Foo[a: C];
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -65,7 +65,7 @@ class C {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn Foo[a: C];
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+8]]:8: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+8]]:8: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fn Foo[a: (C)] {}
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
|
||||
+15
-12
@@ -70,6 +70,7 @@ fn CallSpecific(x: C*) -> C* {
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- explicit.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -170,16 +171,17 @@ fn CallSpecific(x: C*) -> C* {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc5_31.1 [symbolic = %require_complete (constants.%require_complete.d83)]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc5_14.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)]
|
||||
// CHECK:STDOUT: %.loc6: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc5_14.1 [symbolic = %.loc6 (constants.%.c29)]
|
||||
// CHECK:STDOUT: %.loc6_10.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc5_14.1 [symbolic = %.loc6_10.2 (constants.%.c29)]
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc5_14.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2: @Function.%.loc6 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.bd2)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2: @Function.%.loc6_10.2 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.bd2)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2: <specific function> = specific_impl_function %impl.elem0.loc6_10.2, @Copy.WithSelf.Op(%T.loc5_14.1) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.e2a)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @Function.%T.as_type.loc5_31.1 (%T.as_type)) -> out %return.param: @Function.%T.as_type.loc5_31.1 (%T.as_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @Function.%T.as_type.loc5_31.1 (%T.as_type) = name_ref x, %x
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.1: @Function.%.loc6 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.bd2)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.1: @Function.%.loc6_10.2 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.bd2)]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %x.ref, %impl.elem0.loc6_10.1
|
||||
// CHECK:STDOUT: %.loc6_10.1: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T.loc5_14.1 (constants.%T.f84)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.1: <specific function> = specific_impl_function %impl.elem0.loc6_10.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.e2a)]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %x.ref, %specific_impl_fn.loc6_10.1
|
||||
// CHECK:STDOUT: %.loc5_37.1: ref @Function.%T.as_type.loc5_31.1 (%T.as_type) = splice_block %return.param {}
|
||||
@@ -258,7 +260,7 @@ fn CallSpecific(x: C*) -> C* {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.d83
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.c85f21.2
|
||||
// CHECK:STDOUT: %.loc6 => constants.%.c29
|
||||
// CHECK:STDOUT: %.loc6_10.2 => constants.%.c29
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.d9c
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%impl.elem0.bd2
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%specific_impl_fn.e2a
|
||||
@@ -287,7 +289,7 @@ fn CallSpecific(x: C*) -> C* {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.ef1
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.884
|
||||
// CHECK:STDOUT: %.loc6 => constants.%.be5
|
||||
// CHECK:STDOUT: %.loc6_10.2 => constants.%.be5
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.1da
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%impl.elem0.484
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%specific_impl_fn.a76
|
||||
@@ -302,7 +304,7 @@ fn CallSpecific(x: C*) -> C* {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.bf9
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.c6a
|
||||
// CHECK:STDOUT: %.loc6 => constants.%.a68
|
||||
// CHECK:STDOUT: %.loc6_10.2 => constants.%.a68
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.65f
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%ptr.as.Copy.impl.Op.c19
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%ptr.as.Copy.impl.Op.specific_fn
|
||||
@@ -408,16 +410,17 @@ fn CallSpecific(x: C*) -> C* {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc5_31.1 [symbolic = %require_complete (constants.%require_complete.d83)]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc5_14.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)]
|
||||
// CHECK:STDOUT: %.loc6: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc5_14.1 [symbolic = %.loc6 (constants.%.c29)]
|
||||
// CHECK:STDOUT: %.loc6_10.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc5_14.1 [symbolic = %.loc6_10.2 (constants.%.c29)]
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc5_14.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2: @Function.%.loc6 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.bd2)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2: @Function.%.loc6_10.2 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.bd2)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2: <specific function> = specific_impl_function %impl.elem0.loc6_10.2, @Copy.WithSelf.Op(%T.loc5_14.1) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.e2a)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @Function.%T.as_type.loc5_31.1 (%T.as_type)) -> out %return.param: @Function.%T.as_type.loc5_31.1 (%T.as_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref: @Function.%T.as_type.loc5_31.1 (%T.as_type) = name_ref x, %x
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.1: @Function.%.loc6 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.bd2)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.1: @Function.%.loc6_10.2 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.bd2)]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %x.ref, %impl.elem0.loc6_10.1
|
||||
// CHECK:STDOUT: %.loc6_10.1: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T.loc5_14.1 (constants.%T.f84)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.1: <specific function> = specific_impl_function %impl.elem0.loc6_10.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.e2a)]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %x.ref, %specific_impl_fn.loc6_10.1
|
||||
// CHECK:STDOUT: %.loc5_37.1: ref @Function.%T.as_type.loc5_31.1 (%T.as_type) = splice_block %return.param {}
|
||||
@@ -487,7 +490,7 @@ fn CallSpecific(x: C*) -> C* {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.d83
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.c85f21.2
|
||||
// CHECK:STDOUT: %.loc6 => constants.%.c29
|
||||
// CHECK:STDOUT: %.loc6_10.2 => constants.%.c29
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.d9c
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%impl.elem0.bd2
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%specific_impl_fn.e2a
|
||||
@@ -516,7 +519,7 @@ fn CallSpecific(x: C*) -> C* {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.ef1
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.884
|
||||
// CHECK:STDOUT: %.loc6 => constants.%.be5
|
||||
// CHECK:STDOUT: %.loc6_10.2 => constants.%.be5
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.1da
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%impl.elem0.484
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%specific_impl_fn.a76
|
||||
@@ -531,7 +534,7 @@ fn CallSpecific(x: C*) -> C* {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.bf9
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.c6a
|
||||
// CHECK:STDOUT: %.loc6 => constants.%.a68
|
||||
// CHECK:STDOUT: %.loc6_10.2 => constants.%.a68
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.65f
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%ptr.as.Copy.impl.Op.c19
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%ptr.as.Copy.impl.Op.specific_fn
|
||||
|
||||
@@ -20,6 +20,7 @@ fn F(T:! type, p: T**) -> T* {
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- pointer_to_pointer.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -44,21 +45,23 @@ fn F(T:! type, p: T**) -> T* {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc6_10.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc4_7.1) [symbolic = %.loc6_10.3 (constants.%.0e9)]
|
||||
// CHECK:STDOUT: %.loc6_10.4: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc4_7.1) [symbolic = %.loc6_10.4 (constants.%.0e9)]
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %ptr.loc4_20.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)]
|
||||
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc4_20.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)]
|
||||
// CHECK:STDOUT: %.loc6_10.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc6_10.4 (constants.%.be5)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2: @F.%.loc6_10.4 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2: <specific function> = specific_impl_function %impl.elem0.loc6_10.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.a76)]
|
||||
// CHECK:STDOUT: %Copy.facet.loc6_10.2: %Copy.type = facet_value %ptr.loc4_20.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc6_10.2 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc6_10.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)]
|
||||
// CHECK:STDOUT: %.loc6_10.5: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc6_10.2 [symbolic = %.loc6_10.5 (constants.%.be5)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.2: @F.%.loc6_10.5 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.2: <specific function> = specific_impl_function %impl.elem0.loc6_10.2, @Copy.WithSelf.Op(%Copy.facet.loc6_10.2) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.a76)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%p.param: @F.%ptr.loc4_21.1 (%ptr.125)) -> out %return.param: @F.%ptr.loc4_20.1 (%ptr.e8f) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %p.ref: @F.%ptr.loc4_21.1 (%ptr.125) = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc6_10.1: ref @F.%ptr.loc4_20.1 (%ptr.e8f) = deref %p.ref
|
||||
// CHECK:STDOUT: %.loc6_10.2: @F.%ptr.loc4_20.1 (%ptr.e8f) = acquire_value %.loc6_10.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.1: @F.%.loc6_10.4 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_10.1: @F.%.loc6_10.5 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %.loc6_10.2, %impl.elem0.loc6_10.1
|
||||
// CHECK:STDOUT: %Copy.facet.loc6_10.1: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.1da) [symbolic = %Copy.facet.loc6_10.2 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %.loc6_10.3: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc6_10.1 [symbolic = %Copy.facet.loc6_10.2 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc6_10.1: <specific function> = specific_impl_function %impl.elem0.loc6_10.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.a76)]
|
||||
// CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %.loc6_10.2, %specific_impl_fn.loc6_10.1
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @F.%ptr.loc4_20.1 (%ptr.e8f) = call %bound_method.loc6_10.2(%.loc6_10.2)
|
||||
|
||||
@@ -38,6 +38,7 @@ fn CallNegative() {
|
||||
ErrorIfNIsZero(0);
|
||||
}
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- fail_todo_call_monomorphization_error.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -145,11 +146,11 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_28.2: @ErrorIfNIsZero.%.loc9_28.4 (%.b74) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_28.2 (constants.%impl.elem0.b17)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc9_28.2: <specific function> = specific_impl_function %impl.elem0.loc9_28.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc9_28.2) [symbolic = %specific_impl_fn.loc9_28.2 (constants.%specific_impl_fn.cf5)]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %Int.loc9_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.173)]
|
||||
// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc9_27.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.7bb)]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.8f1)]
|
||||
// CHECK:STDOUT: %.loc9_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc9_3 (constants.%.2c6)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_3.2: @ErrorIfNIsZero.%.loc9_3 (%.2c6) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_3.2 (constants.%impl.elem0.604)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc9_3.2: <specific function> = specific_impl_function %impl.elem0.loc9_3.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc9_3.2 (constants.%specific_impl_fn.693)]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc9_3.2: %Destroy.type = facet_value %Int.loc9_27.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc9_3.2 (constants.%Destroy.facet.7bb)]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc9_3.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.8f1)]
|
||||
// CHECK:STDOUT: %.loc9_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc9_3.2 [symbolic = %.loc9_3.2 (constants.%.2c6)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_3.2: @ErrorIfNIsZero.%.loc9_3.2 (%.2c6) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_3.2 (constants.%impl.elem0.604)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc9_3.2: <specific function> = specific_impl_function %impl.elem0.loc9_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc9_3.2) [symbolic = %specific_impl_fn.loc9_3.2 (constants.%specific_impl_fn.693)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
@@ -173,8 +174,10 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %Int.loc9_27.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc9_27.2 (constants.%Int)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc9_27.2 (%Int) = ref_binding v, %v.var
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_3.1: @ErrorIfNIsZero.%.loc9_3 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc9_3.2 (constants.%impl.elem0.604)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_3.1: @ErrorIfNIsZero.%.loc9_3.2 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc9_3.2 (constants.%impl.elem0.604)]
|
||||
// CHECK:STDOUT: %bound_method.loc9_3.1: <bound method> = bound_method %v.var, %impl.elem0.loc9_3.1
|
||||
// CHECK:STDOUT: %Destroy.facet.loc9_3.1: %Destroy.type = facet_value constants.%Int, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc9_3.2 (constants.%Destroy.facet.7bb)]
|
||||
// CHECK:STDOUT: %.loc9_3.1: %Destroy.type = converted constants.%Int, %Destroy.facet.loc9_3.1 [symbolic = %Destroy.facet.loc9_3.2 (constants.%Destroy.facet.7bb)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc9_3.1: <specific function> = specific_impl_function %impl.elem0.loc9_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc9_3.2 (constants.%specific_impl_fn.693)]
|
||||
// CHECK:STDOUT: %bound_method.loc9_3.2: <bound method> = bound_method %v.var, %specific_impl_fn.loc9_3.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc9_3.2(%v.var)
|
||||
@@ -215,9 +218,9 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_28.2 => constants.%T.as.DefaultOrUnformed.impl.Op.38a
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc9_28.2 => constants.%T.as.DefaultOrUnformed.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9
|
||||
// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.85b
|
||||
// CHECK:STDOUT: %Destroy.facet.loc9_3.2 => constants.%Destroy.facet.85b
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b7e
|
||||
// CHECK:STDOUT: %.loc9_3 => constants.%.338
|
||||
// CHECK:STDOUT: %.loc9_3.2 => constants.%.338
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_3.2 => constants.%Destroy.Op
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc9_3.2 => constants.%Destroy.Op
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -17,6 +17,7 @@ fn F(T:! type) {
|
||||
let unused n: T = *p;
|
||||
}
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- type_param.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -94,11 +95,11 @@ fn F(T:! type) {
|
||||
// CHECK:STDOUT: %require_complete.loc17: <witness> = require_complete_type %T.loc15_7.1 [symbolic = %require_complete.loc17 (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %pattern_type.loc17: type = pattern_type %T.loc15_7.1 [symbolic = %pattern_type.loc17 (constants.%pattern_type.51d)]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %ptr.loc16_11.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)]
|
||||
// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.loc16_11.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet)]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.8a4)]
|
||||
// CHECK:STDOUT: %.loc16_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc16_3 (constants.%.9f8)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc16_3.2: @F.%.loc16_3 (%.9f8) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_3.2 (constants.%impl.elem0.258)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc16_3.2: <specific function> = specific_impl_function %impl.elem0.loc16_3.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn.192)]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value %ptr.loc16_11.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc16_3.2 (constants.%Destroy.facet)]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc16_3.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.8a4)]
|
||||
// CHECK:STDOUT: %.loc16_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc16_3.2 [symbolic = %.loc16_3.2 (constants.%.9f8)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc16_3.2: @F.%.loc16_3.2 (%.9f8) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_3.2 (constants.%impl.elem0.258)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc16_3.2: <specific function> = specific_impl_function %impl.elem0.loc16_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc16_3.2) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn.192)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
@@ -129,8 +130,10 @@ fn F(T:! type) {
|
||||
// CHECK:STDOUT: %T.ref.loc17: type = name_ref T, %T.loc15_7.2 [symbolic = %T.loc15_7.1 (constants.%T.67d)]
|
||||
// CHECK:STDOUT: %.loc17_21.2: @F.%T.loc15_7.1 (%T.67d) = acquire_value %.loc17_21.1
|
||||
// CHECK:STDOUT: %n: @F.%T.loc15_7.1 (%T.67d) = value_binding n, %.loc17_21.2
|
||||
// CHECK:STDOUT: %impl.elem0.loc16_3.1: @F.%.loc16_3 (%.9f8) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_3.2 (constants.%impl.elem0.258)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc16_3.1: @F.%.loc16_3.2 (%.9f8) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_3.2 (constants.%impl.elem0.258)]
|
||||
// CHECK:STDOUT: %bound_method.loc16_3.1: <bound method> = bound_method %p.var, %impl.elem0.loc16_3.1
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc16_3.2 (constants.%Destroy.facet)]
|
||||
// CHECK:STDOUT: %.loc16_3.1: %Destroy.type = converted constants.%ptr, %Destroy.facet.loc16_3.1 [symbolic = %Destroy.facet.loc16_3.2 (constants.%Destroy.facet)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc16_3.1: <specific function> = specific_impl_function %impl.elem0.loc16_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn.192)]
|
||||
// CHECK:STDOUT: %bound_method.loc16_3.2: <bound method> = bound_method %p.var, %specific_impl_fn.loc16_3.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc16_3.2(%p.var)
|
||||
|
||||
@@ -21,6 +21,7 @@ fn F(T:! type, n: T*) -> T* {
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- local_let.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -43,13 +44,13 @@ fn F(T:! type, n: T*) -> T* {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc7_10.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc4_7.1) [symbolic = %.loc7_10.1 (constants.%.0e9)]
|
||||
// CHECK:STDOUT: %.loc7_10.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc4_7.1) [symbolic = %.loc7_10.2 (constants.%.0e9)]
|
||||
// CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %ptr.loc4_20.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)]
|
||||
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc4_20.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)]
|
||||
// CHECK:STDOUT: %.loc7_10.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc7_10.2 (constants.%.be5)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_10.2: @F.%.loc7_10.2 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_10.2: <specific function> = specific_impl_function %impl.elem0.loc7_10.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc7_10.2 (constants.%specific_impl_fn.a76)]
|
||||
// CHECK:STDOUT: %Copy.facet.loc7_10.2: %Copy.type = facet_value %ptr.loc4_20.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc7_10.2 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc7_10.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)]
|
||||
// CHECK:STDOUT: %.loc7_10.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc7_10.2 [symbolic = %.loc7_10.3 (constants.%.be5)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_10.2: @F.%.loc7_10.3 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_10.2: <specific function> = specific_impl_function %impl.elem0.loc7_10.2, @Copy.WithSelf.Op(%Copy.facet.loc7_10.2) [symbolic = %specific_impl_fn.loc7_10.2 (constants.%specific_impl_fn.a76)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%n.param: @F.%ptr.loc4_20.1 (%ptr)) -> out %return.param: @F.%ptr.loc4_20.1 (%ptr) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
@@ -63,8 +64,10 @@ fn F(T:! type, n: T*) -> T* {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %m: @F.%ptr.loc4_20.1 (%ptr) = value_binding m, %n.ref
|
||||
// CHECK:STDOUT: %m.ref: @F.%ptr.loc4_20.1 (%ptr) = name_ref m, %m
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_10.1: @F.%.loc7_10.2 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc7_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_10.1: @F.%.loc7_10.3 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc7_10.2 (constants.%impl.elem0.484)]
|
||||
// CHECK:STDOUT: %bound_method.loc7_10.1: <bound method> = bound_method %m.ref, %impl.elem0.loc7_10.1
|
||||
// CHECK:STDOUT: %Copy.facet.loc7_10.1: %Copy.type = facet_value constants.%ptr, (constants.%Copy.lookup_impl_witness.1da) [symbolic = %Copy.facet.loc7_10.2 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %.loc7_10.1: %Copy.type = converted constants.%ptr, %Copy.facet.loc7_10.1 [symbolic = %Copy.facet.loc7_10.2 (constants.%Copy.facet)]
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc7_10.1: <specific function> = specific_impl_function %impl.elem0.loc7_10.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc7_10.2 (constants.%specific_impl_fn.a76)]
|
||||
// CHECK:STDOUT: %bound_method.loc7_10.2: <bound method> = bound_method %m.ref, %specific_impl_fn.loc7_10.1
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @F.%ptr.loc4_20.1 (%ptr) = call %bound_method.loc7_10.2(%m.ref)
|
||||
|
||||
Reference in New Issue
Block a user