From 7871237c1503a7668483a1dd9d2b82f2c598063f Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 10 Jun 2026 08:30:43 -0700 Subject: [PATCH] Move `self` to the explicit `()` parameter list (proposal #7016) (#7272) 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> --- bazel-execroot | 1 - core/prelude/copy.carbon | 24 +- core/prelude/destroy.carbon | 4 +- core/prelude/iterate.carbon | 16 +- core/prelude/operators/arithmetic.carbon | 38 +- core/prelude/operators/as.carbon | 26 +- core/prelude/operators/bitwise.carbon | 36 +- core/prelude/operators/comparison.carbon | 28 +- core/prelude/operators/deref.carbon | 2 +- core/prelude/operators/index.carbon | 2 +- core/prelude/types/char.carbon | 58 +- core/prelude/types/cpp/int.carbon | 296 ++++---- core/prelude/types/cpp/nullptr.carbon | 4 +- core/prelude/types/cpp/void.carbon | 4 +- core/prelude/types/float.carbon | 74 +- core/prelude/types/int.carbon | 144 ++-- core/prelude/types/optional.carbon | 26 +- core/prelude/types/string.carbon | 6 +- core/prelude/types/uint.carbon | 172 ++--- core/range.carbon | 4 +- docs/design/assignment.md | 2 +- docs/design/generics/details.md | 4 +- examples/advent2024/day10_part1.carbon | 4 +- examples/advent2024/day10_part2.carbon | 2 +- examples/advent2024/day11_part2.carbon | 2 +- examples/advent2024/day12_common.carbon | 12 +- examples/advent2024/day13_common.carbon | 4 +- examples/advent2024/day14_common.carbon | 4 +- examples/advent2024/day15_common.carbon | 12 +- examples/advent2024/day2_part1.carbon | 2 +- examples/advent2024/day2_part2.carbon | 8 +- examples/advent2024/day4_common.carbon | 6 +- examples/advent2024/day5_common.carbon | 12 +- examples/advent2024/day6_common.carbon | 8 +- examples/advent2024/day6_part2.carbon | 2 +- examples/advent2024/day7_common.carbon | 4 +- examples/advent2024/day9_common.carbon | 10 +- examples/advent2024/io_utils.carbon | 18 +- examples/advent2024/sort.carbon | 16 +- examples/re2_playground/re2_playground.carbon | 4 +- examples/sieve.carbon | 2 +- third_party/examples/re2/re2.carbon | 122 +-- toolchain/benchmarking/source_gen.cpp | 22 +- toolchain/check/call.cpp | 16 +- toolchain/check/convert.cpp | 25 +- toolchain/check/convert.h | 3 +- toolchain/check/cpp/export.cpp | 27 +- toolchain/check/cpp/import.cpp | 46 +- toolchain/check/cpp/operators.cpp | 2 +- toolchain/check/deduce.cpp | 26 +- toolchain/check/function.cpp | 58 +- toolchain/check/function.h | 14 +- toolchain/check/handle_binding_pattern.cpp | 85 ++- toolchain/check/handle_function.cpp | 22 +- toolchain/check/member_access.cpp | 2 +- toolchain/check/merge.cpp | 12 +- toolchain/check/pattern_match.cpp | 36 +- toolchain/check/pattern_match.h | 4 +- .../array/init_dependent_bound.carbon | 19 +- toolchain/check/testdata/as/basics.carbon | 4 +- toolchain/check/testdata/as/var_init.carbon | 2 +- .../testdata/basics/include_in_dumps.carbon | 41 +- .../check/testdata/basics/multi_error.carbon | 4 +- .../basics/raw_sem_ir/one_file.carbon | 398 +++++----- .../class/access/access_modifers.carbon | 4 +- .../class/access/inheritance_access.carbon | 33 +- .../class/access/method_access.carbon | 2 +- .../class/adapter/extend_adapt.carbon | 8 +- .../class/adapter/fail_adapt_with_base.carbon | 6 +- .../check/testdata/class/destroy_calls.carbon | 19 +- .../testdata/class/fail_error_recovery.carbon | 2 +- .../class/fail_memaccess_category.carbon | 6 +- .../testdata/class/fail_modifiers.carbon | 18 +- .../check/testdata/class/generic/basic.carbon | 144 ++-- .../check/testdata/class/generic/field.carbon | 15 +- .../check/testdata/class/generic/init.carbon | 40 +- .../class/generic/member_access.carbon | 100 +-- .../class/generic/member_inline.carbon | 71 +- .../class/generic/member_lookup.carbon | 15 +- .../class/generic/member_out_of_line.carbon | 143 ++-- .../testdata/class/generic/member_type.carbon | 170 ++--- .../class/generic/method_deduce.carbon | 235 +++++- .../check/testdata/class/generic/self.carbon | 23 +- toolchain/check/testdata/class/import.carbon | 13 +- .../testdata/class/incomplete_ref.carbon | 2 +- .../class/inheritance/base_method.carbon | 4 +- .../inheritance/base_method_qualified.carbon | 8 +- .../inheritance/base_method_shadow.carbon | 6 +- .../class/inheritance/import_base.carbon | 9 +- .../class/inheritance/self_conversion.carbon | 8 +- .../method/call_without_method_syntax.carbon | 255 +++++++ .../fail_call_without_method_syntax.carbon | 60 ++ .../class/method/fail_generic_method.carbon | 18 +- .../testdata/class/method/fail_method.carbon | 25 +- .../class/method/fail_method_modifiers.carbon | 20 +- .../class/method/generic_method.carbon | 45 +- .../check/testdata/class/method/method.carbon | 6 +- .../testdata/class/method/virtual.carbon | 501 ++++++------ .../check/testdata/class/redeclaration.carbon | 16 +- .../testdata/class/self/fail_ref_self.carbon | 6 +- .../testdata/class/self/fail_self.carbon | 232 +++++- .../class/self/fail_self_param.carbon | 28 + .../check/testdata/class/self/raw_self.carbon | 113 +-- .../check/testdata/class/self/self.carbon | 316 ++++++-- .../testdata/class/self/self_type.carbon | 4 +- .../testdata/class/syntactic_merge.carbon | 12 +- toolchain/check/testdata/const/basics.carbon | 11 +- .../testdata/deduce/binding_pattern.carbon | 21 +- .../check/testdata/deduce/conversion.carbon | 11 +- .../value_with_type_through_access.carbon | 29 +- .../check/testdata/eval/aggregates.carbon | 57 +- toolchain/check/testdata/facet/access.carbon | 15 +- toolchain/check/testdata/facet/combine.carbon | 4 +- ...uction_uses_runtime_type_conversion.carbon | 13 +- .../check/testdata/facet/period_self.carbon | 2 +- toolchain/check/testdata/for/actual.carbon | 349 +++++---- toolchain/check/testdata/for/basic.carbon | 11 +- toolchain/check/testdata/for/pattern.carbon | 29 +- .../builtin/call_from_operator.carbon | 233 +++--- .../testdata/function/builtin/method.carbon | 59 +- .../call/fail_explicit_self_param.carbon | 67 -- .../call/fail_runtime_implicit_param.carbon | 2 +- .../check/testdata/function/call/ref.carbon | 2 +- .../function/declaration/extern.carbon | 4 +- .../definition/syntactic_merge.carbon | 4 +- .../testdata/function/generic/call.carbon | 27 +- .../generic/indirect_generic_type.carbon | 17 +- .../function/generic/resolve_used.carbon | 19 +- .../function/generic/type_param.carbon | 15 +- .../function/generic/type_param_scope.carbon | 17 +- .../testdata/generic/call_basic_depth.carbon | 5 +- .../testdata/generic/dependent_param.carbon | 10 +- .../testdata/generic/template/convert.carbon | 15 +- .../generic/template/unimplemented.carbon | 14 +- .../generic/template_dependence.carbon | 17 +- .../check/testdata/generic/var_param.carbon | 4 +- .../testdata/impl/assoc_const_self.carbon | 13 +- toolchain/check/testdata/impl/basic.carbon | 4 +- toolchain/check/testdata/impl/compound.carbon | 97 +-- .../check/testdata/impl/error_recovery.carbon | 2 +- .../check/testdata/impl/eval_musteval.carbon | 74 +- .../testdata/impl/extend_impl_generic.carbon | 81 +- .../testdata/impl/fail_call_invalid.carbon | 47 +- .../testdata/impl/fail_impl_as_scope.carbon | 47 +- .../impl/fail_impl_bad_assoc_fn.carbon | 138 ++-- .../check/testdata/impl/impl_thunk.carbon | 99 +-- .../impl/impl_thunk_min_prelude.carbon | 22 +- .../testdata/impl/import_builtin_call.carbon | 9 +- .../impl/import_canonical_witnesses.carbon | 10 +- .../testdata/impl/import_compound.carbon | 35 +- .../impl/import_impl_with_no_interface.carbon | 4 +- .../check/testdata/impl/import_self.carbon | 85 +-- .../check/testdata/impl/import_thunk.carbon | 23 +- .../check/testdata/impl/interface_args.carbon | 185 ++--- .../impl/lookup/canonical_query_self.carbon | 53 +- .../check/testdata/impl/lookup/generic.carbon | 271 +++---- .../testdata/impl/lookup/impl_forall.carbon | 87 +-- .../check/testdata/impl/lookup/import.carbon | 185 ++--- .../impl/lookup/instance_method.carbon | 27 +- .../impl/lookup/specialization_poison.carbon | 24 +- ...pecialization_with_symbolic_rewrite.carbon | 49 +- .../testdata/impl/lookup/specific_args.carbon | 57 +- .../testdata/impl/lookup/transitive.carbon | 31 +- .../testdata/impl/self_in_signature.carbon | 83 +- .../testdata/impl/use_assoc_entity.carbon | 187 ++--- .../impl/using_invalid_interface.carbon | 40 +- .../testdata/interface/as_type_of_type.carbon | 15 +- .../interface/compound_member_access.carbon | 143 ++-- .../testdata/interface/default_fn.carbon | 27 +- .../interface/fail_assoc_const_alias.carbon | 27 +- .../fail_assoc_fn_invalid_use.carbon | 21 +- .../testdata/interface/fail_duplicate.carbon | 21 +- .../testdata/interface/fail_modifiers.carbon | 44 +- ..._todo_define_default_fn_out_of_line.carbon | 153 ++-- .../interface/generic_default_fn.carbon | 4 +- .../testdata/interface/generic_method.carbon | 59 +- .../check/testdata/interface/local.carbon | 24 +- .../testdata/interface/member_lookup.carbon | 17 +- .../check/testdata/interface/self.carbon | 41 +- .../interop/cpp/class/export/base.carbon | 10 +- .../interop/cpp/class/export/method.carbon | 14 +- .../interop/cpp/class/import/abstract.carbon | 8 +- .../interop/cpp/class/import/access.carbon | 10 +- .../interop/cpp/class/import/dynamic.carbon | 2 +- .../cpp/operators/arithmetic_operators.carbon | 269 +++---- .../interop/cpp/operators/eq_with.carbon | 16 +- .../interop/cpp/operators/ordered_with.carbon | 28 +- .../long_and_long_long.llp64.carbon | 73 +- .../long_and_long_long.lp64.carbon | 73 +- .../testdata/interop/cpp/range_for.carbon | 712 +++++++++--------- .../cpp/template/non_type_param.carbon | 2 +- .../named_constraint/invalid_members.carbon | 4 +- .../testdata/operators/builtin/bit_and.carbon | 2 +- .../testdata/operators/overloaded/add.carbon | 4 +- .../overloaded/binary_op.carbon.tmpl | 4 +- .../operators/overloaded/bit_and.carbon | 4 +- .../overloaded/bit_complement.carbon | 2 +- .../operators/overloaded/bit_or.carbon | 4 +- .../operators/overloaded/bit_xor.carbon | 4 +- .../testdata/operators/overloaded/dec.carbon | 2 +- .../testdata/operators/overloaded/div.carbon | 4 +- .../testdata/operators/overloaded/eq.carbon | 8 +- .../overloaded/fail_assign_non_ref.carbon | 8 +- .../overloaded/fail_no_impl_for_arg.carbon | 4 +- .../operators/overloaded/implicit_as.carbon | 37 +- .../testdata/operators/overloaded/inc.carbon | 2 +- .../operators/overloaded/index.carbon | 73 +- .../overloaded/index_with_prelude.carbon | 19 +- .../operators/overloaded/left_shift.carbon | 4 +- .../testdata/operators/overloaded/mod.carbon | 4 +- .../testdata/operators/overloaded/mul.carbon | 4 +- .../operators/overloaded/negate.carbon | 2 +- .../operators/overloaded/ordered.carbon | 8 +- .../operators/overloaded/right_shift.carbon | 4 +- .../testdata/operators/overloaded/sub.carbon | 4 +- .../operators/overloaded/unary_op.carbon.tmpl | 2 +- .../overloaded/unary_stmt.carbon.tmpl | 2 +- .../testdata/packages/missing_prelude.carbon | 49 +- .../check/testdata/patterns/unused.carbon | 15 + toolchain/check/testdata/pointer/arrow.carbon | 2 +- .../testdata/pointer/nested_const.carbon | 3 + .../return/import_convert_function.carbon | 81 +- .../testdata/tuple/element_access.carbon | 14 +- .../check/testdata/var/initialization.carbon | 2 +- .../check/testdata/var/var_pattern.carbon | 16 +- .../testdata/where_expr/dot_self_impls.carbon | 8 +- toolchain/check/thunk.cpp | 7 +- toolchain/diagnostics/kind.def | 6 +- toolchain/docs/adding_features.md | 4 +- toolchain/docs/diagnostics.md | 8 +- toolchain/docs/lower.md | 4 +- .../compile/optimize/optimize_none.carbon | 2 +- .../compile/optimize/optimize_size.carbon | 2 +- toolchain/lex/token_kind.def | 3 +- toolchain/lower/testdata/array/field.carbon | 4 +- toolchain/lower/testdata/array/iterate.carbon | 16 +- .../builtins/method_vs_nonmethod.carbon | 2 +- toolchain/lower/testdata/class/adapt.carbon | 6 +- toolchain/lower/testdata/class/convert.carbon | 12 +- toolchain/lower/testdata/class/generic.carbon | 4 +- toolchain/lower/testdata/class/method.carbon | 4 +- toolchain/lower/testdata/class/self.carbon | 8 +- toolchain/lower/testdata/class/virtual.carbon | 48 +- toolchain/lower/testdata/for/bindings.carbon | 4 +- .../lower/testdata/for/break_continue.carbon | 6 +- toolchain/lower/testdata/for/for.carbon | 6 +- .../function/generic/call_basic.carbon | 8 +- .../function/generic/call_method.carbon | 2 +- .../generic/call_recursive_basic.carbon | 10 +- .../generic/call_specific_in_class.carbon | 2 +- .../function/generic/import_unused_def.carbon | 2 +- .../generic/type_representation.carbon | 12 +- .../lower/testdata/impl/assoc_fn_alias.carbon | 4 +- toolchain/lower/testdata/impl/impl.carbon | 22 +- toolchain/lower/testdata/impl/import.carbon | 4 +- .../lower/testdata/impl/import_facet.carbon | 6 +- .../lower/testdata/impl/import_thunk.carbon | 32 +- .../testdata/impl/instance_method.carbon | 4 +- .../lower/testdata/impl/period_self.carbon | 2 +- toolchain/lower/testdata/impl/thunk.carbon | 72 +- .../lower/testdata/interface/where.carbon | 4 +- .../interop/cpp/class/export/method.carbon | 8 +- .../interop/cpp/class/import/dynamic.carbon | 4 +- .../interop/cpp/class/virtual_fn.carbon | 4 +- .../lower/testdata/operators/increment.carbon | 2 +- .../testdata/operators/overloaded.carbon | 4 +- .../imported_type_completeness.carbon | 8 +- .../separate_compilation_witness.carbon | 4 +- .../lower/testdata/primitives/char.carbon | 6 +- .../testdata/primitives/int_types.carbon | 8 +- .../lower/testdata/primitives/optional.carbon | 34 +- toolchain/lower/testdata/var/param.carbon | 4 +- toolchain/parse/handle_binding_pattern.cpp | 17 +- toolchain/parse/handle_pattern.cpp | 3 + toolchain/parse/node_kind.def | 1 + .../testdata/class/fn_definitions.carbon | 32 +- .../parse/testdata/generics/impl/basic.carbon | 16 +- .../testdata/generics/interface/basic.carbon | 27 +- .../generics/interface/default_fn.carbon | 31 +- .../generics/interface/final_fn.carbon | 32 +- .../interface/final_member_definition.carbon | 20 +- .../generics/interface/self_ref.carbon | 27 +- .../named_constraint/invalid_method.carbon | 36 +- toolchain/parse/typed_nodes.h | 12 + toolchain/sem_ir/function.h | 4 +- .../testdata/min_prelude/parts/as.carbon | 10 +- .../testdata/min_prelude/parts/char.carbon | 2 +- .../testdata/min_prelude/parts/copy.carbon | 22 +- .../testdata/min_prelude/parts/destroy.carbon | 6 +- .../testdata/min_prelude/parts/float.carbon | 6 +- .../testdata/min_prelude/parts/int.carbon | 12 +- .../min_prelude/parts/int_literal.carbon | 4 +- .../testdata/min_prelude/parts/iterate.carbon | 4 +- .../min_prelude/parts/optional.carbon | 4 +- .../testdata/min_prelude/parts/uint.carbon | 12 +- utils/textmate/Samples/main.carbon | 4 +- 296 files changed, 6101 insertions(+), 4899 deletions(-) delete mode 120000 bazel-execroot create mode 100644 toolchain/check/testdata/class/method/call_without_method_syntax.carbon create mode 100644 toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon delete mode 100644 toolchain/check/testdata/function/call/fail_explicit_self_param.carbon diff --git a/bazel-execroot b/bazel-execroot deleted file mode 120000 index 880a28ea937b..000000000000 --- a/bazel-execroot +++ /dev/null @@ -1 +0,0 @@ -bazel-out/../../_main \ No newline at end of file diff --git a/core/prelude/copy.carbon b/core/prelude/copy.carbon index b5f32290508e..0223eb4ad402 100644 --- a/core/prelude/copy.carbon +++ b/core/prelude/copy.carbon @@ -7,7 +7,7 @@ package Core library "prelude/copy"; // Copying an object, which is a conversion from a value representation to an // initializing representation. interface Copy { - fn Op[self: Self]() -> Self; + fn Op(self) -> Self; } private fn MakeBool() -> type = "bool.make_type"; @@ -20,52 +20,52 @@ private fn MakeIntLiteral() -> type = "int_literal.make_type"; private alias IntLiteral = MakeIntLiteral(); impl forall [T:! Copy] const T as Copy { - fn Op[self: Self]() -> Self { return (self as T).(Copy.Op)() as const T; } + fn Op(self) -> Self { return (self as T).(Copy.Op)() as const T; } } impl Bool as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl CharLiteral as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl FloatLiteral as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl IntLiteral as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl type as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl forall [T:! type] T* as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } // TODO: Implement tuple copy as a variadic generic impl. impl () as Copy { - fn Op[self: Self]() -> Self = "no_op"; + fn Op(self) -> Self = "no_op"; } impl forall [T:! Copy] (T,) as Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return (self.0.Op(),); } } impl forall [T:! Copy, U:! Copy] (T, U) as Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return (self.0.Op(), self.1.Op()); } } impl forall [T:! Copy, U:! Copy, V:! Copy] (T, U, V) as Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return (self.0.Op(), self.1.Op(), self.2.Op()); } } diff --git a/core/prelude/destroy.carbon b/core/prelude/destroy.carbon index d06ea9577ab3..4682c90f0122 100644 --- a/core/prelude/destroy.carbon +++ b/core/prelude/destroy.carbon @@ -6,11 +6,11 @@ package Core library "prelude/destroy"; // TODO: Add `Destructor`, as in: // interface Destructor { -// private fn Op[ref self: Self](); +// private fn Op(ref self); // } // Destroys objects. This will invoke `Destructor` impls recursively on members; // it does not deallocate memory. interface Destroy { - fn Op[ref self: Self](); + fn Op(ref self); } diff --git a/core/prelude/iterate.carbon b/core/prelude/iterate.carbon index 00279388e7ee..6f33ab38545b 100644 --- a/core/prelude/iterate.carbon +++ b/core/prelude/iterate.carbon @@ -13,15 +13,15 @@ interface Iterate { // TODO: Support iterating ranges of non-copyable values. let ElementType:! Copy & Destroy; let CursorType:! Destroy; - fn NewCursor[self: Self]() -> CursorType; - fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); + fn NewCursor(self) -> CursorType; + fn Next(self, cursor: CursorType*) -> Optional(ElementType); } impl forall [T:! Copy & Destroy, N:! IntLiteral] array(T, N) as Iterate where .ElementType = T and .CursorType = i32 { - fn NewCursor[unused self: Self]() -> i32 { return 0; } - fn Next[self: Self](cursor: i32*) -> Optional(T) { + fn NewCursor(unused self) -> i32 { return 0; } + fn Next(self, cursor: i32*) -> Optional(T) { if (*cursor < N) { ++*cursor; return Optional(T).Some(self[*cursor - 1]); @@ -36,8 +36,8 @@ interface CppRangeForIterate { let Sentinel:! type; // TODO: self must be ref-qualified - fn Begin[self: Self]() -> Iterator; - fn End[self: Self]() -> Sentinel; + fn Begin(self) -> Iterator; + fn End(self) -> Sentinel; } impl forall [ @@ -53,11 +53,11 @@ impl forall [ { alias ElementType = R.Iterator.(CppUnsafeDeref.Result); - fn NewCursor[self: Self]() -> (R.Iterator, R.Sentinel) { + fn NewCursor(self) -> (R.Iterator, R.Sentinel) { return (self.Begin(), self.End()); } - fn Next[unused self: Self](cursor: (R.Iterator, R.Sentinel)*) -> Optional(ElementType) { + fn Next(unused self, cursor: (R.Iterator, R.Sentinel)*) -> Optional(ElementType) { if (cursor->0 != cursor->1) { returned var result: Optional(ElementType) = Optional(ElementType).Some(cursor->0.(CppUnsafeDeref.Op)()); diff --git a/core/prelude/operators/arithmetic.carbon b/core/prelude/operators/arithmetic.carbon index b178186f9c61..46872572f153 100644 --- a/core/prelude/operators/arithmetic.carbon +++ b/core/prelude/operators/arithmetic.carbon @@ -21,97 +21,97 @@ import library "prelude/types/int_literal"; // Addition: `a + b`. interface AddWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Addition with assignment: `a += b`. interface AddAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Increment: `++a`. interface Inc { - fn Op[ref self: Self](); + fn Op(ref self); } // Negation: `-a`. interface Negate { let Result:! type; - fn Op[self: Self]() -> Result; + fn Op(self) -> Result; } // Subtraction: `a - b`. interface SubWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Subtraction with assignment: `a -= b`. interface SubAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Decrement: `--a`. interface Dec { - fn Op[ref self: Self](); + fn Op(ref self); } // Multiplication: `a * b`. interface MulWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Multiplication with assignment: `a *= b`. interface MulAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Division: `a / b`. interface DivWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Division with assignment: `a /= b`. interface DivAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Modulo: `a % b`. interface ModWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Modulo with assignment: `a %= b`. interface ModAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Operations for IntLiteral. These need to be here because IntLiteral has no // associated library of its own. impl IntLiteral as AddWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.sadd"; + fn Op(self, other: Self) -> Self = "int.sadd"; } impl IntLiteral as DivWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.sdiv"; + fn Op(self, other: Self) -> Self = "int.sdiv"; } impl IntLiteral as ModWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.smod"; + fn Op(self, other: Self) -> Self = "int.smod"; } impl IntLiteral as MulWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.smul"; + fn Op(self, other: Self) -> Self = "int.smul"; } impl IntLiteral as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "int.snegate"; + fn Op(self) -> Self = "int.snegate"; } impl IntLiteral as SubWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.ssub"; + fn Op(self, other: Self) -> Self = "int.ssub"; } diff --git a/core/prelude/operators/as.carbon b/core/prelude/operators/as.carbon index 7ee9f1335e4c..62a2cc52d8c4 100644 --- a/core/prelude/operators/as.carbon +++ b/core/prelude/operators/as.carbon @@ -9,68 +9,68 @@ import library "prelude/types/int_literal"; import library "prelude/types/float_literal"; interface UnsafeAs(Dest:! type) { - fn Convert[self: Self]() -> Dest; + fn Convert(self) -> Dest; } interface As(Dest:! type) { // TODO: extend UnsafeAs(Dest); - fn Convert[self: Self]() -> Dest; + fn Convert(self) -> Dest; } interface ImplicitAs(Dest:! type) { // TODO: extend As(Dest); - fn Convert[self: Self]() -> Dest; + fn Convert(self) -> Dest; } // Workaround: ImplicitAs extends As. impl forall [U:! type, T:! ImplicitAs(U)] T as As(U) { - fn Convert[self: Self]() -> U { return self.Convert(); } + fn Convert(self) -> U { return self.Convert(); } } // Workaround: As extends UnsafeAs. impl forall [U:! type, T:! As(U)] T as UnsafeAs(U) { - fn Convert[self: Self]() -> U { return self.Convert(); } + fn Convert(self) -> U { return self.Convert(); } } // Copyable types have an identity conversion that performs a copy. impl forall [T:! Copy] T as ImplicitAs(T) { - fn Convert[self: Self]() -> Self { return self.(Copy.Op)(); } + fn Convert(self) -> Self { return self.(Copy.Op)(); } } // `const` can be added and removed when converting a value. impl forall [T:! type, U:! ImplicitAs(T)] U as ImplicitAs(const T) { - fn Convert[self: U]() -> const T { return self.Convert(); } + fn Convert(self) -> const T { return self.Convert(); } } impl forall [T:! type, U:! ImplicitAs(T)] const U as ImplicitAs(T) { - fn Convert[self: const U]() -> T { return (self as U).Convert(); } + fn Convert(self) -> T { return (self as U).Convert(); } } // `const` can be added to a pointer. // TODO: This is also provided as a builtin conversion. We provide it here so // that Optional(T*) can implicitly convert to Optional(const T*). See #5750. impl forall [T:! type] T* as ImplicitAs(const T*) { - fn Convert[self: T*]() -> const T* = "pointer.unsafe_convert"; + fn Convert(self) -> const T* = "pointer.unsafe_convert"; } impl forall [T:! type] T* as As(const T*) { - fn Convert[self: T*]() -> const T* = "pointer.unsafe_convert"; + fn Convert(self) -> const T* = "pointer.unsafe_convert"; } // Pointer types can be unsafely cast to other pointer types. // TODO: Should `unsafe as` be able to remove `const`? impl forall [T:! type, U:! type] T* as UnsafeAs(U*) { - fn Convert[self: T*]() -> U* = "pointer.unsafe_convert"; + fn Convert(self) -> U* = "pointer.unsafe_convert"; } // Integer literals can be implicitly converted to floating-point literals. impl IntLiteral as ImplicitAs(FloatLiteral) { - fn Convert[self: Self]() -> FloatLiteral = "int.convert_float_checked"; + fn Convert(self) -> FloatLiteral = "int.convert_float_checked"; } // Floating-point literals can be explicitly cast to integer literals. impl FloatLiteral as UnsafeAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "float.convert_int"; + fn Convert(self) -> IntLiteral = "float.convert_int"; } interface IntFitsIn(Dest:! type) {} diff --git a/core/prelude/operators/bitwise.carbon b/core/prelude/operators/bitwise.carbon index 52050e9605ed..c52484a7c44e 100644 --- a/core/prelude/operators/bitwise.carbon +++ b/core/prelude/operators/bitwise.carbon @@ -21,89 +21,89 @@ import library "prelude/types/int_literal"; // Bit complement: `^a`. interface BitComplement { let Result:! type; - fn Op[self: Self]() -> Result; + fn Op(self) -> Result; } // Bitwise AND: `a & b`. interface BitAndWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Bitwise AND with assignment: `a &= b`. interface BitAndAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Bitwise OR: `a | b`. interface BitOrWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Bitwise OR with assignment: `a |= b`. interface BitOrAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Bitwise XOR: `a ^ b`. interface BitXorWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Bitwise XOR with assignment: `a ^= b`. interface BitXorAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Left shift: `a << b`. interface LeftShiftWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Left shift with assignment: `a <<= b`. interface LeftShiftAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Right shift: `a >> b`. interface RightShiftWith(Other:! type) { let Result:! type; - fn Op[self: Self](other: Other) -> Result; + fn Op(self, other: Other) -> Result; } // Right shift with assignment: `a >>= b`. interface RightShiftAssignWith(Other:! type) { - fn Op[ref self: Self](other: Other); + fn Op(ref self, other: Other); } // Operations for IntLiteral. These need to be here because IntLiteral has no // associated library of its own. impl IntLiteral as BitAndWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.and"; + fn Op(self, other: Self) -> Self = "int.and"; } impl IntLiteral as BitComplement where .Result = Self { - fn Op[self: Self]() -> Self = "int.complement"; + fn Op(self) -> Self = "int.complement"; } impl IntLiteral as BitOrWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.or"; + fn Op(self, other: Self) -> Self = "int.or"; } impl IntLiteral as BitXorWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.xor"; + fn Op(self, other: Self) -> Self = "int.xor"; } impl IntLiteral as LeftShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.left_shift"; + fn Op(self, other: Self) -> Self = "int.left_shift"; } impl IntLiteral as RightShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.right_shift"; + fn Op(self, other: Self) -> Self = "int.right_shift"; } // Operations for `type`. These need to be here because `type` has no @@ -111,5 +111,5 @@ impl IntLiteral as RightShiftWith(Self) where .Result = Self { // Facet type combination. impl type as BitAndWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "type.and"; + fn Op(self, other: Self) -> Self = "type.and"; } diff --git a/core/prelude/operators/comparison.carbon b/core/prelude/operators/comparison.carbon index 2ba4b8d539ef..bba85621098f 100644 --- a/core/prelude/operators/comparison.carbon +++ b/core/prelude/operators/comparison.carbon @@ -16,39 +16,39 @@ import library "prelude/types/int_literal"; // Equality comparison: `a == b` and `a != b`. interface EqWith(Other:! type) { - fn Equal[self: Self](other: Other) -> bool; - fn NotEqual[self: Self](other: Other) -> bool; + fn Equal(self, other: Other) -> bool; + fn NotEqual(self, other: Other) -> bool; } // Relational comparison: `a < b`, `a <= b`, `a > b`, `a >= b`. interface OrderedWith(Other:! type) { // TODO: fn Compare - fn Less[self: Self](other: Other) -> bool; - fn LessOrEquivalent[self: Self](other: Other) -> bool; - fn Greater[self: Self](other: Other) -> bool; - fn GreaterOrEquivalent[self: Self](other: Other) -> bool; + fn Less(self, other: Other) -> bool; + fn LessOrEquivalent(self, other: Other) -> bool; + fn Greater(self, other: Other) -> bool; + fn GreaterOrEquivalent(self, other: Other) -> bool; } // Equality comparison for `bool`. // Note that this must be provided in this library as `bool` doesn't have any // associated libraries of its own. impl bool as EqWith(Self) { - fn Equal[self: Self](other: Self) -> bool = "bool.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "bool.neq"; + fn Equal(self, other: Self) -> bool = "bool.eq"; + fn NotEqual(self, other: Self) -> bool = "bool.neq"; } // Operations for IntLiteral. These need to be here because IntLiteral has no // associated library of its own. impl IntLiteral as EqWith(Self) { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; + fn Equal(self, other: Self) -> bool = "int.eq"; + fn NotEqual(self, other: Self) -> bool = "int.neq"; } impl IntLiteral as OrderedWith(Self) { // TODO: fn Compare - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; + fn Less(self, other: Self) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Self) -> bool = "int.less_eq"; + fn Greater(self, other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Self) -> bool = "int.greater_eq"; } diff --git a/core/prelude/operators/deref.carbon b/core/prelude/operators/deref.carbon index 5b99fa33e52d..e03a7c5c7da5 100644 --- a/core/prelude/operators/deref.carbon +++ b/core/prelude/operators/deref.carbon @@ -7,5 +7,5 @@ package Core library "prelude/operators/deref"; // TODO: Align with https://docs.carbon-lang.dev/docs/design/values.html#dereferencing-customization. interface CppUnsafeDeref { let Result:! type; - fn Op[self: Self]() -> Result; + fn Op(self) -> Result; } diff --git a/core/prelude/operators/index.carbon b/core/prelude/operators/index.carbon index e34992978e03..77c0e08a97c4 100644 --- a/core/prelude/operators/index.carbon +++ b/core/prelude/operators/index.carbon @@ -6,5 +6,5 @@ package Core library "prelude/operators/index"; interface IndexWith(SubscriptType:! type) { let ElementType:! type; - fn At[self: Self](subscript: SubscriptType) -> ElementType; + fn At(self, subscript: SubscriptType) -> ElementType; } diff --git a/core/prelude/types/char.carbon b/core/prelude/types/char.carbon index 40394e93ea36..c4552bc4461b 100644 --- a/core/prelude/types/char.carbon +++ b/core/prelude/types/char.carbon @@ -24,27 +24,27 @@ class Char { impl Char as UnformedInit {} impl Char as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } // Conversions. impl CharLiteral as ImplicitAs(Char) { - fn Convert[self: Self]() -> Char = "char.convert_checked"; + fn Convert(self) -> Char = "char.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. impl CharLiteral as As(Char) { - fn Convert[self: Self]() -> Char = "char.convert_checked"; + fn Convert(self) -> Char = "char.convert_checked"; } impl forall [From:! IntLiteral] UInt(From) as As(Char) { - fn Convert[self: Self]() -> Char = "int.convert_char"; + fn Convert(self) -> Char = "int.convert_char"; } // `char` explicitly converts to any type that `u8` implicitly converts to. impl forall [T:! type where u8 impls ImplicitAs(.Self)] Char as As(T) { - fn Convert[self: Self]() -> T { + fn Convert(self) -> T { return self as u8; } } @@ -52,39 +52,39 @@ impl forall [T:! type where u8 impls ImplicitAs(.Self)] Char as As(T) { // Comparisons. impl Char as EqWith(Char) { - fn Equal[self: Self](other: Char) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Char) -> bool = "int.neq"; + fn Equal(self, other: Char) -> bool = "int.eq"; + fn NotEqual(self, other: Char) -> bool = "int.neq"; } impl Char as OrderedWith(Char) { - fn Less[self: Self](other: Char) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Char) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Char) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Char) -> bool = "int.greater_eq"; + fn Less(self, other: Char) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Char) -> bool = "int.less_eq"; + fn Greater(self, other: Char) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Char) -> bool = "int.greater_eq"; } impl forall [T:! ImplicitAs(Char)] Char as EqWith(T) { - fn Equal[self: Self](other: Char) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Char) -> bool = "int.neq"; + fn Equal(self, other: Char) -> bool = "int.eq"; + fn NotEqual(self, other: Char) -> bool = "int.neq"; } impl forall [T:! ImplicitAs(Char)] Char as OrderedWith(T) { - fn Less[self: Self](other: Char) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Char) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Char) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Char) -> bool = "int.greater_eq"; + fn Less(self, other: Char) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Char) -> bool = "int.less_eq"; + fn Greater(self, other: Char) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Char) -> bool = "int.greater_eq"; } impl forall [T:! ImplicitAs(Char)] T as EqWith(Char) { - fn Equal[self: Char](other: Char) -> bool = "int.eq"; - fn NotEqual[self: Char](other: Char) -> bool = "int.neq"; + fn Equal(self: Char, other: Char) -> bool = "int.eq"; + fn NotEqual(self: Char, other: Char) -> bool = "int.neq"; } impl forall [T:! ImplicitAs(Char)] T as OrderedWith(Char) { - fn Less[self: Char](other: Char) -> bool = "int.less"; - fn LessOrEquivalent[self: Char](other: Char) -> bool = "int.less_eq"; - fn Greater[self: Char](other: Char) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Char](other: Char) -> bool = "int.greater_eq"; + fn Less(self: Char, other: Char) -> bool = "int.less"; + fn LessOrEquivalent(self: Char, other: Char) -> bool = "int.less_eq"; + fn Greater(self: Char, other: Char) -> bool = "int.greater"; + fn GreaterOrEquivalent(self: Char, other: Char) -> bool = "int.greater_eq"; } // Arithmetic. @@ -96,7 +96,7 @@ impl forall [N:! IntLiteral] UInt(N) as AnyInt {} impl forall [T:! AnyInt & As(u8)] Char as AddWith(T) where .Result = Char { - fn Op[self: Self](other: T) -> Self { + fn Op(self, other: T) -> Self { // TODO: This should be erroneous if the addition overflows. return ((self as u8) + (other as u8)) as char; } @@ -104,7 +104,7 @@ impl forall [T:! AnyInt & As(u8)] impl forall [T:! AnyInt & As(u8)] T as AddWith(Char) where .Result = Char { - fn Op[self: Self](other: Char) -> Char { + fn Op(self, other: Char) -> Char { // TODO: This should be erroneous if the addition overflows. return ((self as u8) + (other as u8)) as char; } @@ -112,26 +112,26 @@ impl forall [T:! AnyInt & As(u8)] final impl forall [T:! AnyInt & As(u8)] Char as SubWith(T) where .Result = Char { - fn Op[self: Self](other: T) -> Self { + fn Op(self, other: T) -> Self { // TODO: This should be erroneous if the addition overflows. return ((self as u8) - (other as u8)) as char; } } impl Char as SubWith(Char) where .Result = i32 { - fn Op[self: Self](other: Char) -> i32 { + fn Op(self, other: Char) -> i32 { return (self as i32) - (other as i32); } } impl forall [T:! ImplicitAs(Char)] T as SubWith(Char) where .Result = i32 { - fn Op[self: Char](other: Char) -> i32 { + fn Op(self: Char, other: Char) -> i32 { return (self as i32) - (other as i32); } } impl forall [T:! ImplicitAs(Char)] Char as SubWith(T) where .Result = i32 { - fn Op[self: Char](other: Char) -> i32 { + fn Op(self, other: Char) -> i32 { return (self as i32) - (other as i32); } } diff --git a/core/prelude/types/cpp/int.carbon b/core/prelude/types/cpp/int.carbon index d69ca4a9d96d..d282fe01d720 100644 --- a/core/prelude/types/cpp/int.carbon +++ b/core/prelude/types/cpp/int.carbon @@ -37,39 +37,39 @@ impl CppCompat.ULongLong64 as UnformedInit {} // Copy impl CppCompat.Long32 as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl CppCompat.ULong32 as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl CppCompat.LongLong64 as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl CppCompat.ULongLong64 as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } // Conversions. impl IntLiteral as ImplicitAs(CppCompat.Long32) { - fn Convert[self: Self]() -> CppCompat.Long32 = "int.convert_checked"; + fn Convert(self) -> CppCompat.Long32 = "int.convert_checked"; } // TODO: Remove this once `ImplicitAs` extends `As`. impl IntLiteral as As(CppCompat.Long32) { - fn Convert[self: Self]() -> CppCompat.Long32 = "int.convert_checked"; + fn Convert(self) -> CppCompat.Long32 = "int.convert_checked"; } final impl CppCompat.Long32 as ImplicitAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // TODO: ImplicitAs from Int(N) to Long32 if N < 32. impl i32 as ImplicitAs(CppCompat.Long32) { - fn Convert[self: Self]() -> CppCompat.Long32 = "int.convert"; + fn Convert(self) -> CppCompat.Long32 = "int.convert"; } // TODO: Generalize ImplicitAs from Long32 to Int(N) for all N > 32. @@ -81,48 +81,48 @@ impl i32 as ImplicitAs(CppCompat.Long32) { // Cpp.long, which differs from the result for Cpp.long + i32 -> Cpp.long, as // the best match for the left operand is being selected. final impl CppCompat.Long32 as ImplicitAs(i64) { - fn Convert[self: Self]() -> i64 = "int.convert"; + fn Convert(self) -> i64 = "int.convert"; } impl IntLiteral as ImplicitAs(CppCompat.ULong32) { - fn Convert[self: Self]() -> CppCompat.ULong32 = "int.convert_checked"; + fn Convert(self) -> CppCompat.ULong32 = "int.convert_checked"; } // TODO: Remove this once `ImplicitAs` extends `As`. impl IntLiteral as As(CppCompat.ULong32) { - fn Convert[self: Self]() -> CppCompat.ULong32 = "int.convert_checked"; + fn Convert(self) -> CppCompat.ULong32 = "int.convert_checked"; } final impl CppCompat.ULong32 as ImplicitAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // TODO: ImplicitAs from UInt(N) to ULong32 if N < 32. impl u32 as ImplicitAs(CppCompat.ULong32) { - fn Convert[self: Self]() -> CppCompat.ULong32 = "int.convert"; + fn Convert(self) -> CppCompat.ULong32 = "int.convert"; } // TODO: ImplicitAs from ULong32 to UInt(N) if N > 32. final impl CppCompat.ULong32 as ImplicitAs(u64) { - fn Convert[self: Self]() -> u64 = "int.convert"; + fn Convert(self) -> u64 = "int.convert"; } impl IntLiteral as ImplicitAs(CppCompat.LongLong64) { - fn Convert[self: Self]() -> CppCompat.LongLong64 = "int.convert_checked"; + fn Convert(self) -> CppCompat.LongLong64 = "int.convert_checked"; } // TODO: Remove this once `ImplicitAs` extends `As`. impl IntLiteral as As(CppCompat.LongLong64) { - fn Convert[self: Self]() -> CppCompat.LongLong64 = "int.convert_checked"; + fn Convert(self) -> CppCompat.LongLong64 = "int.convert_checked"; } final impl CppCompat.LongLong64 as ImplicitAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // TODO: ImplicitAs from Int(N) to LongLong64 if N < 64. impl i64 as ImplicitAs(CppCompat.LongLong64) { - fn Convert[self: Self]() -> CppCompat.LongLong64 = "int.convert"; + fn Convert(self) -> CppCompat.LongLong64 = "int.convert"; } // TODO: ImplicitAs from LongLong64 to Int(N) if N > 64. @@ -130,30 +130,30 @@ impl i64 as ImplicitAs(CppCompat.LongLong64) { // be between i64 and i65 (details: // https://github.com/carbon-language/carbon-lang/issues/6275#issuecomment-3488010485). final impl CppCompat.LongLong64 as ImplicitAs(i128) { - fn Convert[self: Self]() -> i128 = "int.convert"; + fn Convert(self) -> i128 = "int.convert"; } impl IntLiteral as ImplicitAs(CppCompat.ULongLong64) { - fn Convert[self: Self]() -> CppCompat.ULongLong64 = "int.convert_checked"; + fn Convert(self) -> CppCompat.ULongLong64 = "int.convert_checked"; } // TODO: Remove this once `ImplicitAs` extends `As`. impl IntLiteral as As(CppCompat.ULongLong64) { - fn Convert[self: Self]() -> CppCompat.ULongLong64 = "int.convert_checked"; + fn Convert(self) -> CppCompat.ULongLong64 = "int.convert_checked"; } final impl CppCompat.ULongLong64 as ImplicitAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // TODO: ImplicitAs from UInt(N) to ULongLong64 if N < 64. impl u64 as ImplicitAs(CppCompat.ULongLong64) { - fn Convert[self: Self]() -> CppCompat.ULongLong64 = "int.convert"; + fn Convert(self) -> CppCompat.ULongLong64 = "int.convert"; } // TODO: ImplicitAs from ULongLong64 to UInt(N) if N > 64. final impl CppCompat.ULongLong64 as ImplicitAs(u128) { - fn Convert[self: Self]() -> u128 = "int.convert"; + fn Convert(self) -> u128 = "int.convert"; } // TODO: As from Long32 to Int(N) if N < 32. @@ -172,27 +172,27 @@ final impl CppCompat.ULongLong64 as ImplicitAs(u128) { // - CppCompat.T vs CppCompat.T final impl CppCompat.Long32 as EqWith(CppCompat.Long32) { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; + fn Equal(self, other: Self) -> bool = "int.eq"; + fn NotEqual(self, other: Self) -> bool = "int.neq"; } final impl CppCompat.Long32 as OrderedWith(CppCompat.Long32) { - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; + fn Less(self, other: Self) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Self) -> bool = "int.less_eq"; + fn Greater(self, other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Self) -> bool = "int.greater_eq"; } final impl CppCompat.LongLong64 as EqWith(CppCompat.LongLong64) { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; + fn Equal(self, other: Self) -> bool = "int.eq"; + fn NotEqual(self, other: Self) -> bool = "int.neq"; } final impl CppCompat.LongLong64 as OrderedWith(CppCompat.LongLong64) { - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; + fn Less(self, other: Self) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Self) -> bool = "int.less_eq"; + fn Greater(self, other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Self) -> bool = "int.greater_eq"; } // - Heterogeneous. @@ -200,62 +200,62 @@ final impl CppCompat.LongLong64 as OrderedWith(CppCompat.LongLong64) { // - CppCompat.T on left-hand side. impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as EqWith(T) { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; + fn Equal(self, other: Self) -> bool = "int.eq"; + fn NotEqual(self, other: Self) -> bool = "int.neq"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as OrderedWith(T) { - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; + fn Less(self, other: Self) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Self) -> bool = "int.less_eq"; + fn Greater(self, other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Self) -> bool = "int.greater_eq"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as EqWith(T) { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; + fn Equal(self, other: Self) -> bool = "int.eq"; + fn NotEqual(self, other: Self) -> bool = "int.neq"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as OrderedWith(T) { - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; + fn Less(self, other: Self) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Self) -> bool = "int.less_eq"; + fn Greater(self, other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Self) -> bool = "int.greater_eq"; } // - CppCompat.T on right-hand side. impl forall [T:! ImplicitAs(CppCompat.Long32)] T as EqWith(CppCompat.Long32) { - fn Equal[self: CppCompat.Long32](other: CppCompat.Long32) -> bool = "int.eq"; - fn NotEqual[self: CppCompat.Long32](other: CppCompat.Long32) -> bool = "int.neq"; + fn Equal(self: CppCompat.Long32, other: CppCompat.Long32) -> bool = "int.eq"; + fn NotEqual(self: CppCompat.Long32, other: CppCompat.Long32) -> bool = "int.neq"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as OrderedWith(CppCompat.Long32) { - fn Less[self: CppCompat.Long32](other: CppCompat.Long32) -> bool = "int.less"; - fn LessOrEquivalent[self: CppCompat.Long32](other: CppCompat.Long32) -> bool = "int.less_eq"; - fn Greater[self: CppCompat.Long32](other: CppCompat.Long32) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: CppCompat.Long32](other: CppCompat.Long32) -> bool = "int.greater_eq"; + fn Less(self: CppCompat.Long32, other: CppCompat.Long32) -> bool = "int.less"; + fn LessOrEquivalent(self: CppCompat.Long32, other: CppCompat.Long32) -> bool = "int.less_eq"; + fn Greater(self: CppCompat.Long32, other: CppCompat.Long32) -> bool = "int.greater"; + fn GreaterOrEquivalent(self: CppCompat.Long32, other: CppCompat.Long32) -> bool = "int.greater_eq"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as EqWith(CppCompat.LongLong64) { - fn Equal[self: CppCompat.LongLong64]( + fn Equal(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> bool = "int.eq"; - fn NotEqual[self: CppCompat.LongLong64]( + fn NotEqual(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> bool = "int.neq"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as OrderedWith(CppCompat.LongLong64) { - fn Less[self: CppCompat.LongLong64]( + fn Less(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> bool = "int.less"; - fn LessOrEquivalent[self: CppCompat.LongLong64]( + fn LessOrEquivalent(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> bool = "int.less_eq"; - fn Greater[self: CppCompat.LongLong64]( + fn Greater(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: CppCompat.LongLong64]( + fn GreaterOrEquivalent(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> bool = "int.greater_eq"; } @@ -268,53 +268,53 @@ impl forall [T:! ImplicitAs(CppCompat.LongLong64)] // - CppCompat.Long32 final impl CppCompat.Long32 as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "int.snegate"; + fn Op(self) -> Self = "int.snegate"; } final impl CppCompat.Long32 as AddWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.sadd"; + fn Op(self, other: Self) -> Self = "int.sadd"; } final impl CppCompat.Long32 as SubWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.ssub"; + fn Op(self, other: Self) -> Self = "int.ssub"; } final impl CppCompat.Long32 as MulWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.smul"; + fn Op(self, other: Self) -> Self = "int.smul"; } final impl CppCompat.Long32 as DivWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.sdiv"; + fn Op(self, other: Self) -> Self = "int.sdiv"; } final impl CppCompat.Long32 as ModWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.smod"; + fn Op(self, other: Self) -> Self = "int.smod"; } // - CppCompat.LongLong64 final impl CppCompat.LongLong64 as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "int.snegate"; + fn Op(self) -> Self = "int.snegate"; } final impl CppCompat.LongLong64 as AddWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.sadd"; + fn Op(self, other: Self) -> Self = "int.sadd"; } final impl CppCompat.LongLong64 as SubWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.ssub"; + fn Op(self, other: Self) -> Self = "int.ssub"; } final impl CppCompat.LongLong64 as MulWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.smul"; + fn Op(self, other: Self) -> Self = "int.smul"; } final impl CppCompat.LongLong64 as DivWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.sdiv"; + fn Op(self, other: Self) -> Self = "int.sdiv"; } final impl CppCompat.LongLong64 as ModWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.smod"; + fn Op(self, other: Self) -> Self = "int.smod"; } // - Heterogeneous. @@ -323,58 +323,58 @@ final impl CppCompat.LongLong64 as ModWith(Self) where .Result = Self { impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as AddWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.sadd"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.sadd"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as SubWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.ssub"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.ssub"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as MulWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.smul"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.smul"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as DivWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.sdiv"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.sdiv"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as ModWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.smod"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.smod"; } // - CppCompat.LongLong64 on left-hand side. impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as AddWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.sadd"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as SubWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.ssub"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as MulWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.smul"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as DivWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.sdiv"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as ModWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.smod"; } @@ -382,58 +382,58 @@ impl forall [T:! ImplicitAs(CppCompat.LongLong64)] impl forall [T:! ImplicitAs(CppCompat.Long32)] T as AddWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.sadd"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.sadd"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as SubWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.ssub"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.ssub"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as MulWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.smul"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.smul"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as DivWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.sdiv"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.sdiv"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as ModWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32](other: CppCompat.Long32) -> CppCompat.Long32 = "int.smod"; + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.smod"; } // - CppCompat.LongLong64 on right-hand side. impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as AddWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.sadd"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as SubWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.ssub"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as MulWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.smul"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as DivWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.sdiv"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as ModWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.smod"; } @@ -446,53 +446,53 @@ impl forall [T:! ImplicitAs(CppCompat.LongLong64)] // - CppCompat.Long32 final impl CppCompat.Long32 as BitComplement where .Result = Self { - fn Op[self: Self]() -> Self = "int.complement"; + fn Op(self) -> Self = "int.complement"; } final impl CppCompat.Long32 as BitAndWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.and"; + fn Op(self, other: Self) -> Self = "int.and"; } final impl CppCompat.Long32 as BitOrWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.or"; + fn Op(self, other: Self) -> Self = "int.or"; } final impl CppCompat.Long32 as BitXorWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.xor"; + fn Op(self, other: Self) -> Self = "int.xor"; } final impl CppCompat.Long32 as LeftShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.left_shift"; + fn Op(self, other: Self) -> Self = "int.left_shift"; } final impl CppCompat.Long32 as RightShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.right_shift"; + fn Op(self, other: Self) -> Self = "int.right_shift"; } // - CppCompat.LongLong64 final impl CppCompat.LongLong64 as BitComplement where .Result = Self { - fn Op[self: Self]() -> Self = "int.complement"; + fn Op(self) -> Self = "int.complement"; } final impl CppCompat.LongLong64 as BitAndWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.and"; + fn Op(self, other: Self) -> Self = "int.and"; } final impl CppCompat.LongLong64 as BitOrWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.or"; + fn Op(self, other: Self) -> Self = "int.or"; } final impl CppCompat.LongLong64 as BitXorWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.xor"; + fn Op(self, other: Self) -> Self = "int.xor"; } final impl CppCompat.LongLong64 as LeftShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.left_shift"; + fn Op(self, other: Self) -> Self = "int.left_shift"; } final impl CppCompat.LongLong64 as RightShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.right_shift"; + fn Op(self, other: Self) -> Self = "int.right_shift"; } // - Heterogeneous. @@ -501,31 +501,31 @@ final impl CppCompat.LongLong64 as RightShiftWith(Self) where .Result = Self { impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as BitAndWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other:CppCompat.Long32) -> CppCompat.Long32 = "int.and"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as BitOrWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.or"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as BitXorWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.xor"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as LeftShiftWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.left_shift"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as RightShiftWith(T) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.right_shift"; } @@ -533,31 +533,31 @@ impl forall [T:! ImplicitAs(CppCompat.Long32)] impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as BitAndWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other:CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.and"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as BitOrWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.or"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as BitXorWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.xor"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as LeftShiftWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.left_shift"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as RightShiftWith(T) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.right_shift"; } @@ -565,31 +565,31 @@ impl forall [T:! ImplicitAs(CppCompat.LongLong64)] impl forall [T:! ImplicitAs(CppCompat.Long32)] T as BitAndWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.and"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as BitOrWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.or"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as BitXorWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.xor"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as LeftShiftWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.left_shift"; } impl forall [T:! ImplicitAs(CppCompat.Long32)] T as RightShiftWith(CppCompat.Long32) where .Result = CppCompat.Long32 { - fn Op[self: CppCompat.Long32]( + fn Op(self: CppCompat.Long32, other: CppCompat.Long32) -> CppCompat.Long32 = "int.right_shift"; } @@ -597,31 +597,31 @@ impl forall [T:! ImplicitAs(CppCompat.Long32)] impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as BitAndWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.and"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as BitOrWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.or"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as BitXorWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.xor"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as LeftShiftWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.left_shift"; } impl forall [T:! ImplicitAs(CppCompat.LongLong64)] T as RightShiftWith(CppCompat.LongLong64) where .Result = CppCompat.LongLong64 { - fn Op[self: CppCompat.LongLong64]( + fn Op(self: CppCompat.LongLong64, other: CppCompat.LongLong64) -> CppCompat.LongLong64 = "int.right_shift"; } @@ -635,54 +635,54 @@ impl forall [T:! ImplicitAs(CppCompat.LongLong64)] impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as AddAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.sadd_assign"; + fn Op(ref self, other: Self) = "int.sadd_assign"; } impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as SubAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.ssub_assign"; + fn Op(ref self, other: Self) = "int.ssub_assign"; } impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as MulAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.smul_assign"; + fn Op(ref self, other: Self) = "int.smul_assign"; } impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as DivAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.sdiv_assign"; + fn Op(ref self, other: Self) = "int.sdiv_assign"; } impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as ModAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.smod_assign"; + fn Op(ref self, other: Self) = "int.smod_assign"; } // - CppCompat.LongLong64 impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as AddAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.sadd_assign"; + fn Op(ref self, other: Self) = "int.sadd_assign"; } impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as SubAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.ssub_assign"; + fn Op(ref self, other: Self) = "int.ssub_assign"; } impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as MulAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.smul_assign"; + fn Op(ref self, other: Self) = "int.smul_assign"; } impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as DivAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.sdiv_assign"; + fn Op(ref self, other: Self) = "int.sdiv_assign"; } impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as ModAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.smod_assign"; + fn Op(ref self, other: Self) = "int.smod_assign"; } // Compound bitwise assignments. @@ -691,54 +691,54 @@ impl forall [U:! ImplicitAs(CppCompat.LongLong64)] impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as BitAndAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.and_assign"; + fn Op(ref self, other: Self) = "int.and_assign"; } impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as BitOrAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.or_assign"; + fn Op(ref self, other: Self) = "int.or_assign"; } impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as BitXorAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.xor_assign"; + fn Op(ref self, other: Self) = "int.xor_assign"; } impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as LeftShiftAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.left_shift_assign"; + fn Op(ref self, other: Self) = "int.left_shift_assign"; } impl forall [U:! ImplicitAs(CppCompat.Long32)] CppCompat.Long32 as RightShiftAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.right_shift_assign"; + fn Op(ref self, other: Self) = "int.right_shift_assign"; } // - CppCompat.LongLong64 impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as BitAndAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.and_assign"; + fn Op(ref self, other: Self) = "int.and_assign"; } impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as BitOrAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.or_assign"; + fn Op(ref self, other: Self) = "int.or_assign"; } impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as BitXorAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.xor_assign"; + fn Op(ref self, other: Self) = "int.xor_assign"; } impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as LeftShiftAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.left_shift_assign"; + fn Op(ref self, other: Self) = "int.left_shift_assign"; } impl forall [U:! ImplicitAs(CppCompat.LongLong64)] CppCompat.LongLong64 as RightShiftAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.right_shift_assign"; + fn Op(ref self, other: Self) = "int.right_shift_assign"; } // TODO: ULong32, ULongLong64: compound assignments. @@ -748,13 +748,13 @@ impl forall [U:! ImplicitAs(CppCompat.LongLong64)] // - CppCompat.Long32 impl CppCompat.Long32 as Dec { - fn Op[ref self: Self]() { + fn Op(ref self) { self -= (1 as CppCompat.Long32); } } impl CppCompat.Long32 as Inc { - fn Op[ref self: Self]() { + fn Op(ref self) { self += (1 as CppCompat.Long32); } } @@ -762,13 +762,13 @@ impl CppCompat.Long32 as Inc { // - CppCompat.LongLong64 impl CppCompat.LongLong64 as Dec { - fn Op[ref self: Self]() { + fn Op(ref self) { self -= (1 as CppCompat.LongLong64); } } impl CppCompat.LongLong64 as Inc { - fn Op[ref self: Self]() { + fn Op(ref self) { self += (1 as CppCompat.LongLong64); } } diff --git a/core/prelude/types/cpp/nullptr.carbon b/core/prelude/types/cpp/nullptr.carbon index e4542ce02c5b..22d1696e6e15 100644 --- a/core/prelude/types/cpp/nullptr.carbon +++ b/core/prelude/types/cpp/nullptr.carbon @@ -40,7 +40,7 @@ class CppCompat.NullptrT { } impl as Copy { - fn Op[unused self: Self]() -> Self { + fn Op(unused self) -> Self { return Make(); } } @@ -48,7 +48,7 @@ class CppCompat.NullptrT { // TODO: impl as EqWith(Self) impl forall [T:! type] as ImplicitAs(Optional(T*)) { - fn Convert[unused self: Self]() -> Optional(T*) { + fn Convert(unused self) -> Optional(T*) { return Optional(T*).None(); } } diff --git a/core/prelude/types/cpp/void.carbon b/core/prelude/types/cpp/void.carbon index 38b0c006ed0a..1cea1d56a63a 100644 --- a/core/prelude/types/cpp/void.carbon +++ b/core/prelude/types/cpp/void.carbon @@ -33,9 +33,9 @@ abstract class CppCompat.VoidBase { // #6357 allows it, and we don't have a good way to express "non-const" as a // constraint on this impl, but this conversion is not const-correct. impl forall [T:! type] T* as ImplicitAs(CppCompat.VoidBase*) { - fn Convert[self: T*]() -> CppCompat.VoidBase* = "pointer.unsafe_convert"; + fn Convert(self: T*) -> CppCompat.VoidBase* = "pointer.unsafe_convert"; } impl forall [T:! type] T* as ImplicitAs(const CppCompat.VoidBase*) { - fn Convert[self: T*]() -> CppCompat.VoidBase* = "pointer.unsafe_convert"; + fn Convert(self: T*) -> CppCompat.VoidBase* = "pointer.unsafe_convert"; } diff --git a/core/prelude/types/float.carbon b/core/prelude/types/float.carbon index 56a3c8790ef1..66173c5b3dd3 100644 --- a/core/prelude/types/float.carbon +++ b/core/prelude/types/float.carbon @@ -24,23 +24,23 @@ impl forall [N:! IntLiteral] Float(N) as UnformedInit {} // Copy. impl forall [N:! IntLiteral] Float(N) as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } // Conversions between floating-point types. Implicit if all the source values // can be represented exactly in the target type, otherwise explicit. impl forall [N:! IntLiteral] FloatLiteral as ImplicitAs(Float(N)) { - fn Convert[self: Self]() -> Float(N) = "float.convert_checked"; + fn Convert(self) -> Float(N) = "float.convert_checked"; } // TODO: Remove this once ImplicitAs extends As. impl forall [N:! IntLiteral] FloatLiteral as As(Float(N)) { - fn Convert[self: Self]() -> Float(N) = "float.convert_checked"; + fn Convert(self) -> Float(N) = "float.convert_checked"; } final impl forall [From:! IntLiteral, To:! IntLiteral] Float(From) as As(Float(To)) { - fn Convert[self: Self]() -> Float(To) = "float.convert"; + fn Convert(self) -> Float(To) = "float.convert"; } // AnyFloat exists to work around the inability to apply constraints to an impl @@ -48,12 +48,12 @@ final impl forall [From:! IntLiteral, To:! IntLiteral] // TODO: Remove these once possible. private interface AnyFloat { let Width:! IntLiteral; - fn AsFloat[self: Self]() -> Float(Width); + fn AsFloat(self) -> Float(Width); fn Make(src: Float(Width)) -> Self; } impl forall [N:! IntLiteral] Float(N) as AnyFloat where .Width = N { - fn AsFloat[self: Self]() -> Self { return self; } + fn AsFloat(self) -> Self { return self; } fn Make(src: Self) -> Self { return src; } } @@ -62,7 +62,7 @@ impl forall [N:! IntLiteral] Float(N) as AnyFloat where .Width = N { // TODO: Use `match_first` to resolve this instead once it is available. impl forall [From:! IntLiteral, To:! AnyFloat where Float(From) impls FloatFitsIn(.Self)] Float(From) as ImplicitAs(To) { - fn Convert[self: Self]() -> To { + fn Convert(self) -> To { fn Impl(src: Float(From)) -> Float(To.Width) = "float.convert"; return To.Make(Impl(self)); } @@ -79,34 +79,34 @@ impl forall [From:! IntLiteral, To:! AnyFloat where Float(From) impls FloatFitsI // source values fit in the target type. final impl forall [From:! IntLiteral, To:! IntLiteral] Float(From) as UnsafeAs(Int(To)) { - fn Convert[self: Self]() -> Int(To) = "float.convert_int"; + fn Convert(self) -> Int(To) = "float.convert_int"; } final impl forall [From:! IntLiteral, To:! IntLiteral] Float(From) as UnsafeAs(UInt(To)) { - fn Convert[self: Self]() -> UInt(To) = "float.convert_int"; + fn Convert(self) -> UInt(To) = "float.convert_int"; } final impl forall [From:! IntLiteral] Float(From) as UnsafeAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "float.convert_int"; + fn Convert(self) -> IntLiteral = "float.convert_int"; } // Conversions from integer to floating-point type. Implicit if all source // values can be represented exactly in the target type, otherwise explicit. impl forall [From:! IntLiteral, To:! IntLiteral] Int(From) as As(Float(To)) { - fn Convert[self: Self]() -> Float(To) = "int.convert_float"; + fn Convert(self) -> Float(To) = "int.convert_float"; } impl forall [From:! IntLiteral, To:! IntLiteral] UInt(From) as As(Float(To)) { - fn Convert[self: Self]() -> Float(To) = "int.convert_float"; + fn Convert(self) -> Float(To) = "int.convert_float"; } impl forall [To:! IntLiteral] IntLiteral as As(Float(To)) { - fn Convert[self: Self]() -> Float(To) = "int.convert_float"; + fn Convert(self) -> Float(To) = "int.convert_float"; } // AnyInt, AnyUInt, and IntImplicitAsFloat exist to work around the inability to @@ -115,29 +115,29 @@ impl forall [To:! IntLiteral] // TODO: Remove these once possible. private interface AnyInt { let Width:! IntLiteral; - fn AsInt[self: Self]() -> Int(Width); + fn AsInt(self) -> Int(Width); } impl forall [N:! IntLiteral] Int(N) as AnyInt where .Width = N { - fn AsInt[self: Self]() -> Self { return self; } + fn AsInt(self) -> Self { return self; } } private interface AnyUInt { let Width:! IntLiteral; - fn AsUInt[self: Self]() -> UInt(Width); + fn AsUInt(self) -> UInt(Width); } impl forall [N:! IntLiteral] UInt(N) as AnyUInt where .Width = N { - fn AsUInt[self: Self]() -> Self { return self; } + fn AsUInt(self) -> Self { return self; } } private interface IntImplicitAsFloat(To:! IntLiteral) { - fn Convert[self: Self]() -> Float(To); + fn Convert(self) -> Float(To); } final impl forall [To:! IntLiteral, From:! AnyInt & IntFitsIn(Float(To))] From as IntImplicitAsFloat(To) { - fn Convert[self: Self]() -> Float(To) { + fn Convert(self) -> Float(To) { fn Impl(src: Int(From.Width)) -> Float(To) = "int.convert_float"; return Impl(self.AsInt()); } @@ -145,7 +145,7 @@ final impl forall [To:! IntLiteral, From:! AnyInt & IntFitsIn(Float(To))] impl forall [To:! IntLiteral, From:! AnyUInt & IntFitsIn(Float(To))] From as IntImplicitAsFloat(To) { - fn Convert[self: Self]() -> Float(To) { + fn Convert(self) -> Float(To) { fn Impl(src: UInt(From.Width)) -> Float(To) = "int.convert_float"; return Impl(self.AsUInt()); } @@ -153,7 +153,7 @@ impl forall [To:! IntLiteral, From:! AnyUInt & IntFitsIn(Float(To))] impl forall [To:! IntLiteral, From:! IntImplicitAsFloat(To)] From as ImplicitAs(Float(To)) { - fn Convert[self: Self]() -> Float(To) { + fn Convert(self) -> Float(To) { return self.Convert(); } } @@ -174,66 +174,66 @@ impl forall [To:! IntLiteral, From:! IntImplicitAsFloat(To)] impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(Float(To)) { - fn Convert[self: Self]() -> Float(To) = "int.convert_float_checked"; + fn Convert(self) -> Float(To) = "int.convert_float_checked"; } // Comparisons. // TODO: Support mixed-type comparisons. final impl forall [N:! IntLiteral] Float(N) as EqWith(Float(N)) { - fn Equal[self: Self](other: Float(N)) -> bool = "float.eq"; - fn NotEqual[self: Self](other: Float(N)) -> bool = "float.neq"; + fn Equal(self, other: Float(N)) -> bool = "float.eq"; + fn NotEqual(self, other: Float(N)) -> bool = "float.neq"; } final impl forall [N:! IntLiteral] Float(N) as OrderedWith(Float(N)) { - fn Less[self: Self](other: Float(N)) -> bool = "float.less"; - fn LessOrEquivalent[self: Self](other: Float(N)) -> bool = "float.less_eq"; - fn Greater[self: Self](other: Float(N)) -> bool = "float.greater"; - fn GreaterOrEquivalent[self: Self](other: Float(N)) -> bool = "float.greater_eq"; + fn Less(self, other: Float(N)) -> bool = "float.less"; + fn LessOrEquivalent(self, other: Float(N)) -> bool = "float.less_eq"; + fn Greater(self, other: Float(N)) -> bool = "float.greater"; + fn GreaterOrEquivalent(self, other: Float(N)) -> bool = "float.greater_eq"; } // Arithmetic. final impl forall [N:! IntLiteral] Float(N) as AddWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "float.add"; + fn Op(self, other: Self) -> Self = "float.add"; } final impl forall [N:! IntLiteral] Float(N) as DivWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "float.div"; + fn Op(self, other: Self) -> Self = "float.div"; } final impl forall [N:! IntLiteral] Float(N) as MulWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "float.mul"; + fn Op(self, other: Self) -> Self = "float.mul"; } final impl forall [N:! IntLiteral] Float(N) as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "float.negate"; + fn Op(self) -> Self = "float.negate"; } final impl forall [N:! IntLiteral] Float(N) as SubWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "float.sub"; + fn Op(self, other: Self) -> Self = "float.sub"; } // Compound assignments. final impl forall [N:! IntLiteral] Float(N) as AddAssignWith(Self) { - fn Op[ref self: Self](other: Self) = "float.add_assign"; + fn Op(ref self, other: Self) = "float.add_assign"; } final impl forall [N:! IntLiteral] Float(N) as DivAssignWith(Self) { - fn Op[ref self: Self](other: Self) = "float.div_assign"; + fn Op(ref self, other: Self) = "float.div_assign"; } final impl forall [N:! IntLiteral] Float(N) as MulAssignWith(Self) { - fn Op[ref self: Self](other: Self) = "float.mul_assign"; + fn Op(ref self, other: Self) = "float.mul_assign"; } final impl forall [N:! IntLiteral] Float(N) as SubAssignWith(Self) { - fn Op[ref self: Self](other: Self) = "float.sub_assign"; + fn Op(ref self, other: Self) = "float.sub_assign"; } diff --git a/core/prelude/types/int.carbon b/core/prelude/types/int.carbon index 6e534d2ccbbe..93fe1310f7ac 100644 --- a/core/prelude/types/int.carbon +++ b/core/prelude/types/int.carbon @@ -22,28 +22,28 @@ impl forall [N:! IntLiteral] Int(N) as UnformedInit {} // Copy. impl forall [N:! IntLiteral] Int(N) as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } // Conversions. impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(Int(To)) { - fn Convert[self: Self]() -> Int(To) = "int.convert_checked"; + fn Convert(self) -> Int(To) = "int.convert_checked"; } final impl forall [From:! IntLiteral] Int(From) as ImplicitAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. For now we need them because // the forwarding impl of As in terms of ImplicitAs is not usable at compile // time. impl forall [To:! IntLiteral] IntLiteral as As(Int(To)) { - fn Convert[self: Self]() -> Int(To) = "int.convert_checked"; + fn Convert(self) -> Int(To) = "int.convert_checked"; } final impl forall [From:! IntLiteral] Int(From) as As(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // Work around the inability to put a `where` clause on a generic parameter of @@ -51,29 +51,29 @@ final impl forall [From:! IntLiteral] Int(From) as As(IntLiteral) { // TODO: Remove this once possible. private interface AnyInt { let Width:! IntLiteral; - fn AsInt[self: Self]() -> Int(Width); + fn AsInt(self) -> Int(Width); } impl forall [N:! IntLiteral] Int(N) as AnyInt where .Width = N { - fn AsInt[self: Self]() -> Self { return self; } + fn AsInt(self) -> Self { return self; } } impl forall [To:! IntLiteral, From:! AnyInt & IntFitsIn(Int(To))] From as ImplicitAs(Int(To)) { - fn Convert[self: Self]() -> Int(To) { + fn Convert(self) -> Int(To) { fn Impl(src: Int(From.Width)) -> Int(To) = "int.convert"; return Impl(self.AsInt()); } } final impl forall [From:! IntLiteral, To:! IntLiteral] Int(From) as As(Int(To)) { - fn Convert[self: Self]() -> Int(To) = "int.convert"; + fn Convert(self) -> Int(To) = "int.convert"; } // Explicit conversion from floating-point literals. impl forall [To:! IntLiteral] FloatLiteral as UnsafeAs(Int(To)) { - fn Convert[self: Self]() -> Int(To) = "float.convert_int"; + fn Convert(self) -> Int(To) = "float.convert_int"; } // Comparisons. @@ -81,46 +81,46 @@ impl forall [To:! IntLiteral] // - Int(N) vs Int(M). final impl forall [N:! IntLiteral, M:! IntLiteral] Int(N) as EqWith(Int(M)) { - fn Equal[self: Self](other: Int(M)) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Int(M)) -> bool = "int.neq"; + fn Equal(self, other: Int(M)) -> bool = "int.eq"; + fn NotEqual(self, other: Int(M)) -> bool = "int.neq"; } final impl forall [N:! IntLiteral, M:! IntLiteral] Int(N) as OrderedWith(Int(M)) { // TODO: fn Compare - fn Less[self: Self](other: Int(M)) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Int(M)) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Int(M)) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Int(M)) -> bool = "int.greater_eq"; + fn Less(self, other: Int(M)) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Int(M)) -> bool = "int.less_eq"; + fn Greater(self, other: Int(M)) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Int(M)) -> bool = "int.greater_eq"; } // - Int(N) on left-hand side. impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] Int(N) as EqWith(T) { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; + fn Equal(self, other: Self) -> bool = "int.eq"; + fn NotEqual(self, other: Self) -> bool = "int.neq"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] Int(N) as OrderedWith(T) { // TODO: fn Compare - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; + fn Less(self, other: Self) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Self) -> bool = "int.less_eq"; + fn Greater(self, other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Self) -> bool = "int.greater_eq"; } // - Int(N) on right-hand side. impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as EqWith(Int(N)) { - fn Equal[self: Int(N)](other: Int(N)) -> bool = "int.eq"; - fn NotEqual[self: Int(N)](other: Int(N)) -> bool = "int.neq"; + fn Equal(self: Int(N), other: Int(N)) -> bool = "int.eq"; + fn NotEqual(self: Int(N), other: Int(N)) -> bool = "int.neq"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as OrderedWith(Int(N)) { // TODO: fn Compare - fn Less[self: Int(N)](other: Int(N)) -> bool = "int.less"; - fn LessOrEquivalent[self: Int(N)](other: Int(N)) -> bool = "int.less_eq"; - fn Greater[self: Int(N)](other: Int(N)) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Int(N)](other: Int(N)) -> bool = "int.greater_eq"; + fn Less(self: Int(N), other: Int(N)) -> bool = "int.less"; + fn LessOrEquivalent(self: Int(N), other: Int(N)) -> bool = "int.less_eq"; + fn Greater(self: Int(N), other: Int(N)) -> bool = "int.greater"; + fn GreaterOrEquivalent(self: Int(N), other: Int(N)) -> bool = "int.greater_eq"; } // Arithmetic. @@ -129,86 +129,86 @@ impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as OrderedWith(Int(N)) { final impl forall [N:! IntLiteral] Int(N) as AddWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.sadd"; + fn Op(self, other: Self) -> Self = "int.sadd"; } final impl forall [N:! IntLiteral] Int(N) as DivWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.sdiv"; + fn Op(self, other: Self) -> Self = "int.sdiv"; } final impl forall [N:! IntLiteral] Int(N) as ModWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.smod"; + fn Op(self, other: Self) -> Self = "int.smod"; } final impl forall [N:! IntLiteral] Int(N) as MulWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.smul"; + fn Op(self, other: Self) -> Self = "int.smul"; } final impl forall [N:! IntLiteral] Int(N) as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "int.snegate"; + fn Op(self) -> Self = "int.snegate"; } final impl forall [N:! IntLiteral] Int(N) as SubWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.ssub"; + fn Op(self, other: Self) -> Self = "int.ssub"; } // - Int(N) on left-hand side. impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as AddWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.sadd"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.sadd"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as DivWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.sdiv"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.sdiv"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as ModWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.smod"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.smod"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as MulWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.smul"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.smul"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as SubWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.ssub"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.ssub"; } // - Int(N) on right-hand side. impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as AddWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.sadd"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.sadd"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as DivWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.sdiv"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.sdiv"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as ModWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.smod"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.smod"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as MulWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.smul"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.smul"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as SubWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.ssub"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.ssub"; } // Bitwise operators. @@ -217,138 +217,138 @@ impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] final impl forall [N:! IntLiteral] Int(N) as BitAndWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.and"; + fn Op(self, other: Self) -> Self = "int.and"; } final impl forall [N:! IntLiteral] Int(N) as BitComplement where .Result = Self { - fn Op[self: Self]() -> Self = "int.complement"; + fn Op(self) -> Self = "int.complement"; } final impl forall [N:! IntLiteral] Int(N) as BitOrWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.or"; + fn Op(self, other: Self) -> Self = "int.or"; } final impl forall [N:! IntLiteral] Int(N) as BitXorWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.xor"; + fn Op(self, other: Self) -> Self = "int.xor"; } final impl forall [N:! IntLiteral] Int(N) as LeftShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.left_shift"; + fn Op(self, other: Self) -> Self = "int.left_shift"; } final impl forall [N:! IntLiteral] Int(N) as RightShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.right_shift"; + fn Op(self, other: Self) -> Self = "int.right_shift"; } // - Int(N) on left-hand side. impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitAndWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.and"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.and"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitOrWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.or"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.or"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitXorWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.xor"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.xor"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as LeftShiftWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.left_shift"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.left_shift"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as RightShiftWith(U) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.right_shift"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.right_shift"; } // - Int(N) on right-hand side. impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as BitAndWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.and"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.and"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as BitOrWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.or"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.or"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as BitXorWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.xor"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.xor"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as LeftShiftWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.left_shift"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.left_shift"; } impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as RightShiftWith(Int(N)) where .Result = Int(N) { - fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.right_shift"; + fn Op(self: Int(N), other: Int(N)) -> Int(N) = "int.right_shift"; } // Compound assignments. impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as AddAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.sadd_assign"; + fn Op(ref self, other: Self) = "int.sadd_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitAndAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.and_assign"; + fn Op(ref self, other: Self) = "int.and_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitOrAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.or_assign"; + fn Op(ref self, other: Self) = "int.or_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitXorAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.xor_assign"; + fn Op(ref self, other: Self) = "int.xor_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as DivAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.sdiv_assign"; + fn Op(ref self, other: Self) = "int.sdiv_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as LeftShiftAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.left_shift_assign"; + fn Op(ref self, other: Self) = "int.left_shift_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as ModAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.smod_assign"; + fn Op(ref self, other: Self) = "int.smod_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as MulAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.smul_assign"; + fn Op(ref self, other: Self) = "int.smul_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as RightShiftAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.right_shift_assign"; + fn Op(ref self, other: Self) = "int.right_shift_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as SubAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.ssub_assign"; + fn Op(ref self, other: Self) = "int.ssub_assign"; } // Increment and decrement. @@ -356,7 +356,7 @@ impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] // TODO: Add builtins for these to avoid emitting a call. impl forall [N:! IntLiteral] Int(N) as Dec { - fn Op[ref self: Self]() { + fn Op(ref self) { // TODO: `self -= 1;` should work, but fails because the `impl IntLiteral // as ImplicitAs(Int(N))` is not final, which causes us to not attempt the // conversion from `1` to `Int(N)` until runtime, when we've lost the @@ -367,7 +367,7 @@ impl forall [N:! IntLiteral] Int(N) as Dec { } impl forall [N:! IntLiteral] Int(N) as Inc { - fn Op[ref self: Self]() { + fn Op(ref self) { fn AsInt(n: IntLiteral) -> Int(N) = "int.convert_checked"; self += AsInt(1); } diff --git a/core/prelude/types/optional.carbon b/core/prelude/types/optional.carbon index f8f362e9d6b7..4afbaa8fd85b 100644 --- a/core/prelude/types/optional.carbon +++ b/core/prelude/types/optional.carbon @@ -16,7 +16,7 @@ import library "prelude/types/maybe_unformed"; private interface OptionalStorage { let Type:! type; fn None() -> Type; - fn Some[self: Self]() -> Type; + fn Some(self) -> Type; fn Has(value: Type) -> bool; fn Get(value: Type) -> Self; // Copying can also be performed by Get(value).Some(), but Get returns by @@ -33,10 +33,10 @@ class Optional(T:! OptionalStorage) { fn Some(value: T) -> Self { return value.Some() as Self; } - fn HasValue[self: Self]() -> bool { + fn HasValue(self) -> bool { return T.Has(self as T.Type); } - fn Get[self: Self]() -> T { + fn Get(self) -> T { return T.Get(self as T.Type); } @@ -47,7 +47,7 @@ class Optional(T:! OptionalStorage) { impl forall [T:! OptionalStorage & UnformedInit] Optional(T) as UnformedInit {} impl forall [T:! OptionalStorage] Optional(T) as Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return T.Copy(self as T.Type) as Optional(T); } } @@ -58,33 +58,33 @@ impl forall [T:! OptionalStorage] Optional(T) as Copy { // match_first { // impl forall [T:! OptionalStorage] // T as ImplicitAs(Optional(T)) { -// fn Convert[self: T]() -> Optional(T) { +// fn Convert(self: T) -> Optional(T) { // return Optional(T).Some(self); // } // } // // impl forall [T:! Destroy & OptionalStorage, U:! ImplicitAs(T)] // U as ImplicitAs(Optional(T)) { -// fn Convert[self: U]() -> Optional(T) { +// fn Convert(self: U) -> Optional(T) { // return Optional(T).Some(self.Convert()); // } // } // } private interface OptionalAs(T:! OptionalStorage) { - fn Convert[self: Self]() -> Optional(T); + fn Convert(self) -> Optional(T); } final impl forall [T:! OptionalStorage] T as OptionalAs(T) { - fn Convert[self: Self]() -> Optional(T) { + fn Convert(self) -> Optional(T) { return Optional(T).Some(self); } } impl forall [T:! Destroy & OptionalStorage, U:! ImplicitAs(T)] U as OptionalAs(T) { - fn Convert[self: Self]() -> Optional(T) { + fn Convert(self) -> Optional(T) { return Optional(T).Some(self.Convert()); } } @@ -92,7 +92,7 @@ impl forall [T:! Destroy & OptionalStorage, U:! ImplicitAs(T)] impl forall [T:! Destroy & OptionalStorage, U:! Destroy & OptionalStorage & ImplicitAs(T)] Optional(U) as OptionalAs(T) { - fn Convert[self: Self]() -> Optional(T) { + fn Convert(self) -> Optional(T) { if (self.HasValue()) { return Optional(T).Some(self.Get().Convert()); } @@ -102,7 +102,7 @@ impl forall [T:! Destroy & OptionalStorage, impl forall [T:! OptionalStorage, U:! OptionalAs(T)] U as ImplicitAs(Optional(T)) { - fn Convert[self: Self]() -> Optional(T) { + fn Convert(self) -> Optional(T) { return self.Convert(); } } @@ -128,7 +128,7 @@ impl forall [T:! Copy & Destroy] T as OptionalStorage me.has_value = false; return var; } - fn Some[self: Self]() -> DefaultOptionalStorage(T) { + fn Some(self) -> DefaultOptionalStorage(T) { // TODO: This whole function should be just // return {.value = self, .has_value = true}; // but that requires that `T` implements `ImplicitAs(MaybeUnformed(T))`. @@ -163,7 +163,7 @@ private fn MakeUninitializedOptionalPointer(T:! type) final impl forall [T:! type] T* as OptionalStorage where .Type = MaybeUnformed(T*) { fn None() -> MaybeUnformed(T*) = "pointer.make_null"; - fn Some[self: Self]() -> MaybeUnformed(T*) { + fn Some(self) -> MaybeUnformed(T*) { returned var result: MaybeUnformed(T*) = MakeUninitializedOptionalPointer(T); result unsafe as T* = self; diff --git a/core/prelude/types/string.carbon b/core/prelude/types/string.carbon index 1aec86a46314..a10ccaa9aa99 100644 --- a/core/prelude/types/string.carbon +++ b/core/prelude/types/string.carbon @@ -14,10 +14,10 @@ import library "prelude/types/int"; import library "prelude/operators/as"; class String { - fn Size[self: Self]() -> u64 { return self.size; } + fn Size(self) -> u64 { return self.size; } impl as Copy { - fn Op[self: Self]() -> Self { return {.ptr = self.ptr, .size = self.size}; } + fn Op(self) -> Self { return {.ptr = self.ptr, .size = self.size}; } } // TODO: This should be an array iterator. private var ptr: Char*; @@ -28,5 +28,5 @@ class String { impl String as UnformedInit {} impl forall [T:! ImplicitAs(i64)] String as IndexWith(T) where .ElementType = Char { - fn At[self: Self](subscript: T) -> Char = "string.at"; + fn At(self, subscript: T) -> Char = "string.at"; } diff --git a/core/prelude/types/uint.carbon b/core/prelude/types/uint.carbon index f58febeba536..852f7f034c6b 100644 --- a/core/prelude/types/uint.carbon +++ b/core/prelude/types/uint.carbon @@ -23,28 +23,28 @@ impl forall [N:! IntLiteral] UInt(N) as UnformedInit {} // Copy. impl forall [N:! IntLiteral] UInt(N) as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } // Conversions. impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(UInt(To)) { - fn Convert[self: Self]() -> UInt(To) = "int.convert_checked"; + fn Convert(self) -> UInt(To) = "int.convert_checked"; } final impl forall [From:! IntLiteral] UInt(From) as ImplicitAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. For now we need them because // the forwarding impl of As in terms of ImplicitAs is not usable at compile // time. impl forall [To:! IntLiteral] IntLiteral as As(UInt(To)) { - fn Convert[self: Self]() -> UInt(To) = "int.convert_checked"; + fn Convert(self) -> UInt(To) = "int.convert_checked"; } final impl forall [From:! IntLiteral] UInt(From) as As(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // Work around the inability to put a `where` clause on a generic parameter of @@ -52,11 +52,11 @@ final impl forall [From:! IntLiteral] UInt(From) as As(IntLiteral) { // TODO: Remove this once possible. private interface AnyUInt { let Width:! IntLiteral; - fn AsUInt[self: Self]() -> UInt(Width); + fn AsUInt(self) -> UInt(Width); } impl forall [N:! IntLiteral] UInt(N) as AnyUInt where .Width = N { - fn AsUInt[self: Self]() -> Self { return self; } + fn AsUInt(self) -> Self { return self; } } // Work around the inability to apply constraints to an impl that is only @@ -84,28 +84,28 @@ impl forall [To:! IntLiteral, From:! AnyUInt & IntFitsIn(Int(To))] impl forall [From:! IntLiteral, To:! FromUInt(UInt(From))] UInt(From) as ImplicitAs(To) { - fn Convert[self: Self]() -> To { + fn Convert(self) -> To { return To.Convert(self); } } final impl forall [From:! IntLiteral, To:! IntLiteral] UInt(From) as As(UInt(To)) { - fn Convert[self: Self]() -> UInt(To) = "int.convert"; + fn Convert(self) -> UInt(To) = "int.convert"; } final impl forall [From:! IntLiteral, To:! IntLiteral] UInt(From) as As(Int(To)) { - fn Convert[self: Self]() -> Int(To) = "int.convert"; + fn Convert(self) -> Int(To) = "int.convert"; } // Never implicit. impl forall [From:! IntLiteral, To:! IntLiteral] Int(From) as As(UInt(To)) { - fn Convert[self: Self]() -> UInt(To) = "int.convert"; + fn Convert(self) -> UInt(To) = "int.convert"; } // Explicit conversion from floating-point literals. impl forall [To:! IntLiteral] FloatLiteral as UnsafeAs(UInt(To)) { - fn Convert[self: Self]() -> UInt(To) = "float.convert_int"; + fn Convert(self) -> UInt(To) = "float.convert_int"; } // Comparisons. @@ -113,76 +113,76 @@ impl forall [To:! IntLiteral] // - UInt(N) vs UInt(M). final impl forall [N:! IntLiteral, M:! IntLiteral] UInt(N) as EqWith(UInt(M)) { - fn Equal[self: Self](other: UInt(M)) -> bool = "int.eq"; - fn NotEqual[self: Self](other: UInt(M)) -> bool = "int.neq"; + fn Equal(self, other: UInt(M)) -> bool = "int.eq"; + fn NotEqual(self, other: UInt(M)) -> bool = "int.neq"; } final impl forall [N:! IntLiteral, M:! IntLiteral] UInt(N) as OrderedWith(UInt(M)) { // TODO: fn Compare - fn Less[self: Self](other: UInt(M)) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: UInt(M)) -> bool = "int.less_eq"; - fn Greater[self: Self](other: UInt(M)) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: UInt(M)) -> bool = "int.greater_eq"; + fn Less(self, other: UInt(M)) -> bool = "int.less"; + fn LessOrEquivalent(self, other: UInt(M)) -> bool = "int.less_eq"; + fn Greater(self, other: UInt(M)) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: UInt(M)) -> bool = "int.greater_eq"; } // - UInt(N) vs Int(M). final impl forall [N:! IntLiteral, M:! IntLiteral] UInt(N) as EqWith(Int(M)) { - fn Equal[self: Self](other: Int(M)) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Int(M)) -> bool = "int.neq"; + fn Equal(self, other: Int(M)) -> bool = "int.eq"; + fn NotEqual(self, other: Int(M)) -> bool = "int.neq"; } final impl forall [N:! IntLiteral, M:! IntLiteral] UInt(N) as OrderedWith(Int(M)) { // TODO: fn Compare - fn Less[self: Self](other: Int(M)) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Int(M)) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Int(M)) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Int(M)) -> bool = "int.greater_eq"; + fn Less(self, other: Int(M)) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Int(M)) -> bool = "int.less_eq"; + fn Greater(self, other: Int(M)) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Int(M)) -> bool = "int.greater_eq"; } // - Int(N) vs UInt(M). impl forall [N:! IntLiteral, M:! IntLiteral] Int(N) as EqWith(UInt(M)) { - fn Equal[self: Self](other: UInt(M)) -> bool = "int.eq"; - fn NotEqual[self: Self](other: UInt(M)) -> bool = "int.neq"; + fn Equal(self, other: UInt(M)) -> bool = "int.eq"; + fn NotEqual(self, other: UInt(M)) -> bool = "int.neq"; } impl forall [N:! IntLiteral, M:! IntLiteral] Int(N) as OrderedWith(UInt(M)) { // TODO: fn Compare - fn Less[self: Self](other: UInt(M)) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: UInt(M)) -> bool = "int.less_eq"; - fn Greater[self: Self](other: UInt(M)) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: UInt(M)) -> bool = "int.greater_eq"; + fn Less(self, other: UInt(M)) -> bool = "int.less"; + fn LessOrEquivalent(self, other: UInt(M)) -> bool = "int.less_eq"; + fn Greater(self, other: UInt(M)) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: UInt(M)) -> bool = "int.greater_eq"; } // - UInt(N) on left-hand side. impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] UInt(N) as EqWith(T) { - fn Equal[self: Self](other: Self) -> bool = "int.eq"; - fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; + fn Equal(self, other: Self) -> bool = "int.eq"; + fn NotEqual(self, other: Self) -> bool = "int.neq"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] UInt(N) as OrderedWith(T) { // TODO: fn Compare - fn Less[self: Self](other: Self) -> bool = "int.less"; - fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; - fn Greater[self: Self](other: Self) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool = "int.greater_eq"; + fn Less(self, other: Self) -> bool = "int.less"; + fn LessOrEquivalent(self, other: Self) -> bool = "int.less_eq"; + fn Greater(self, other: Self) -> bool = "int.greater"; + fn GreaterOrEquivalent(self, other: Self) -> bool = "int.greater_eq"; } // - UInt(N) on right-hand side. impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as EqWith(UInt(N)) { - fn Equal[self: UInt(N)](other: UInt(N)) -> bool = "int.eq"; - fn NotEqual[self: UInt(N)](other: UInt(N)) -> bool = "int.neq"; + fn Equal(self: UInt(N), other: UInt(N)) -> bool = "int.eq"; + fn NotEqual(self: UInt(N), other: UInt(N)) -> bool = "int.neq"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as OrderedWith(UInt(N)) { // TODO: fn Compare - fn Less[self: UInt(N)](other: UInt(N)) -> bool = "int.less"; - fn LessOrEquivalent[self: UInt(N)](other: UInt(N)) -> bool = "int.less_eq"; - fn Greater[self: UInt(N)](other: UInt(N)) -> bool = "int.greater"; - fn GreaterOrEquivalent[self: UInt(N)](other: UInt(N)) -> bool = "int.greater_eq"; + fn Less(self: UInt(N), other: UInt(N)) -> bool = "int.less"; + fn LessOrEquivalent(self: UInt(N), other: UInt(N)) -> bool = "int.less_eq"; + fn Greater(self: UInt(N), other: UInt(N)) -> bool = "int.greater"; + fn GreaterOrEquivalent(self: UInt(N), other: UInt(N)) -> bool = "int.greater_eq"; } // Arithmetic. @@ -191,86 +191,86 @@ impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as OrderedWith(UInt(N)) final impl forall [N:! IntLiteral] UInt(N) as AddWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.uadd"; + fn Op(self, other: Self) -> Self = "int.uadd"; } final impl forall [N:! IntLiteral] UInt(N) as DivWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.udiv"; + fn Op(self, other: Self) -> Self = "int.udiv"; } final impl forall [N:! IntLiteral] UInt(N) as ModWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.umod"; + fn Op(self, other: Self) -> Self = "int.umod"; } final impl forall [N:! IntLiteral] UInt(N) as MulWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.umul"; + fn Op(self, other: Self) -> Self = "int.umul"; } final impl forall [N:! IntLiteral] UInt(N) as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "int.unegate"; + fn Op(self) -> Self = "int.unegate"; } final impl forall [N:! IntLiteral] UInt(N) as SubWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.usub"; + fn Op(self, other: Self) -> Self = "int.usub"; } // - UInt(N) on left-hand side. impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as AddWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.uadd"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.uadd"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as DivWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.udiv"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.udiv"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as ModWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.umod"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.umod"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as MulWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.umul"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.umul"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as SubWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.usub"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.usub"; } // - UInt(N) on right-hand side. impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as AddWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.uadd"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.uadd"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as DivWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.udiv"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.udiv"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as ModWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.umod"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.umod"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as MulWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.umul"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.umul"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as SubWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.usub"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.usub"; } // Bitwise operators. @@ -279,138 +279,138 @@ impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] final impl forall [N:! IntLiteral] UInt(N) as BitAndWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.and"; + fn Op(self, other: Self) -> Self = "int.and"; } final impl forall [N:! IntLiteral] UInt(N) as BitComplement where .Result = Self { - fn Op[self: Self]() -> Self = "int.complement"; + fn Op(self) -> Self = "int.complement"; } final impl forall [N:! IntLiteral] UInt(N) as BitOrWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.or"; + fn Op(self, other: Self) -> Self = "int.or"; } final impl forall [N:! IntLiteral] UInt(N) as BitXorWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.xor"; + fn Op(self, other: Self) -> Self = "int.xor"; } final impl forall [N:! IntLiteral] UInt(N) as LeftShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.left_shift"; + fn Op(self, other: Self) -> Self = "int.left_shift"; } final impl forall [N:! IntLiteral] UInt(N) as RightShiftWith(Self) where .Result = Self { - fn Op[self: Self](other: Self) -> Self = "int.right_shift"; + fn Op(self, other: Self) -> Self = "int.right_shift"; } // - UInt(N) on left-hand side. impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitAndWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.and"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.and"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitOrWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.or"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.or"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitXorWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.xor"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.xor"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as LeftShiftWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.left_shift"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.left_shift"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as RightShiftWith(U) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.right_shift"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.right_shift"; } // - UInt(N) on right-hand side. impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as BitAndWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.and"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.and"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as BitOrWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.or"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.or"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as BitXorWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.xor"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.xor"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as LeftShiftWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.left_shift"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.left_shift"; } impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as RightShiftWith(UInt(N)) where .Result = UInt(N) { - fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.right_shift"; + fn Op(self: UInt(N), other: UInt(N)) -> UInt(N) = "int.right_shift"; } // Compound assignments. impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as AddAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.uadd_assign"; + fn Op(ref self, other: Self) = "int.uadd_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitAndAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.and_assign"; + fn Op(ref self, other: Self) = "int.and_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitOrAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.or_assign"; + fn Op(ref self, other: Self) = "int.or_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitXorAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.xor_assign"; + fn Op(ref self, other: Self) = "int.xor_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as DivAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.udiv_assign"; + fn Op(ref self, other: Self) = "int.udiv_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as LeftShiftAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.left_shift_assign"; + fn Op(ref self, other: Self) = "int.left_shift_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as ModAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.umod_assign"; + fn Op(ref self, other: Self) = "int.umod_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as MulAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.umul_assign"; + fn Op(ref self, other: Self) = "int.umul_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as RightShiftAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.right_shift_assign"; + fn Op(ref self, other: Self) = "int.right_shift_assign"; } impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as SubAssignWith(U) { - fn Op[ref self: Self](other: Self) = "int.usub_assign"; + fn Op(ref self, other: Self) = "int.usub_assign"; } // Increment and decrement. @@ -418,7 +418,7 @@ impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] // TODO: Add builtins for these to avoid emitting a call. impl forall [N:! IntLiteral] UInt(N) as Dec { - fn Op[ref self: Self]() { + fn Op(ref self) { // TODO: `self -= 1;` should work, but fails because the `impl IntLiteral // as ImplicitAs(Int(N))` is not final, which causes us to not attempt the // conversion from `1` to `Int(N)` until runtime, when we've lost the @@ -429,7 +429,7 @@ impl forall [N:! IntLiteral] UInt(N) as Dec { } impl forall [N:! IntLiteral] UInt(N) as Inc { - fn Op[ref self: Self]() { + fn Op(ref self) { fn AsUInt(n: IntLiteral) -> UInt(N) = "int.convert_checked"; self += AsUInt(1); } diff --git a/core/range.carbon b/core/range.carbon index a5a3e3c05627..b9524183f47f 100644 --- a/core/range.carbon +++ b/core/range.carbon @@ -22,8 +22,8 @@ class IntRange(N:! IntLiteral) { } impl as Iterate where .CursorType = Int(N) and .ElementType = Int(N) { - fn NewCursor[self: Self]() -> Int(N) { return self.start; } - fn Next[self: Self](cursor: Int(N)*) -> Optional(Int(N)) { + fn NewCursor(self) -> Int(N) { return self.start; } + fn Next(self, cursor: Int(N)*) -> Optional(Int(N)) { var value: Int(N) = *cursor; if (value < self.end) { ++*cursor; diff --git a/docs/design/assignment.md b/docs/design/assignment.md index 39605707c710..7441cf6ceb41 100644 --- a/docs/design/assignment.md +++ b/docs/design/assignment.md @@ -74,7 +74,7 @@ standard library. The operands of these operators can be any [expression](expressions/README.md). However, the first operand must be modifiable because it is passed to a -`[ref self: Self]` parameter, which disallows most expression forms other than: +`(ref self: Self)` parameter, which disallows most expression forms other than: - The name of a `var` binding. - A dereference of a pointer. diff --git a/docs/design/generics/details.md b/docs/design/generics/details.md index 189907e22f5d..90b02d35b45a 100644 --- a/docs/design/generics/details.md +++ b/docs/design/generics/details.md @@ -6630,7 +6630,7 @@ example, this `Set(T)` type may be compared to anything implementing the ```carbon class Set(T:! Ordered) { - fn Less[U:! Container with .ElementType = T, self: Self](u: U) -> bool; + fn Less[U:! Container with .ElementType = T](self, u: U) -> bool; // ... } ``` @@ -6648,7 +6648,7 @@ its elements implement the `Ordered` interface: ```carbon class DynArray(T:! type) { // `DynArray(T)` has a `Sort()` method if `T impls Ordered`. - fn Sort[C:! Ordered, ref self: DynArray(C)](); + fn Sort[C:! Ordered](ref self: DynArray(C)); } ``` diff --git a/examples/advent2024/day10_part1.carbon b/examples/advent2024/day10_part1.carbon index 415ffcb1f8c2..e9360d3c7b5c 100644 --- a/examples/advent2024/day10_part1.carbon +++ b/examples/advent2024/day10_part1.carbon @@ -40,7 +40,7 @@ class Reachable { return var; } - fn AddLevel[ref self: Self](terrain: Terrain, level: i32) { + fn AddLevel(ref self, terrain: Terrain, level: i32) { let adj: array((i32, i32), 4) = ((-1, 0), (0, -1), (1, 0), (0, 1)); for (y: i32 in Core.Range(43)) { for (x: i32 in Core.Range(43)) { @@ -63,7 +63,7 @@ class Reachable { } } - fn Count[self: Self](terrain: Terrain, level: i32) -> i32 { + fn Count(self, terrain: Terrain, level: i32) -> i32 { var total: i32 = 0; for (y: i32 in Core.Range(43)) { for (x: i32 in Core.Range(43)) { diff --git a/examples/advent2024/day10_part2.carbon b/examples/advent2024/day10_part2.carbon index 7be36ffc047e..8318afbd4de8 100644 --- a/examples/advent2024/day10_part2.carbon +++ b/examples/advent2024/day10_part2.carbon @@ -25,7 +25,7 @@ class PathsToTop { return var; } - fn AddLevel[ref self: Self](terrain: Terrain, level: i32) -> i64 { + fn AddLevel(ref self, terrain: Terrain, level: i32) -> i64 { var total: i64 = 0; let adj: array((i32, i32), 4) = ((-1, 0), (0, -1), (1, 0), (0, 1)); for (y: i32 in Core.Range(43)) { diff --git a/examples/advent2024/day11_part2.carbon b/examples/advent2024/day11_part2.carbon index f8a87dc3b825..63c5e21339a7 100644 --- a/examples/advent2024/day11_part2.carbon +++ b/examples/advent2024/day11_part2.carbon @@ -23,7 +23,7 @@ class Digits { return var; } - fn Print[self: Self](max_depth: i32) { + fn Print(self, max_depth: i32) { for (digit: i32 in Core.Range(10)) { Core.PrintChar(((digit + 0x30) as u8) as char); Core.PrintChar(':'); diff --git a/examples/advent2024/day12_common.carbon b/examples/advent2024/day12_common.carbon index 21e139e49f9d..3d3e1799a53e 100644 --- a/examples/advent2024/day12_common.carbon +++ b/examples/advent2024/day12_common.carbon @@ -24,7 +24,7 @@ class Map { return var; } - fn At[self: Self](x: i32, y: i32) -> i32 { + fn At(self, x: i32, y: i32) -> i32 { return if x < 0 or x >= 140 or y < 0 or y >= 140 then -1 else self.kind[x][y]; @@ -46,7 +46,7 @@ class DisjointSetForest { return var; } - fn Lookup[ref self: Self](a: i32) -> i32 { + fn Lookup(ref self, a: i32) -> i32 { let next: i32 = self.nodes[a].next; if (next == a) { return next; @@ -56,21 +56,21 @@ class DisjointSetForest { return resolved; } - fn Unions[self: Self](canon_a: i32) -> i32 { + fn Unions(self, canon_a: i32) -> i32 { return self.nodes[canon_a].unions; } - fn Weight[self: Self](canon_a: i32) -> i32 { + fn Weight(self, canon_a: i32) -> i32 { return self.nodes[canon_a].weight; } - fn Union[ref self: Self](a: i32, b: i32) { + fn Union(ref self, a: i32, b: i32) { let canon_b: i32 = self.Lookup(b); self.Set(a, canon_b); ++self.nodes[canon_b].unions; } - private fn Set[ref self: Self](a: i32, canon_b: i32) { + private fn Set(ref self, a: i32, canon_b: i32) { let next: i32 = self.nodes[a].next; self.nodes[a].next = canon_b; if (next == a) { diff --git a/examples/advent2024/day13_common.carbon b/examples/advent2024/day13_common.carbon index 97e4a4a83fa5..27b3b05bb716 100644 --- a/examples/advent2024/day13_common.carbon +++ b/examples/advent2024/day13_common.carbon @@ -85,11 +85,11 @@ class BezoutSolutionSet { .m_step = b_over_gcd, .n_step = -a_over_gcd}; } - fn Valid[self: Self]() -> bool { + fn Valid(self) -> bool { return self.m_step >= 0; } - fn Solution[self: Self](k: i64) -> (i64, i64) { + fn Solution(self, k: i64) -> (i64, i64) { return (self.m0 + k * self.m_step, self.n0 + k * self.n_step); } diff --git a/examples/advent2024/day14_common.carbon b/examples/advent2024/day14_common.carbon index b7d2f6164ddb..596e1b3f92dc 100644 --- a/examples/advent2024/day14_common.carbon +++ b/examples/advent2024/day14_common.carbon @@ -35,13 +35,13 @@ class Robot { return var; } - fn Pos[self: Self](t: i32) -> (i32, i32) { + fn Pos(self, t: i32) -> (i32, i32) { return (Mod((self.p.0 + self.v.0 * Mod(t, 101)), 101), Mod((self.p.1 + self.v.1 * Mod(t, 103)), 103)); } impl as Core.Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return {.p = self.p, .v = self.v}; } } diff --git a/examples/advent2024/day15_common.carbon b/examples/advent2024/day15_common.carbon index 8f22adf376de..e59cbee01aab 100644 --- a/examples/advent2024/day15_common.carbon +++ b/examples/advent2024/day15_common.carbon @@ -14,16 +14,16 @@ class Square { adapt char; impl as Core.Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return (self as char).(Core.Copy.Op)() as Self; } } impl as Core.EqWith(Square) { - fn Equal[self: Self](other: Self) -> bool { + fn Equal(self, other: Self) -> bool { // TODO: Use a `char` comparison when it's supported. return (self as u8) == (other as u8); } - fn NotEqual[self: Self](other: Self) -> bool { + fn NotEqual(self, other: Self) -> bool { // TODO: Use a `char` comparison when it's supported. return (self as u8) != (other as u8); } @@ -65,7 +65,7 @@ class Grid { return var; } - fn Move[ref self: Self](d: (i32, i32)) { + fn Move(ref self, d: (i32, i32)) { var distance: i32 = 1; while (self.data[self.robot.0 + distance * d.0][self.robot.1 + distance * d.1] == Box) { ++distance; @@ -79,7 +79,7 @@ class Grid { } } - fn Print[self: Self]() { + fn Print(self) { var y: i32 = 0; while (y < 50) { var x: i32 = 0; @@ -93,7 +93,7 @@ class Grid { Core.PrintChar('\n'); } - fn Signature[self: Self]() -> i32 { + fn Signature(self) -> i32 { var s: i32 = 0; var y: i32 = 0; while (y < 50) { diff --git a/examples/advent2024/day2_part1.carbon b/examples/advent2024/day2_part1.carbon index 6fecd096cbb8..a708db0d10a0 100644 --- a/examples/advent2024/day2_part1.carbon +++ b/examples/advent2024/day2_part1.carbon @@ -15,7 +15,7 @@ class ReportState { .increasing = false, .safe_so_far = true}; } - fn Add[ref self: Self](level: i32) { + fn Add(ref self, level: i32) { ++self.levels_so_far; if (self.levels_so_far >= 2) { if (not IsSafeDelta(self.previous, level)) { diff --git a/examples/advent2024/day2_part2.carbon b/examples/advent2024/day2_part2.carbon index d734e3e56265..d451cca14f36 100644 --- a/examples/advent2024/day2_part2.carbon +++ b/examples/advent2024/day2_part2.carbon @@ -12,7 +12,7 @@ import library "io_utils"; // A three-element sliding window of recent levels. class Window { fn Make() -> Window { return {.data = (0,0,0), .size = 0}; } - fn Add[ref self: Self](n: i32) { + fn Add(ref self, n: i32) { self.data[2] = self.data[1]; self.data[1] = self.data[0]; self.data[0] = n; @@ -36,7 +36,7 @@ class ReportState { .removable_double_bad_edge = false}; } - fn OnAdd[ref self: Self](window: Window) { + fn OnAdd(ref self, window: Window) { if (window.size < 2) { return; } @@ -75,7 +75,7 @@ class ReportState { } } - fn OnFinish[ref self: Self](window: Window) { + fn OnFinish(ref self, window: Window) { if (window.size >= 2 and not IsSafe(window.data[1], window.data[0], self.increasing)) { // We have a removable single bad edge if the last edge is unsafe. @@ -83,7 +83,7 @@ class ReportState { } } - fn IsSafeWithRemoval[self: Self]() -> bool { + fn IsSafeWithRemoval(self) -> bool { return self.bad_edges == 0 or (self.bad_edges == 1 and self.removable_single_bad_edge) or (self.bad_edges == 2 and self.removable_double_bad_edge); diff --git a/examples/advent2024/day4_common.carbon b/examples/advent2024/day4_common.carbon index 22ec0b27f70d..681ae1f977bc 100644 --- a/examples/advent2024/day4_common.carbon +++ b/examples/advent2024/day4_common.carbon @@ -29,12 +29,12 @@ class Wordsearch { return var; } - fn At[self: Self](x: i32, y: i32) -> i32 { + fn At(self, x: i32, y: i32) -> i32 { return if x < 0 or x >= 140 or y < 0 or y >= 140 then -1 else self.grid[x][y]; } // TODO: Make this generic in the length of the search query. - fn Check4[self: Self](xmas: array(i32, 4), x: i32, y: i32, dx: i32, dy: i32) -> bool { + fn Check4(self, xmas: array(i32, 4), x: i32, y: i32, dx: i32, dy: i32) -> bool { var i: i32 = 0; while (i < 4) { if (self.At(x + i * dx, y + i * dy) != xmas[i]) { @@ -45,7 +45,7 @@ class Wordsearch { return true; } - fn Check3[self: Self](mas: array(i32, 3), x: i32, y: i32, dx: i32, dy: i32) -> bool { + fn Check3(self, mas: array(i32, 3), x: i32, y: i32, dx: i32, dy: i32) -> bool { var i: i32 = 0; while (i < 3) { if (self.At(x + i * dx, y + i * dy) != mas[i]) { diff --git a/examples/advent2024/day5_common.carbon b/examples/advent2024/day5_common.carbon index b53c40d76793..a655f87b47eb 100644 --- a/examples/advent2024/day5_common.carbon +++ b/examples/advent2024/day5_common.carbon @@ -33,7 +33,7 @@ class Rules { return var; } - fn IsValidOrder[self: Self](a: i32, b: i32) -> bool { + fn IsValidOrder(self, a: i32, b: i32) -> bool { return self.disallowed_before[b] & PageMask(a) == 0; } @@ -65,12 +65,12 @@ class PageList { return var; } - fn Add[ref self: Self](page: i32) { + fn Add(ref self, page: i32) { self.pages[self.num_pages] = page; ++self.num_pages; } - fn FollowsRules[self: Self](rules: Rules) -> bool { + fn FollowsRules(self, rules: Rules) -> bool { var seen: Core.UInt(100) = 0; for (i: i32 in Core.Range(self.num_pages)) { let page: i32 = self.pages[i]; @@ -82,7 +82,7 @@ class PageList { return true; } - fn IsPossibleFirstPage[self: Self](rules: Rules, page: i32) -> bool { + fn IsPossibleFirstPage(self, rules: Rules, page: i32) -> bool { for (i: i32 in Core.Range(self.num_pages)) { if (not rules.IsValidOrder(page, self.pages[i])) { return false; @@ -91,7 +91,7 @@ class PageList { return true; } - fn ExtractPossibleFirstPage[ref self: Self](rules: Rules) -> i32 { + fn ExtractPossibleFirstPage(ref self, rules: Rules) -> i32 { for (i: i32 in Core.Range(self.num_pages)) { var page: i32 = self.pages[i]; if (self.IsPossibleFirstPage(rules, page)) { @@ -104,7 +104,7 @@ class PageList { return 0; } - fn MiddlePage[self: Self]() -> i32 { + fn MiddlePage(self) -> i32 { return self.pages[self.num_pages / 2]; } diff --git a/examples/advent2024/day6_common.carbon b/examples/advent2024/day6_common.carbon index 846203b8ddb2..6a7525ecedb7 100644 --- a/examples/advent2024/day6_common.carbon +++ b/examples/advent2024/day6_common.carbon @@ -43,7 +43,7 @@ class Maze { return var; } - fn Copy[self: Self]() -> Maze { + fn Copy(self) -> Maze { returned var copy: Maze; var y: i32 = 0; while (y < 130) { @@ -59,7 +59,7 @@ class Maze { return var; } - fn Step[ref self: Self]() -> bool { + fn Step(ref self) -> bool { let x: i32 = self.loc.0 + self.dir.0; let y: i32 = self.loc.1 + self.dir.1; if (x < 0 or x >= 130 or y < 0 or y >= 130) { @@ -77,7 +77,7 @@ class Maze { return true; } - fn AddObstacle[ref self: Self]() -> bool { + fn AddObstacle(ref self) -> bool { let x: i32 = self.loc.0 + self.dir.0; let y: i32 = self.loc.1 + self.dir.1; if (x < 0 or x >= 130 or y < 0 or y >= 130) { @@ -90,7 +90,7 @@ class Maze { return true; } - fn CountVisited[self: Self]() -> i32 { + fn CountVisited(self) -> i32 { var total: i32 = 0; var y: i32 = 0; while (y < 130) { diff --git a/examples/advent2024/day6_part2.carbon b/examples/advent2024/day6_part2.carbon index d7d96dbd0bab..472035585625 100644 --- a/examples/advent2024/day6_part2.carbon +++ b/examples/advent2024/day6_part2.carbon @@ -13,7 +13,7 @@ class LoopDetector { return {.last = ((-1, -1), (-1, -1)), .steps = 1, .next_steps = 1}; } - fn Check[ref self: Self](next: ((i32, i32), (i32, i32))) -> bool { + fn Check(ref self, next: ((i32, i32), (i32, i32))) -> bool { // TODO: if (next == self.last) { if (next.0.0 == self.last.0.0 and next.0.1 == self.last.0.1 and next.1.0 == self.last.1.0 and next.1.1 == self.last.1.1) { diff --git a/examples/advent2024/day7_common.carbon b/examples/advent2024/day7_common.carbon index 63954151018f..91dd6182f7bb 100644 --- a/examples/advent2024/day7_common.carbon +++ b/examples/advent2024/day7_common.carbon @@ -38,7 +38,7 @@ class Equation { return var; } - fn SolveFrom[self: Self](start: i32, value: i64, concat: bool) -> bool { + fn SolveFrom(self, start: i32, value: i64, concat: bool) -> bool { if (value > self.result) { return false; } @@ -50,7 +50,7 @@ class Equation { (concat and self.SolveFrom(start + 1, Concat(value, self.operands[start]), true)); } - fn Solve[self: Self](concat: bool) -> bool { + fn Solve(self, concat: bool) -> bool { return self.SolveFrom(1, self.operands[0], concat); } diff --git a/examples/advent2024/day9_common.carbon b/examples/advent2024/day9_common.carbon index 4f2e85c5449f..306e24e28a1f 100644 --- a/examples/advent2024/day9_common.carbon +++ b/examples/advent2024/day9_common.carbon @@ -35,7 +35,7 @@ class SectorList { return var; } - fn DefragBlocks[ref self: Self]() { + fn DefragBlocks(ref self) { var i: i32 = 0; var j: i32 = self.size - 1; while (j > i) { @@ -52,7 +52,7 @@ class SectorList { self.size = j; } - fn HasSpace[ref self: Self](start: i32, size: i32) -> bool { + fn HasSpace(ref self, start: i32, size: i32) -> bool { for (i: i32 in Core.InclusiveRange(start, start + size - 1)) { if (self.data[i] != -1) { return false; @@ -61,13 +61,13 @@ class SectorList { return true; } - fn Fill[ref self: Self](start: i32, size: i32, sector: i32) { + fn Fill(ref self, start: i32, size: i32, sector: i32) { for (i: i32 in Core.InclusiveRange(start, start + size - 1)) { self.data[i] = sector; } } - fn DefragFiles[ref self: Self]() { + fn DefragFiles(ref self) { var j: i32 = self.size - 1; while (j >= 0) { // Skip empty sectors. @@ -101,7 +101,7 @@ class SectorList { } } - fn Checksum[self: Self]() -> i64 { + fn Checksum(self) -> i64 { var total: i64 = 0; for (i: i32 in Core.Range(self.size)) { if (self.data[i] != -1) { diff --git a/examples/advent2024/io_utils.carbon b/examples/advent2024/io_utils.carbon index 5b4fa0e0fbf8..35227d3294b3 100644 --- a/examples/advent2024/io_utils.carbon +++ b/examples/advent2024/io_utils.carbon @@ -16,7 +16,7 @@ class CharOrEOF { } impl CharOrEOF as Core.Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return (self as i32).(Core.Copy.Op)() as Self; } } @@ -28,40 +28,40 @@ fn CharOrEOF.EOF() -> Self { } impl forall [U:! Core.ImplicitAs(char)] U as Core.ImplicitAs(CharOrEOF) { - fn Convert[self: char]() -> CharOrEOF { + fn Convert(self: char) -> CharOrEOF { return ((self as u8) as i32) as CharOrEOF; } } impl forall [U:! Core.ImplicitAs(CharOrEOF)] CharOrEOF as Core.EqWith(U) { - fn Equal[self: Self](other: CharOrEOF) -> bool { + fn Equal(self, other: CharOrEOF) -> bool { return (self as i32) == (other as i32); } - fn NotEqual[self: Self](other: CharOrEOF) -> bool { + fn NotEqual(self, other: CharOrEOF) -> bool { return (self as i32) != (other as i32); } } impl forall [U:! Core.ImplicitAs(CharOrEOF)] CharOrEOF as Core.OrderedWith(U) { - fn Less[self: Self](other: CharOrEOF) -> bool { + fn Less(self, other: CharOrEOF) -> bool { return (self as i32) < (other as i32); } - fn LessOrEquivalent[self: Self](other: CharOrEOF) -> bool { + fn LessOrEquivalent(self, other: CharOrEOF) -> bool { return (self as i32) <= (other as i32); } - fn Greater[self: Self](other: CharOrEOF) -> bool { + fn Greater(self, other: CharOrEOF) -> bool { return (self as i32) > (other as i32); } - fn GreaterOrEquivalent[self: Self](other: CharOrEOF) -> bool { + fn GreaterOrEquivalent(self, other: CharOrEOF) -> bool { return (self as i32) >= (other as i32); } } impl forall [U:! Core.ImplicitAs(char)] CharOrEOF as Core.SubWith(U) where .Result = i32 { - fn Op[self: Self](other: char) -> i32 { + fn Op(self, other: char) -> i32 { return (self as i32) - ((other as u8) as i32); } } diff --git a/examples/advent2024/sort.carbon b/examples/advent2024/sort.carbon index 25a34cd5974d..3e739ca400f6 100644 --- a/examples/advent2024/sort.carbon +++ b/examples/advent2024/sort.carbon @@ -6,17 +6,17 @@ library "sort"; interface Ordered { // extend require impls Core.OrderedWith(Self); - fn Less[self: Self](other: Self) -> bool; - fn LessOrEquivalent[self: Self](other: Self) -> bool; - fn Greater[self: Self](other: Self) -> bool; - fn GreaterOrEquivalent[self: Self](other: Self) -> bool; + fn Less(self, other: Self) -> bool; + fn LessOrEquivalent(self, other: Self) -> bool; + fn Greater(self, other: Self) -> bool; + fn GreaterOrEquivalent(self, other: Self) -> bool; } impl i32 as Ordered { - fn Less[self: Self](other: Self) -> bool { return self < other; } - fn LessOrEquivalent[self: Self](other: Self) -> bool { return self <= other; } - fn Greater[self: Self](other: Self) -> bool { return self > other; } - fn GreaterOrEquivalent[self: Self](other: Self) -> bool { return self >= other; } + fn Less(self, other: Self) -> bool { return self < other; } + fn LessOrEquivalent(self, other: Self) -> bool { return self <= other; } + fn Greater(self, other: Self) -> bool { return self > other; } + fn GreaterOrEquivalent(self, other: Self) -> bool { return self >= other; } } fn Swap[T:! Core.Copy & Core.Destroy](ref from: T, ref to: T) { diff --git a/examples/re2_playground/re2_playground.carbon b/examples/re2_playground/re2_playground.carbon index e1a770efe813..85ac12cc4050 100644 --- a/examples/re2_playground/re2_playground.carbon +++ b/examples/re2_playground/re2_playground.carbon @@ -16,13 +16,13 @@ class RE2 { fn Make(re: str) -> Self { return RE2(re) as Self; } - fn Match[self: Self](text: str) -> bool { + fn Match(self, text: str) -> bool { return FullMatch(text, self as Cpp.re2.RE2); } } impl str as Core.ImplicitAs(Cpp.llvm.StringRef) { - fn Convert[self: Self]() -> Cpp.llvm.StringRef { + fn Convert(self) -> Cpp.llvm.StringRef { return Cpp.llvm.StringRef.StringRef(self); } } diff --git a/examples/sieve.carbon b/examples/sieve.carbon index 5266fb35b2f2..ec6f581083aa 100644 --- a/examples/sieve.carbon +++ b/examples/sieve.carbon @@ -18,7 +18,7 @@ class Sieve { return var; } - fn MarkMultiplesNotPrime[ref self: Self](p: i32) { + fn MarkMultiplesNotPrime(ref self, p: i32) { var n: i32 = p * 2; while (n < 1000) { self.is_prime[n] = false; diff --git a/third_party/examples/re2/re2.carbon b/third_party/examples/re2/re2.carbon index 250335a33375..dc2b771fa8b2 100644 --- a/third_party/examples/re2/re2.carbon +++ b/third_party/examples/re2/re2.carbon @@ -290,52 +290,52 @@ class RE2 { // TODO: Should a Carbonic RE2 support these? impl StringView as ImplicitAs(RE2) { - fn Convert[self: Self]() -> RE2 { return Make(self); } + fn Convert(self) -> RE2 { return Make(self); } } impl String as ImplicitAs(RE2) { - fn Convert[self: Self]() -> RE2 { return Make(self); } + fn Convert(self) -> RE2 { return Make(self); } } impl StringPiece as ImplicitAs(RE2) { - fn Convert[self: Self]() -> RE2 { return Make(self); } + fn Convert(self) -> RE2 { return Make(self); } } impl as Destroyable; // Returns whether RE2 was created properly. - fn ok[self: Self]() -> bool { return self.error_code() == ErrorCode.NoError; } + fn ok(self) -> bool { return self.error_code() == ErrorCode.NoError; } // The string specification for this RE2. E.g. // RE2 re("ab*c?d+"); // re.pattern(); // "ab*c?d+" - fn pattern[self: Self]() -> String { return self.pattern_; } + fn pattern(self) -> String { return self.pattern_; } // If RE2 could not be created properly, returns an error string. // Else returns the empty string. - fn error[self: Self]() -> String { return *self.error_; } + fn error(self) -> String { return *self.error_; } // If RE2 could not be created properly, returns an error code. // Else returns RE2::NoError (== 0). - fn error_code[self: Self]() -> ErrorCode { return self.error_code_; } + fn error_code(self) -> ErrorCode { return self.error_code_; } // If RE2 could not be created properly, returns the offending // portion of the regexp. - fn error_arg[self: Self]() -> String { return self.error_arg_; } + fn error_arg(self) -> String { return self.error_arg_; } // Returns the program size, a very approximate measure of a regexp's "cost". // Larger numbers are more expensive than smaller numbers. - fn ProgramSize[self: Self]() -> i32; - fn ReverseProgramSize[self: Self]() -> i32; + fn ProgramSize(self) -> i32; + fn ReverseProgramSize(self) -> i32; // If histogram is not null, outputs the program fanout // as a histogram bucketed by powers of 2. // Returns the number of the largest non-empty bucket. - fn ProgramFanout[self: Self](histogram: Cpp.std.vector(i32)*) -> i32; - fn ReverseProgramFanout[self: Self](histogram: Cpp.std.vector(i32)*) -> i32; + fn ProgramFanout(self, histogram: Cpp.std.vector(i32)*) -> i32; + fn ReverseProgramFanout(self, histogram: Cpp.std.vector(i32)*) -> i32; // Returns the underlying Regexp; not for general use. // Returns entire_regexp_ so that callers don't need // to know about prefix_ and prefix_foldcase_. - fn Regexp[self: Self]() -> package.Regexp* { return self.entire_regexp_; } + fn Regexp(self) -> package.Regexp* { return self.entire_regexp_; } /***** The array-based matching interface ******/ @@ -535,7 +535,7 @@ class RE2 { // do not compile down to infinite repetitions. // // Returns true on success, false on error. - fn PossibleMatchRange[self: Self](min: String*, max: String*, maxlen: i32); + fn PossibleMatchRange(self, min: String*, max: String*, maxlen: i32); // Generic matching interface @@ -552,18 +552,18 @@ class RE2 { // Return the number of capturing subpatterns, or -1 if the // regexp wasn't valid on construction. The overall match ($0) // does not count: if the regexp is "(a)(b)", returns 2. - fn NumberOfCapturingGroups[self: Self]() -> i32 { return self.num_captures_; } + fn NumberOfCapturingGroups(self) -> i32 { return self.num_captures_; } // Return a map from names to capturing indices. // The map records the index of the leftmost group // with the given name. // NOTE: Originally returned by reference with comment "valid until re is deleted". - fn NamedCapturingGroups[self: Self]() -> Map(String, i32); + fn NamedCapturingGroups(self) -> Map(String, i32); // Return a map from capturing indices to names. // The map has no entries for unnamed groups. // NOTE: Originally returned by reference with comment "valid until re is deleted". - fn CapturingGroupNames[self: Self]() -> Map(i32, String); + fn CapturingGroupNames(self) -> Map(i32, String); // General matching routine. // Match against text starting at offset startpos @@ -586,7 +586,7 @@ class RE2 { // empty string, but note that on return, it will not be possible to tell // whether submatch i matched the empty string or did not match: // either way, submatch[i].data() == NULL. - fn Match[self: Self](text: StringPiece, + fn Match(self, text: StringPiece, startpos: i64, endpos: i64, re_anchor: Anchor, @@ -602,7 +602,7 @@ class RE2 { // '\' followed by anything other than a digit or '\'. // A true return value guarantees that Replace() and Extract() won't // fail because of a bad rewrite string. - fn CheckRewriteString[self: Self](rewrite: StringPiece, error: String*) -> bool; + fn CheckRewriteString(self, rewrite: StringPiece, error: String*) -> bool; // Returns the maximum submatch needed for the rewrite to be done by // Replace(). E.g. if rewrite == "foo \\2,\\1", returns 2. @@ -613,7 +613,7 @@ class RE2 { // Returns true on success. This method can fail because of a malformed // rewrite string. CheckRewriteString guarantees that the rewrite will // be successful. - fn Rewrite[self: Self](out: String*, rewrite: StringPiece, + fn Rewrite(self, out: String*, rewrite: StringPiece, vec: ArrayIterator(StringPiece), veclen: i32) -> bool; @@ -696,50 +696,50 @@ class RE2 { impl CannedOptions as ImplicitAs(Self); - fn encoding[self: Self]() -> Encoding { return self.encoding_; } - fn set_encoding[ref self: Self](encoding: Encoding) { self.encoding_ = encoding; } + fn encoding(self) -> Encoding { return self.encoding_; } + fn set_encoding(ref self, encoding: Encoding) { self.encoding_ = encoding; } - fn posix_syntax[self: Self]() -> bool { return self.posix_syntax_; } - fn set_posix_syntax[ref self: Self](b: bool) { self.posix_syntax_ = b; } + fn posix_syntax(self) -> bool { return self.posix_syntax_; } + fn set_posix_syntax(ref self, b: bool) { self.posix_syntax_ = b; } - fn longest_match[self: Self]() -> bool { return self.longest_match_; } - fn set_longest_match[ref self: Self](b: bool) { self.longest_match_ = b; } + fn longest_match(self) -> bool { return self.longest_match_; } + fn set_longest_match(ref self, b: bool) { self.longest_match_ = b; } - fn log_errors[self: Self]() -> bool { return self.log_errors_; } - fn set_log_errors[ref self: Self](b: bool) { self.log_errors_ = b; } + fn log_errors(self) -> bool { return self.log_errors_; } + fn set_log_errors(ref self, b: bool) { self.log_errors_ = b; } - fn max_mem[self: Self]() -> i64 { return self.max_mem_; } - fn set_max_mem[ref self: Self](m: i64) { self.max_mem_ = m; } + fn max_mem(self) -> i64 { return self.max_mem_; } + fn set_max_mem(ref self, m: i64) { self.max_mem_ = m; } - fn literal[self: Self]() -> bool { return self.literal_; } - fn set_literal[ref self: Self](b: bool) { self.literal_ = b; } + fn literal(self) -> bool { return self.literal_; } + fn set_literal(ref self, b: bool) { self.literal_ = b; } - fn never_nl[self: Self]() -> bool { return self.never_nl_; } - fn set_never_nl[ref self: Self](b: bool) { self.never_nl_ = b; } + fn never_nl(self) -> bool { return self.never_nl_; } + fn set_never_nl(ref self, b: bool) { self.never_nl_ = b; } - fn dot_nl[self: Self]() -> bool { return self.dot_nl_; } - fn set_dot_nl[ref self: Self](b: bool) { self.dot_nl_ = b; } + fn dot_nl(self) -> bool { return self.dot_nl_; } + fn set_dot_nl(ref self, b: bool) { self.dot_nl_ = b; } - fn never_capture[self: Self]() -> bool { return self.never_capture_; } - fn set_never_capture[ref self: Self](b: bool) { self.never_capture_ = b; } + fn never_capture(self) -> bool { return self.never_capture_; } + fn set_never_capture(ref self, b: bool) { self.never_capture_ = b; } - fn case_sensitive[self: Self]() -> bool { return self.case_sensitive_; } - fn set_case_sensitive[ref self: Self](b: bool) { self.case_sensitive_ = b; } + fn case_sensitive(self) -> bool { return self.case_sensitive_; } + fn set_case_sensitive(ref self, b: bool) { self.case_sensitive_ = b; } - fn perl_classes[self: Self]() -> bool { return self.perl_classes_; } - fn set_perl_classes[ref self: Self](b: bool) { self.perl_classes_ = b; } + fn perl_classes(self) -> bool { return self.perl_classes_; } + fn set_perl_classes(ref self, b: bool) { self.perl_classes_ = b; } - fn word_boundary[self: Self]() -> bool { return self.word_boundary_; } - fn set_word_boundary[ref self: Self](b: bool) { self.word_boundary_ = b; } + fn word_boundary(self) -> bool { return self.word_boundary_; } + fn set_word_boundary(ref self, b: bool) { self.word_boundary_ = b; } - fn one_line[self: Self]() -> bool { return self.one_line_; } - fn set_one_line[ref self: Self](b: bool) { self.one_line_ = b; } + fn one_line(self) -> bool { return self.one_line_; } + fn set_one_line(ref self, b: bool) { self.one_line_ = b; } - fn Copy[ref self: Self](src: Options) { + fn Copy(ref self, src: Options) { self = src; } - fn ParseFlags[self: Self]() -> i32; + fn ParseFlags(self) -> i32; private var encoding_: Encoding; private var posix_syntax_: bool; @@ -757,7 +757,7 @@ class RE2 { }; // Returns the options set in the constructor. - fn options[self: Self]() -> Options { return self.options_; } + fn options(self) -> Options { return self.options_; } // Argument converters; see below. // TODO: Should these be package members not class members in Carbon @@ -766,9 +766,9 @@ class RE2 { fn Hex[T:! Parse4ary](ptr: T*) -> Self.Arg; fn Octal[T:! Parse4ary](ptr: T*) -> Self.Arg; - private fn Init[addr self: Self](pattern: StringPiece, options: Options); + private fn Init(addr self: Self, pattern: StringPiece, options: Options); - private fn DoMatch[self: Self](text: StringPiece, + private fn DoMatch(self, text: StringPiece, re_anchor: Anchor, consumed: i64*, // TODO: Pointer to `const Arg`. @@ -776,7 +776,7 @@ class RE2 { n: i32) -> bool; - fn ReverseProg[self: Self]() -> package.Prog*; + fn ReverseProg(self) -> package.Prog*; // string regular expression private var pattern_: String; @@ -853,21 +853,21 @@ class RE2.Arg { fn Make(nullptr) -> Self { return Make(nullptr as NullArg*); } interface Parseable { - fn Parse[ref self: Self](str: StringView, n: i64) -> bool; + fn Parse(ref self, str: StringView, n: i64) -> bool; } match_first { impl [T:! Parse3ary] T as Parseable { - fn Parse[ref self: Self](str: StringView, n: i64) -> bool { + fn Parse(ref self, str: StringView, n: i64) -> bool { return T.Parse(str, n, self); } } impl [T:! Parse4ary] T as Parseable { - fn Parse[ref self: Self](str: StringView, n: i64) -> bool { + fn Parse(ref self, str: StringView, n: i64) -> bool { return T.Parse(str, n, self, 10); } } impl [T:! ParseFrom] T as Parseable { - fn Parse[ref self: Self](str: StringView, n: i64) -> bool { + fn Parse(ref self, str: StringView, n: i64) -> bool { if (self == nullptr) { return true; } return T.Parse(str, n, self); } @@ -876,7 +876,7 @@ class RE2.Arg { private class NullArg {} impl NullArg as Parseable { - fn Parse[ref self: Self](str: StringView, n: i64) -> bool { + fn Parse(ref self, str: StringView, n: i64) -> bool { return true; } } @@ -885,7 +885,7 @@ class RE2.Arg { return {.type_ = T, .arg_ = ptr}; } - fn Parse[self: Self](str: StringView, n: i64) -> bool { + fn Parse(self, str: StringView, n: i64) -> bool { return self.arg_->Parse(str, n); } @@ -896,7 +896,7 @@ class RE2.Arg { private adapter ParseAsBase(T:! Parse4ary, base: i32) for T { impl as Self.Arg.Parseable { - fn Parse[ref self: Self](str: StringView, n: i64) -> bool { + fn Parse(ref self, str: StringView, n: i64) -> bool { return T.Parse(str, n, self, base); } } @@ -938,11 +938,11 @@ class LazyRE2 { // Pretend to be a pointer to Type (never NULL due to on-demand creation): impl as Pointer where .Pointee = RE2 { - fn Resolve[self: Self]() -> Pointee* { return self.get(); } + fn Resolve(self) -> Pointee* { return self.get(); } } // Named accessor/initializer: - fn get[ref self: Self]() -> RE* { + fn get(ref self) -> RE* { Cpp.std.call_once(once_, Self.Init, self); return ptr_; } diff --git a/toolchain/benchmarking/source_gen.cpp b/toolchain/benchmarking/source_gen.cpp index 296d49f3e35f..ca914b966a08 100644 --- a/toolchain/benchmarking/source_gen.cpp +++ b/toolchain/benchmarking/source_gen.cpp @@ -275,7 +275,10 @@ static auto EstimateAvgFunctionDeclLines(SourceGen::FunctionDeclParams params) static auto EstimateAvgMethodDeclLines(SourceGen::MethodDeclParams params) -> double { // Currently model a uniform distribution [0, max] parameters. Assume a line - // break before the first parameter for >2 and after every 4th. + // break before the first parameter for >2 and after every 4th. A Carbon + // method also emits a leading `self`, but `self` only rarely tips a method + // onto an additional wrapped line, so the estimate ignores it; this stays + // calibrated against the emitter (see `source_gen_test`). int param_lines = 0; for (int num_params : llvm::seq_inclusive(0, params.max_params)) { if (num_params > NumSingleLineMethodParams) { @@ -797,10 +800,6 @@ auto SourceGen::GenerateFunctionDecl( os << indent << "// TODO: make better comment text\n"; if (!IsCpp()) { os << indent << (is_private ? "private " : "") << "fn " << name; - - if (is_method) { - os << "[self: Self]"; - } } else { os << indent; if (!is_method) { @@ -815,10 +814,19 @@ auto SourceGen::GenerateFunctionDecl( (is_method ? NumSingleLineMethodParams : NumSingleLineFunctionParams)) { os << "\n" << indent << " "; } + // For Carbon methods, `self` is the first explicit parameter. Its type is + // omitted, which defaults it to `Self`. + bool is_carbon_method = is_method && !IsCpp(); + if (is_carbon_method) { + os << "self"; + } UniqueIdentifierPopper unique_param_names(*this, param_names); for (int i : llvm::seq(param_count)) { - if (i > 0) { - if ((i % MaxParamsPerLine) == 0) { + // `self` occupies the first slot for Carbon methods, so shift the index + // used for separators and line wrapping. + int slot = i + (is_carbon_method ? 1 : 0); + if (slot > 0) { + if ((slot % MaxParamsPerLine) == 0) { os << ",\n" << indent << " "; } else { os << ", "; diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index 6b58f1c48e34..e0a514cf1ce9 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -26,6 +26,7 @@ #include "toolchain/sem_ir/function.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst.h" +#include "toolchain/sem_ir/pattern.h" #include "toolchain/sem_ir/typed_insts.h" namespace Carbon::Check { @@ -57,9 +58,12 @@ static auto ResolveCalleeInCall(Context& context, SemIR::LocId loc_id, SemIR::InstId self_id, llvm::ArrayRef arg_ids) -> std::optional { - // Check that the arity matches. - auto params = context.inst_blocks().GetOrEmpty(entity.param_patterns_id); - if (arg_ids.size() != params.size()) { + // Check that the arity matches the explicit arguments. + auto param_patterns = + context.inst_blocks().GetOrEmpty(entity.param_patterns_id); + size_t expected_args_size = + param_patterns.size() - (self_id.has_value() ? 1 : 0); + if (arg_ids.size() != expected_args_size) { CARBON_DIAGNOSTIC(CallArgCountMismatch, Error, "{0} argument{0:s} passed to " "{1:=0:function|=1:generic class|=2:generic " @@ -74,7 +78,7 @@ static auto ResolveCalleeInCall(Context& context, SemIR::LocId loc_id, Diagnostics::IntAsSelect); context.emitter() .Build(loc_id, CallArgCountMismatch, arg_ids.size(), - static_cast(entity_kind_for_diagnostic), params.size()) + static_cast(entity_kind_for_diagnostic), expected_args_size) .Note(entity.latest_decl_id(), InCallToEntity, static_cast(entity_kind_for_diagnostic)) .Emit(); @@ -258,8 +262,8 @@ auto PerformCallToFunction(Context& context, SemIR::LocId loc_id, } // Convert the arguments to match the parameters. auto converted_args_id = - ConvertCallArgs(context, loc_id, callee_function.self_id, arg_ids, - return_arg_id, callee, *callee_specific_id, is_desugared); + ConvertCallArgs(context, callee_function.self_id, arg_ids, return_arg_id, + callee, *callee_specific_id, is_desugared); switch (callee.special_function_kind) { case SemIR::Function::SpecialFunctionKind::Thunk: { // If we're about to form a direct call to a thunk, inline it. diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 1cd1e0ae9aea..3719c306c14a 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -36,6 +36,7 @@ #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst.h" #include "toolchain/sem_ir/inst_kind.h" +#include "toolchain/sem_ir/pattern.h" #include "toolchain/sem_ir/type.h" #include "toolchain/sem_ir/type_info.h" #include "toolchain/sem_ir/typed_insts.h" @@ -2221,32 +2222,18 @@ auto ConvertForExplicitAs(Context& context, Parse::NodeId as_node, } // TODO: Consider moving this to pattern_match.h. -auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id, - SemIR::InstId self_id, +auto ConvertCallArgs(Context& context, SemIR::InstId self_id, llvm::ArrayRef arg_refs, SemIR::InstId return_arg_id, const SemIR::Function& callee, SemIR::SpecificId callee_specific_id, bool is_desugared) -> SemIR::InstBlockId { - auto param_patterns = - context.inst_blocks().GetOrEmpty(callee.param_patterns_id); - auto return_pattern_id = callee.return_pattern_id; - // The caller should have ensured this callee has the right arity. - CARBON_CHECK(arg_refs.size() == param_patterns.size()); - - if (callee.self_param_id.has_value() && !self_id.has_value()) { - CARBON_DIAGNOSTIC(MissingObjectInMethodCall, Error, - "missing object argument in method call"); - CARBON_DIAGNOSTIC(InCallToFunction, Note, "calling function declared here"); - context.emitter() - .Build(call_loc_id, MissingObjectInMethodCall) - .Note(callee.latest_decl_id(), InCallToFunction) - .Emit(); - self_id = SemIR::ErrorInst::InstId; - } + CARBON_CHECK( + (self_id.has_value() ? 1 : 0) + arg_refs.size() == + context.inst_blocks().GetOrEmpty(callee.param_patterns_id).size()); return CallerPatternMatch(context, callee_specific_id, callee.self_param_id, - callee.param_patterns_id, return_pattern_id, + callee.param_patterns_id, callee.return_pattern_id, self_id, arg_refs, return_arg_id, is_desugared); } diff --git a/toolchain/check/convert.h b/toolchain/check/convert.h index bb3a14569fdc..6b058b8115c4 100644 --- a/toolchain/check/convert.h +++ b/toolchain/check/convert.h @@ -209,8 +209,7 @@ auto ConvertForExplicitAs(Context& context, Parse::NodeId as_node, // argument values for runtime parameters. `is_desugared` indicates that this // call was produced by desugaring, not written as a function call in user code, // so arguments to `ref` parameters aren't required to have `ref` tags. -auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id, - SemIR::InstId self_id, +auto ConvertCallArgs(Context& context, SemIR::InstId self_id, llvm::ArrayRef arg_refs, SemIR::InstId return_arg_id, const SemIR::Function& callee, SemIR::SpecificId callee_specific_id, bool is_desugared) diff --git a/toolchain/check/cpp/export.cpp b/toolchain/check/cpp/export.cpp index 03cc847c00f6..533548e62e56 100644 --- a/toolchain/check/cpp/export.cpp +++ b/toolchain/check/cpp/export.cpp @@ -373,23 +373,22 @@ struct FunctionInfo { decl_context(decl_context) { auto function_params = context.inst_blocks().Get(function.call_param_patterns_id); + const auto& ranges = function.call_param_ranges; + auto explicit_begin = ranges.explicit_begin().index; - // Get the function's `self` parameter, if present. - if (function.call_param_ranges.implicit_size() > 0) { - CARBON_CHECK(function.call_param_ranges.implicit_size() == 1); - - auto param_inst_id = - function_params[function.call_param_ranges.implicit_begin().index]; - self_param = Param(context, param_inst_id); + // Get the function's `self` parameter, if present. `self` is the first + // explicit call parameter. (The lowered call parameters are leaf patterns + // without binding names, so we rely on `self_param_id` and the positional + // convention rather than inspecting the pattern.) + if (function.self_param_id.has_value()) { + CARBON_CHECK(explicit_begin != ranges.explicit_end().index); + self_param = Param(context, function_params[explicit_begin]); + ++explicit_begin; } - // Get the function's explicit parameters. - function_params = - function_params.drop_front(function.call_param_ranges.implicit_size()); - function_params = - function_params.drop_back(function.call_param_ranges.return_size()); - for (auto param_inst_id : function_params) { - explicit_params.push_back(Param(context, param_inst_id)); + // The remaining explicit parameters are the caller-provided arguments. + for (auto i = explicit_begin; i != ranges.explicit_end().index; ++i) { + explicit_params.push_back(Param(context, function_params[i])); } } diff --git a/toolchain/check/cpp/import.cpp b/toolchain/check/cpp/import.cpp index 54e27a091dce..dd81288cfff1 100644 --- a/toolchain/check/cpp/import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -1452,11 +1452,10 @@ static auto MapParameterType( .kind = GetParamPatternKindForPassingMode(passing_mode)}; } -// Returns a block for the implicit parameters of the given function -// declaration. Because function templates are not yet supported, this currently -// only contains the `self` parameter. On error, produces a diagnostic and -// returns None. -static auto MakeImplicitParamPatternsBlockId( +// Returns a block containing the `self` parameter pattern for the given +// function declaration, or `Empty` if it is not a method. +// Returns `None` on error. +static auto MakeSelfParamPatternBlockId( Context& context, SemIR::LocId loc_id, SemIR::ImportIRInstId import_ir_inst_id, const clang::FunctionDecl& clang_decl, @@ -1741,30 +1740,46 @@ static auto CreateFunctionSignatureInsts( SemIR::ImportIRInstId import_ir_inst_id, clang::FunctionDecl* clang_decl, SemIR::ClangDeclSignatureId signature_id) -> std::optional { - context.full_pattern_stack().StartImplicitParamList(); - auto implicit_param_patterns_id = MakeImplicitParamPatternsBlockId( + // The `self` parameter of a method (proposal #7016) is the + // first entry in the explicit parameter list. Build it (if any) first, then + // the remaining explicit parameters, and concatenate them into a single + // explicit parameter list. + context.full_pattern_stack().StartExplicitParamList(); + auto self_param_patterns_id = MakeSelfParamPatternBlockId( context, loc_id, import_ir_inst_id, *clang_decl, signature_id); - if (!implicit_param_patterns_id.has_value()) { + if (!self_param_patterns_id.has_value()) { return std::nullopt; } - context.full_pattern_stack().EndImplicitParamList(); - context.full_pattern_stack().StartExplicitParamList(); - auto param_patterns_id = MakeParamPatternsBlockId( + auto explicit_param_patterns_id = MakeParamPatternsBlockId( context, loc_id, import_ir_inst_id, *clang_decl, signature_id); - if (!param_patterns_id.has_value()) { + if (!explicit_param_patterns_id.has_value()) { return std::nullopt; } context.full_pattern_stack().EndExplicitParamList(); + + auto self_param_patterns = + context.inst_blocks().GetOrEmpty(self_param_patterns_id); + auto param_patterns_id = explicit_param_patterns_id; + if (!self_param_patterns.empty()) { + llvm::SmallVector combined(self_param_patterns); + llvm::append_range( + combined, context.inst_blocks().GetOrEmpty(explicit_param_patterns_id)); + param_patterns_id = context.inst_blocks().Add(combined); + } + auto [return_type_inst_id, return_form_inst_id, return_pattern_id] = GetReturnInfo(context, loc_id, clang_decl); if (return_type_inst_id == SemIR::ErrorInst::TypeInstId) { return std::nullopt; } - auto match_results = CalleePatternMatch(context, implicit_param_patterns_id, + // C++ functions have no implicit parameters. Use `None` rather than an empty + // block so that the signature matches a Carbon function with no implicit + // parameter list. + auto match_results = CalleePatternMatch(context, SemIR::InstBlockId::None, param_patterns_id, return_pattern_id); - return {{.implicit_param_patterns_id = implicit_param_patterns_id, + return {{.implicit_param_patterns_id = SemIR::InstBlockId::None, .param_patterns_id = param_patterns_id, .return_type_inst_id = return_type_inst_id, .return_form_inst_id = return_form_inst_id, @@ -1892,7 +1907,8 @@ static auto ImportFunction(Context& context, SemIR::LocId loc_id, .virtual_index = virtual_index, .evaluation_mode = evaluation_mode, .self_param_id = FindSelfPattern( - context, function_params_insts->implicit_param_patterns_id), + context, function_params_insts->implicit_param_patterns_id, + function_params_insts->param_patterns_id), }}); context.imports().push_back(decl_id); diff --git a/toolchain/check/cpp/operators.cpp b/toolchain/check/cpp/operators.cpp index 0ce39d780b39..7b7c9a571d47 100644 --- a/toolchain/check/cpp/operators.cpp +++ b/toolchain/check/cpp/operators.cpp @@ -329,7 +329,7 @@ static auto GetConversionSignatureToImport( // Otherwise, the initialization is calling a conversion function // `Source::operator Dest`: // - // fn Source.[self: Source]() -> Dest; + // fn Source.(self: Source) -> Dest; auto* conversion_decl = cast(function_decl); self_expr = arg_expr; arg_exprs = {}; diff --git a/toolchain/check/deduce.cpp b/toolchain/check/deduce.cpp index ce2ab702cbd4..28d892d1a524 100644 --- a/toolchain/check/deduce.cpp +++ b/toolchain/check/deduce.cpp @@ -14,6 +14,7 @@ #include "toolchain/diagnostics/diagnostic.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/impl.h" +#include "toolchain/sem_ir/pattern.h" #include "toolchain/sem_ir/type.h" #include "toolchain/sem_ir/typed_insts.h" @@ -180,6 +181,12 @@ class DeductionContext { worklist_.AddAll(param, arg, want_value); } + template + auto AddAll(llvm::ArrayRef params, llvm::ArrayRef args, + bool want_value) -> void { + worklist_.AddAll(params, args, want_value); + } + template auto AddAll(ParamT param, ArgT arg) -> void { worklist_.AddAll(param, arg); @@ -581,17 +588,24 @@ auto DeduceGenericCallArguments( Context& context, SemIR::LocId loc_id, SemIR::GenericId generic_id, SemIR::SpecificId enclosing_specific_id, [[maybe_unused]] SemIR::InstBlockId implicit_param_patterns_id, - SemIR::InstBlockId param_patterns_id, - [[maybe_unused]] SemIR::InstId self_id, + SemIR::InstBlockId param_patterns_id, SemIR::InstId self_id, llvm::ArrayRef arg_ids) -> SemIR::SpecificId { DeductionContext deduction(&context, loc_id, generic_id, enclosing_specific_id, /*diagnose=*/true); - // Prepare to perform deduction of the explicit parameters against their - // arguments. - // TODO: Also perform deduction for type of self. - deduction.AddAll(param_patterns_id, arg_ids, /*want_value=*/false); + // Prepare to perform deduction of the parameters against the explicit + // arguments. When `self` is provided as the method-call receiver it is + // prepended to the explicit argument list to match the leading `self` + // parameter pattern. + llvm::ArrayRef self_refs = {}; + if (self_id.has_value()) { + self_refs = self_id; + } + deduction.AddAll(context.inst_blocks().GetOrEmpty(param_patterns_id), + llvm::ArrayRef(llvm::to_vector<8>( + llvm::concat(self_refs, arg_ids))), + /*want_value=*/false); if (!deduction.Deduce() || !deduction.CheckDeductionIsComplete()) { return SemIR::SpecificId::None; diff --git a/toolchain/check/function.cpp b/toolchain/check/function.cpp index 7d284fdeb3c1..c601f5b73734 100644 --- a/toolchain/check/function.cpp +++ b/toolchain/check/function.cpp @@ -24,13 +24,22 @@ namespace Carbon::Check { auto FindSelfPattern(Context& context, - SemIR::InstBlockId implicit_param_patterns_id) - -> SemIR::InstId { + SemIR::InstBlockId implicit_param_patterns_id, + SemIR::InstBlockId param_patterns_id) -> SemIR::InstId { + auto is_self_pattern = [&](auto param_id) { + return SemIR::IsSelfPattern(context.sem_ir(), param_id); + }; + // `self` is the first explicit parameter. We also look in the implicit + // parameter list for error recovery: declaring `self` there is diagnosed (see + // `SelfInImplicitParamList`), but we still treat it as `self` afterwards. + auto param_patterns = context.inst_blocks().GetOrEmpty(param_patterns_id); + if (auto self_id = FindIfOrNone(param_patterns, is_self_pattern); + self_id.has_value()) { + return self_id; + } auto implicit_param_patterns = context.inst_blocks().GetOrEmpty(implicit_param_patterns_id); - return FindIfOrNone(implicit_param_patterns, [&](auto implicit_param_id) { - return SemIR::IsSelfPattern(context.sem_ir(), implicit_param_id); - }); + return FindIfOrNone(implicit_param_patterns, is_self_pattern); } auto AddReturnPattern(Context& context, SemIR::LocId loc_id, @@ -97,31 +106,28 @@ static auto MakeFunctionSignature(Context& context, SemIR::LocId loc_id, StartFunctionSignature(context); - // Build and add a `self: Self` or `ref self: Self` parameter if needed. - if (args.self_type_id.has_value()) { - context.full_pattern_stack().StartImplicitParamList(); - - BeginSubpattern(context); - auto self_type_region_id = ConsumeSubpatternExpr( - context, context.types().GetTypeInstId(args.self_type_id)); - EndEmptySubpattern(context); - - insts.self_param_id = - AddParamPattern(context, loc_id, SemIR::NameId::SelfValue, - self_type_region_id, args.self_type_id, args.self_kind); - insts.implicit_param_patterns_id = - context.inst_blocks().Add({insts.self_param_id}); - - context.full_pattern_stack().EndImplicitParamList(); - } - - // Build and add any explicit parameters. Whether these are references - // or not is controlled by `args.params_are_refs`. + // Build and add the explicit parameters, with a leading `self` parameter if + // one is needed. `self` is the first explicit parameter (proposal #7016), + // matching the convention used by user-written and prelude signatures. + // Keeping the placement consistent matters in particular for the + // `Destroy.Op` / `Copy.Op` functions backing custom witnesses: a mismatch + // would force a signature-adapting thunk for every witness. context.full_pattern_stack().StartExplicitParamList(); - if (args.param_type_ids.empty()) { + if (!args.self_type_id.has_value() && args.param_type_ids.empty()) { insts.param_patterns_id = SemIR::InstBlockId::Empty; } else { context.inst_block_stack().Push(); + if (args.self_type_id.has_value()) { + BeginSubpattern(context); + auto self_type_region_id = ConsumeSubpatternExpr( + context, context.types().GetTypeInstId(args.self_type_id)); + EndEmptySubpattern(context); + + insts.self_param_id = AddParamPattern( + context, loc_id, SemIR::NameId::SelfValue, self_type_region_id, + args.self_type_id, args.self_kind); + context.inst_block_stack().AddInstId(insts.self_param_id); + } for (auto param_type_id : args.param_type_ids) { BeginSubpattern(context); auto param_type_region_id = ConsumeSubpatternExpr( diff --git a/toolchain/check/function.h b/toolchain/check/function.h index bab2bc73b964..7e8385c560eb 100644 --- a/toolchain/check/function.h +++ b/toolchain/check/function.h @@ -15,11 +15,14 @@ namespace Carbon::Check { -// Returns the ID of the self parameter pattern, or None. -// TODO: Do this during initial traversal of implicit params. +// Returns the ID of the self parameter pattern, or None. `self` is declared as +// the first explicit parameter. The implicit parameter list is also searched +// for error recovery: declaring `self` there is diagnosed, but we still +// recognize it as `self` afterwards. +// TODO: Do this during initial traversal of the parameters. auto FindSelfPattern(Context& context, - SemIR::InstBlockId implicit_param_patterns_id) - -> SemIR::InstId; + SemIR::InstBlockId implicit_param_patterns_id, + SemIR::InstBlockId param_patterns_id) -> SemIR::InstId; // Creates suitable return patterns for the given return form, and adds them to // the current pattern block. @@ -35,8 +38,7 @@ auto IsValidBuiltinDeclaration(Context& context, struct FunctionDeclArgs { SemIR::NameScopeId parent_scope_id; SemIR::NameId name_id; - // The type of the implicit `[self: Self]` parameter, or `None` if there is - // none. + // The type of the leading `self` parameter, or `None` if there is none. SemIR::TypeId self_type_id = SemIR::TypeId::None; // The kind of the `self` parameter. ParamPatternKind self_kind = ParamPatternKind::Ref; diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index 2240be5dd58c..4b40b7f2e5b3 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -13,6 +13,7 @@ #include "toolchain/check/inst.h" #include "toolchain/check/interface.h" #include "toolchain/check/name_lookup.h" +#include "toolchain/check/name_ref.h" #include "toolchain/check/pattern.h" #include "toolchain/check/period_self.h" #include "toolchain/check/return.h" @@ -57,12 +58,14 @@ static auto IsValidParamForIntroducer(Context& context, Parse::NodeId node_id, bool is_generic) -> bool { switch (introducer_kind) { case Lex::TokenKind::Fn: { + // `self` in the implicit parameter list is diagnosed separately (see + // `SelfInImplicitParamList`), so skip it here to avoid a redundant + // diagnostic. if (context.full_pattern_stack().CurrentKind() == FullPatternStack::Kind::ImplicitParamList && !(is_generic || name_id == SemIR::NameId::SelfValue)) { - CARBON_DIAGNOSTIC( - ImplictParamMustBeConstant, Error, - "implicit parameters of functions must be constant or `self`"); + CARBON_DIAGNOSTIC(ImplictParamMustBeConstant, Error, + "implicit parameters of functions must be constant"); context.emitter().Emit(node_id, ImplictParamMustBeConstant); return false; } @@ -112,8 +115,10 @@ namespace { // expression may be interpreted as a type or a form, depending on the binding // kind. struct BindingPatternTypeInfo { - // The parse node representing the expression. - Parse::AnyExprId node_id; + // The parse node representing the expression. For a `self` binding with an + // omitted type this is the binding pattern node itself, since there is no + // separate type expression. + Parse::NodeId node_id; // The inst representing the converted value of that expression. For a `:?` // binding the expression is converted to type `Core.Form`; otherwise it is // converted to type `type`. @@ -124,10 +129,21 @@ struct BindingPatternTypeInfo { }; } // namespace -// Handle the type position of a binding pattern. +// Handle the type position of a binding pattern. For a `self` binding with an +// omitted type, `self_type_inst_id` is the synthesized `Self` type expression +// and there is no type expression on the node stack to pop. static auto HandleAnyBindingPatternType(Context& context, - Parse::NodeKind node_kind) + Parse::NodeId binding_node_id, + Parse::NodeKind node_kind, + SemIR::InstId self_type_inst_id) -> BindingPatternTypeInfo { + if (self_type_inst_id.has_value()) { + auto as_type = ExprAsType(context, binding_node_id, self_type_inst_id); + return {.node_id = binding_node_id, + .inst_id = as_type.inst_id, + .type_component_id = as_type.type_id}; + } + auto [node_id, original_inst_id] = context.node_stack().PopExprWithNodeId(); if (node_kind == Parse::FormBindingPattern::Kind) { @@ -144,10 +160,12 @@ static auto HandleAnyBindingPatternType(Context& context, } // TODO: make this function shorter by factoring pieces out. -static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, - Parse::NodeKind node_kind, - bool is_unused = false) -> bool { - auto type_expr = HandleAnyBindingPatternType(context, node_kind); +static auto HandleAnyBindingPattern( + Context& context, Parse::NodeId node_id, Parse::NodeKind node_kind, + bool is_unused = false, + SemIR::InstId self_type_inst_id = SemIR::InstId::None) -> bool { + auto type_expr = HandleAnyBindingPatternType(context, node_id, node_kind, + self_type_inst_id); if (context.types() .GetAsInst(type_expr.type_component_id) .Is()) { @@ -228,13 +246,29 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, type_expr.type_component_id); }; - // A `self` binding can only appear in an implicit parameter list. - if (name_id == SemIR::NameId::SelfValue && - !context.node_stack().PeekIs(Parse::NodeKind::ImplicitParamListStart)) { - CARBON_DIAGNOSTIC( - SelfOutsideImplicitParamList, Error, - "`self` can only be declared in an implicit parameter list"); - context.emitter().Emit(node_id, SelfOutsideImplicitParamList); + // A `self` binding must be the first parameter in the explicit parameter + // list (see proposal #7016). Here we can reject `self` in the implicit + // parameter list or outside any parameter list; that it must be *first* in + // the explicit list is checked once the full list is known (see + // `BuildFunctionDecl`). + if (name_id == SemIR::NameId::SelfValue) { + switch (context.full_pattern_stack().CurrentKind()) { + case FullPatternStack::Kind::ExplicitParamList: + break; + case FullPatternStack::Kind::ImplicitParamList: { + CARBON_DIAGNOSTIC( + SelfInImplicitParamList, Error, + "`self` must be declared in the explicit parameter list"); + context.emitter().Emit(node_id, SelfInImplicitParamList); + break; + } + default: { + CARBON_DIAGNOSTIC(SelfOutsideParamList, Error, + "`self` can only be declared in a parameter list"); + context.emitter().Emit(node_id, SelfOutsideParamList); + break; + } + } } if (node_kind == Parse::NodeKind::CompileTimeBindingPattern && @@ -399,6 +433,21 @@ auto HandleParseNode(Context& context, Parse::LetBindingPatternId node_id) Parse::NodeKind::LetBindingPattern); } +auto HandleParseNode(Context& context, Parse::SelfBindingPatternId node_id) + -> bool { + // A `self` binding with an omitted type behaves like `self: Self`. There is + // no type expression in the parse tree, so synthesize a reference to `Self` + // into the current subpattern region and feed it in as the binding's type. + auto self_type = + LookupUnqualifiedName(context, node_id, SemIR::NameId::SelfType); + auto self_type_inst_id = BuildNameRef( + context, node_id, SemIR::NameId::SelfType, + self_type.scope_result.target_inst_id(), self_type.specific_id); + return HandleAnyBindingPattern(context, node_id, + Parse::NodeKind::LetBindingPattern, + /*is_unused=*/false, self_type_inst_id); +} + auto HandleParseNode(Context& context, Parse::VarBindingPatternId node_id) -> bool { return HandleAnyBindingPattern(context, node_id, diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index c50b11f099cc..346e12a54a08 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -30,6 +30,7 @@ #include "toolchain/sem_ir/function.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst.h" +#include "toolchain/sem_ir/pattern.h" #include "toolchain/sem_ir/typed_insts.h" namespace Carbon::Check { @@ -517,8 +518,21 @@ static auto BuildFunctionDecl(Context& context, context.node_stack() .PopAndDiscardSoloNodeId(); - auto self_param_id = - FindSelfPattern(context, name.implicit_param_patterns_id); + auto self_param_id = FindSelfPattern(context, name.implicit_param_patterns_id, + name.param_patterns_id); + + // `self` must be the first explicit parameter. (Declaring it in the implicit + // parameter list or outside any parameter list is diagnosed earlier.) + if (self_param_id.has_value()) { + auto explicit_params = + context.inst_blocks().GetOrEmpty(name.param_patterns_id); + if (!explicit_params.empty() && explicit_params.front() != self_param_id && + llvm::is_contained(explicit_params, self_param_id)) { + CARBON_DIAGNOSTIC(SelfNotFirstParam, Error, + "`self` must be the first explicit parameter"); + context.emitter().Emit(SemIR::LocId(self_param_id), SelfNotFirstParam); + } + } // Process modifiers. auto [parent_scope_inst_id, parent_scope_inst] = @@ -660,8 +674,8 @@ static auto DiagnoseUnusedMarkersWithoutDefinition( const auto& function = context.functions().Get(function_id); // The `unused` modifier requires a definition, so it is not valid on any // parameter when there is none. This applies to implicit parameters (such as - // `self`) too, so check the implicit parameter list as well as the explicit - // one. + // `T:! type` introduced by `[...]`) too, so check the implicit parameter list + // as well as the explicit one. for (auto param_patterns_id : {function.implicit_param_patterns_id, function.param_patterns_id}) { if (param_patterns_id.has_value()) { diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 28ac3ffe5611..d3e1fef1dee0 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -48,7 +48,7 @@ static auto GetClassElementIndex(Context& context, SemIR::InstId element_id) } // Returns whether `function_id` is an instance method: in other words, whether -// it has an implicit `self` parameter. +// it has a `self` parameter (the first explicit parameter). static auto IsInstanceMethod(const SemIR::File& sem_ir, SemIR::FunctionId function_id) -> bool { const auto& function = sem_ir.functions().Get(function_id); diff --git a/toolchain/check/merge.cpp b/toolchain/check/merge.cpp index 95712c01c235..eefd08b85558 100644 --- a/toolchain/check/merge.cpp +++ b/toolchain/check/merge.cpp @@ -343,7 +343,10 @@ static auto CheckRedeclParams(Context& context, SemIR::LocId new_decl_loc_id, return true; } - // If exactly one of the parameter lists was present, they differ. + // If exactly one of the parameter lists was present, they differ. An absent + // parameter list (`None`) and a present-but-empty one (`Empty`) are + // intentionally treated as different, following the syntactic redeclaration + // matching design. if (new_param_patterns_id.has_value() != prev_param_patterns_id.has_value()) { if (!diagnose) { return false; @@ -470,6 +473,13 @@ static auto CheckRedeclParamSyntax(Context& context, prev_node_kind = context.parse_tree().node_kind(prev_node_id); } if (!IsNodeSyntaxEqual(context, new_node_id, prev_node_id)) { + // The `self` parameter's type must be spelled the same way (`self` vs. + // `self: Self`) in a redeclaration as in the previous declaration. This + // is not a special case: like any other parameter-type spelling + // difference (e.g. `self: Self` vs. `self: C`), it falls through to the + // generic "syntax differs" diagnostic below, following the token-based + // redeclaration matching rule from proposal #3763. + // // Skip difference if it is `Self as` vs. `as` in an `impl` declaration. // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p003763.md#redeclarations if (new_node_kind == Parse::NodeKind::ImplDefaultSelfAs && diff --git a/toolchain/check/pattern_match.cpp b/toolchain/check/pattern_match.cpp index 3dc486584dd1..03462eaaf465 100644 --- a/toolchain/check/pattern_match.cpp +++ b/toolchain/check/pattern_match.cpp @@ -21,6 +21,7 @@ #include "toolchain/check/type.h" #include "toolchain/diagnostics/format_providers.h" #include "toolchain/sem_ir/expr_info.h" +#include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/inst_kind.h" #include "toolchain/sem_ir/pattern.h" @@ -978,7 +979,7 @@ auto CalleePatternMatch(Context& context, .param_ranges = {implicit_end, explicit_end, return_end}}; } -auto ThunkPatternMatch(Context& context, SemIR::InstId self_pattern_id, +auto ThunkPatternMatch(Context& context, llvm::ArrayRef param_pattern_ids, llvm::ArrayRef outer_call_args) -> ThunkPatternMatchResults { @@ -986,15 +987,7 @@ auto ThunkPatternMatch(Context& context, SemIR::InstId self_pattern_id, MatchContext match(context); llvm::SmallVector inner_args; - inner_args.reserve(outer_call_args.size() + 1); - - if (self_pattern_id.has_value()) { - inner_args.push_back(match.MatchWithResult( - &state, - {.pattern_id = self_pattern_id, - .work = MatchContext::PreWork{.scrutinee_id = SemIR::InstId::None}, - .allow_unmarked_ref = true})); - } + inner_args.reserve(outer_call_args.size()); for (SemIR::InstId inst_id : param_pattern_ids) { inner_args.push_back(match.MatchWithResult( @@ -1035,18 +1028,21 @@ auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id, CallerState state = {.callee_specific_id = specific_id}; MatchContext match(context); - if (self_pattern_id.has_value()) { - match.Match(&state, - {.pattern_id = self_pattern_id, - .work = MatchContext::PreWork{.scrutinee_id = self_arg_id}, - .allow_unmarked_ref = true}); + // When we have a separate `self_arg_id`, we concatenate that onto the front + // of the arg_refs to match against the first parameter. + llvm::ArrayRef self_arg_refs = {}; + if (self_arg_id.has_value()) { + self_arg_refs = self_arg_id; + CARBON_CHECK(self_pattern_id.has_value()); } - for (auto [arg_id, param_pattern_id] : llvm::zip_equal( - arg_refs, context.inst_blocks().GetOrEmpty(param_patterns_id))) { - match.Match(&state, {.pattern_id = param_pattern_id, - .work = MatchContext::PreWork{.scrutinee_id = arg_id}, - .allow_unmarked_ref = is_desugared}); + for (const auto& [arg_id, param_pattern_id] : llvm::zip_equal( + llvm::concat(self_arg_refs, arg_refs), + context.inst_blocks().GetOrEmpty(param_patterns_id))) { + match.Match(&state, + {.pattern_id = param_pattern_id, + .work = MatchContext::PreWork{.scrutinee_id = arg_id}, + .allow_unmarked_ref = arg_id == self_arg_id || is_desugared}); } // Track the return storage, if present. diff --git a/toolchain/check/pattern_match.h b/toolchain/check/pattern_match.h index ef82fe58ae51..914f00a8a625 100644 --- a/toolchain/check/pattern_match.h +++ b/toolchain/check/pattern_match.h @@ -44,7 +44,7 @@ auto CalleePatternMatch(Context& context, // Return type for ThunkPatternMatch. struct ThunkPatternMatchResults { - // The syntactic argument list. If `self_pattern_id` is not `None`, the first + // The syntactic argument list. If there is a self parameter, the first // element will be the corresponding argument. llvm::SmallVector syntactic_args; @@ -57,7 +57,7 @@ struct ThunkPatternMatchResults { // Given the `Call` arguments for the outer part of a thunked function call, // computes the corresponding syntactic argument list, suitable for passing to // the inner part of the thunked function call. -auto ThunkPatternMatch(Context& context, SemIR::InstId self_pattern_id, +auto ThunkPatternMatch(Context& context, llvm::ArrayRef param_pattern_ids, llvm::ArrayRef outer_call_args) -> ThunkPatternMatchResults; diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index ee4ba3e204fe..946324fd8bee 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -56,6 +56,7 @@ fn G(template N:! i32) { fn H() { G(3); } + // CHECK:STDOUT: --- generic_empty.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -96,11 +97,11 @@ fn H() { G(3); } // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_29.2 [symbolic = %pattern_type (constants.%pattern_type.bd6)] // CHECK:STDOUT: %array: @G.%array_type.loc7_29.2 (%array_type.1b3) = tuple_value () [symbolic = %array (constants.%array.ca4)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc7_29.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc7_29.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.a52)] -// 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.a67)] -// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc7_3.2 (constants.%.1e5)] -// CHECK:STDOUT: %impl.elem0.loc7_3.2: @G.%.loc7_3.2 (%.1e5) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value %array_type.loc7_29.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.a52)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7_3.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.a67)] +// CHECK:STDOUT: %.loc7_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc7_3.2 [symbolic = %.loc7_3.3 (constants.%.1e5)] +// CHECK:STDOUT: %impl.elem0.loc7_3.2: @G.%.loc7_3.3 (%.1e5) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7_3.2) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -119,8 +120,10 @@ fn H() { G(3); } // CHECK:STDOUT: %array_type.loc7_29.1: type = array_type %int_0, %T.ref [symbolic = %array_type.loc7_29.2 (constants.%array_type.1b3)] // CHECK:STDOUT: } // CHECK:STDOUT: %arr: ref @G.%array_type.loc7_29.2 (%array_type.1b3) = ref_binding arr, %arr.var -// CHECK:STDOUT: %impl.elem0.loc7_3.1: @G.%.loc7_3.2 (%.1e5) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc7_3.1: @G.%.loc7_3.3 (%.1e5) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %arr.var, %impl.elem0.loc7_3.1 +// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%array_type.1b3, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.a52)] +// CHECK:STDOUT: %.loc7_3.2: %Destroy.type = converted constants.%array_type.1b3, %Destroy.facet.loc7_3.1 [symbolic = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.a52)] // CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.a52) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %arr.var, %specific_impl_fn.loc7_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%arr.var) @@ -143,9 +146,9 @@ fn H() { G(3); } // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6be // CHECK:STDOUT: %array => constants.%array.497 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9 -// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.396 +// CHECK:STDOUT: %Destroy.facet.loc7_3.2 => constants.%Destroy.facet.396 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.ccc -// CHECK:STDOUT: %.loc7_3.2 => constants.%.a02 +// CHECK:STDOUT: %.loc7_3.3 => constants.%.a02 // CHECK:STDOUT: %impl.elem0.loc7_3.2 => constants.%Destroy.Op // CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.Op // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index eb3fab173e06..92b8427b5e18 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -91,11 +91,11 @@ class Y { } impl Y as Core.As(X) { - fn Convert[self: Y]() -> X { return {.x = self.y}; } + fn Convert(self: Y) -> X { return {.x = self.y}; } } impl X as Core.As(Y) { - fn Convert[self: X]() -> Y { return {.y = self.x}; } + fn Convert(self: X) -> Y { return {.y = self.x}; } } //@dump-sem-ir-begin diff --git a/toolchain/check/testdata/as/var_init.carbon b/toolchain/check/testdata/as/var_init.carbon index 3b4ef49f6938..db3cab637713 100644 --- a/toolchain/check/testdata/as/var_init.carbon +++ b/toolchain/check/testdata/as/var_init.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; class X { impl () as Core.ImplicitAs(X) { - fn Convert[unused self: ()]() -> X { return {}; } + fn Convert(unused self: ()) -> X { return {}; } } } diff --git a/toolchain/check/testdata/basics/include_in_dumps.carbon b/toolchain/check/testdata/basics/include_in_dumps.carbon index 4c92a768b975..f3f2b55a0f4b 100644 --- a/toolchain/check/testdata/basics/include_in_dumps.carbon +++ b/toolchain/check/testdata/basics/include_in_dumps.carbon @@ -31,13 +31,13 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin interface I { - fn Op[self: Self](); + fn Op(self); } //@dump-sem-ir-end class C { impl C as I { - fn Op[unused self: Self]() {} + fn Op(unused self) {} } } @@ -61,13 +61,13 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin interface I { - fn Op[self: Self](); + fn Op(self); } //@dump-sem-ir-end class C { impl C as I { - fn Op[unused self: Self]() {} + fn Op(unused self) {} } } @@ -79,6 +79,7 @@ import library "excluded_with_range"; fn F(c: C) { c.(I.Op)(); } + // CHECK:STDOUT: --- exclude/included.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -147,13 +148,13 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: %self.param_patt: @I.WithSelf.Op.%pattern_type (%pattern_type.c60) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.Op.%pattern_type (%pattern_type.c60) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc8_15.1: type = splice_block %.loc8_15.2 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.Op.%Self.as_type.loc8_9.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc8_9.1: type = splice_block %.loc8_9.2 [symbolic = %Self.as_type.loc8_9.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc8_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc8_15.2: type = converted %Self.ref, %Self.as_type.loc8_15.2 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc8_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc8_9.2: type = converted %Self.ref, %Self.as_type.loc8_9.2 [symbolic = %Self.as_type.loc8_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.Op.%Self.as_type.loc8_9.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.Op.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -167,10 +168,10 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @I.WithSelf.Op(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc8_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc8_15.1 [symbolic = %pattern_type (constants.%pattern_type.c60)] +// CHECK:STDOUT: %Self.as_type.loc8_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc8_9.1 [symbolic = %pattern_type (constants.%pattern_type.c60)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.Op.%Self.as_type.loc8_9.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) { @@ -182,7 +183,7 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.Op(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc8_15.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc8_9.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c60 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -195,7 +196,7 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.Op(constants.%I.facet) { // CHECK:STDOUT: %Self => constants.%I.facet -// CHECK:STDOUT: %Self.as_type.loc8_15.1 => constants.%C +// CHECK:STDOUT: %Self.as_type.loc8_9.1 => constants.%C // CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b // CHECK:STDOUT: } // CHECK:STDOUT: @@ -235,15 +236,15 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//included_with_range, loc16_1, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.e47 = import_ref Main//included_with_range, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.ddc: %I.assoc_type = import_ref Main//included_with_range, loc8_22, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Main.import_ref.ddc: %I.assoc_type = import_ref Main//included_with_range, loc8_14, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %Main.Op = import_ref Main//included_with_range, Op, unloaded // CHECK:STDOUT: %Main.import_ref.e59c42.2: %I.type = import_ref Main//included_with_range, loc7_13, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %Main.import_ref.223 = import_ref Main//included_with_range, loc7_13, unloaded -// CHECK:STDOUT: %Main.import_ref.421: @I.WithSelf.%I.WithSelf.Op.type (%I.WithSelf.Op.type.351) = import_ref Main//included_with_range, loc8_22, loaded [symbolic = @I.WithSelf.%I.WithSelf.Op (constants.%I.WithSelf.Op.fcf)] +// CHECK:STDOUT: %Main.import_ref.421: @I.WithSelf.%I.WithSelf.Op.type (%I.WithSelf.Op.type.351) = import_ref Main//included_with_range, loc8_14, loaded [symbolic = @I.WithSelf.%I.WithSelf.Op (constants.%I.WithSelf.Op.fcf)] // CHECK:STDOUT: %Main.import_ref.b48: = import_ref Main//included_with_range, loc13_15, loaded [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %Main.import_ref.335: type = import_ref Main//included_with_range, loc13_8, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.import_ref.c3f: type = import_ref Main//included_with_range, loc13_13, loaded [concrete = constants.%I.type] -// CHECK:STDOUT: %Main.import_ref.341: %C.as.I.impl.Op.type = import_ref Main//included_with_range, loc14_32, loaded [concrete = constants.%C.as.I.impl.Op] +// CHECK:STDOUT: %Main.import_ref.341: %C.as.I.impl.Op.type = import_ref Main//included_with_range, loc14_24, loaded [concrete = constants.%C.as.I.impl.Op] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.341), @C.as.I.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -357,9 +358,9 @@ fn F(c: C) { c.(I.Op)(); } // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.ddc: %I.assoc_type = import_ref Main//excluded_with_range, loc6_22, loaded [concrete = constants.%assoc0] -// CHECK:STDOUT: %Main.import_ref.421: @I.WithSelf.%I.WithSelf.Op.type (%I.WithSelf.Op.type.351) = import_ref Main//excluded_with_range, loc6_22, loaded [symbolic = @I.WithSelf.%I.WithSelf.Op (constants.%I.WithSelf.Op.fcf)] -// CHECK:STDOUT: %Main.import_ref.341: %C.as.I.impl.Op.type = import_ref Main//excluded_with_range, loc12_32, loaded [concrete = constants.%C.as.I.impl.Op] +// CHECK:STDOUT: %Main.import_ref.ddc: %I.assoc_type = import_ref Main//excluded_with_range, loc6_14, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Main.import_ref.421: @I.WithSelf.%I.WithSelf.Op.type (%I.WithSelf.Op.type.351) = import_ref Main//excluded_with_range, loc6_14, loaded [symbolic = @I.WithSelf.%I.WithSelf.Op (constants.%I.WithSelf.Op.fcf)] +// CHECK:STDOUT: %Main.import_ref.341: %C.as.I.impl.Op.type = import_ref Main//excluded_with_range, loc12_24, loaded [concrete = constants.%C.as.I.impl.Op] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.341), @C.as.I.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/multi_error.carbon b/toolchain/check/testdata/basics/multi_error.carbon index 2a8906e53f0e..7b3e7c7303d9 100644 --- a/toolchain/check/testdata/basics/multi_error.carbon +++ b/toolchain/check/testdata/basics/multi_error.carbon @@ -17,12 +17,12 @@ // This regression test ensures that reuse of `` in different scopes // works. -// CHECK:STDERR: fail_multi_error.carbon:[[@LINE+4]]:8: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant] +// CHECK:STDERR: fail_multi_error.carbon:[[@LINE+4]]:8: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant] // CHECK:STDERR: fn Foo[a: ()](); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fn Foo[a: ()](); -// CHECK:STDERR: fail_multi_error.carbon:[[@LINE+4]]:8: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant] +// CHECK:STDERR: fail_multi_error.carbon:[[@LINE+4]]:8: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant] // CHECK:STDERR: fn Boo[a: ()]() {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index f7508bb3c9e6..b52cc6095cf7 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -17,6 +17,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { return (p, ()); } + // CHECK:STDOUT: --- // CHECK:STDOUT: filename: one_file.carbon // CHECK:STDOUT: sem_ir: @@ -84,7 +85,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: import_ir_inst2B: {ir_id: import_ir78000004, inst_id: inst700000BB} // CHECK:STDOUT: import_ir_inst2C: {ir_id: import_ir78000004, inst_id: inst700000BC} // CHECK:STDOUT: import_ir_inst2D: {ir_id: import_ir78000004, inst_id: inst700000BD} -// CHECK:STDOUT: import_ir_inst2E: {ir_id: import_ir78000004, inst_id: inst700000C3} +// CHECK:STDOUT: import_ir_inst2E: {ir_id: import_ir78000004, inst_id: inst700000C4} // CHECK:STDOUT: import_ir_inst2F: {ir_id: import_ir78000004, inst_id: inst70000079} // CHECK:STDOUT: import_ir_inst30: {ir_id: import_ir78000004, inst_id: inst7000007F} // CHECK:STDOUT: import_ir_inst31: {ir_id: import_ir78000004, inst_id: inst70000082} @@ -95,165 +96,165 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: import_ir_inst36: {ir_id: import_ir78000004, inst_id: inst70000088} // CHECK:STDOUT: import_ir_inst37: {ir_id: import_ir78000004, inst_id: inst700000A0} // CHECK:STDOUT: import_ir_inst38: {ir_id: import_ir78000004, inst_id: inst700000A1} -// CHECK:STDOUT: import_ir_inst39: {ir_id: import_ir78000004, inst_id: inst700000D3} -// CHECK:STDOUT: import_ir_inst3A: {ir_id: import_ir78000004, inst_id: inst700000D1} -// CHECK:STDOUT: import_ir_inst3B: {ir_id: import_ir78000004, inst_id: inst700000CF} -// CHECK:STDOUT: import_ir_inst3C: {ir_id: import_ir78000004, inst_id: inst700000D0} -// CHECK:STDOUT: import_ir_inst3D: {ir_id: import_ir78000004, inst_id: inst700000EC} -// CHECK:STDOUT: import_ir_inst3E: {ir_id: import_ir78000004, inst_id: inst700000EA} -// CHECK:STDOUT: import_ir_inst3F: {ir_id: import_ir78000004, inst_id: inst700000E8} -// CHECK:STDOUT: import_ir_inst40: {ir_id: import_ir78000004, inst_id: inst700000E9} -// CHECK:STDOUT: import_ir_inst41: {ir_id: import_ir78000004, inst_id: inst70000105} -// CHECK:STDOUT: import_ir_inst42: {ir_id: import_ir78000004, inst_id: inst70000103} -// CHECK:STDOUT: import_ir_inst43: {ir_id: import_ir78000004, inst_id: inst70000101} -// CHECK:STDOUT: import_ir_inst44: {ir_id: import_ir78000004, inst_id: inst70000102} -// CHECK:STDOUT: import_ir_inst45: {ir_id: import_ir78000004, inst_id: inst7000011E} -// CHECK:STDOUT: import_ir_inst46: {ir_id: import_ir78000004, inst_id: inst7000011C} -// CHECK:STDOUT: import_ir_inst47: {ir_id: import_ir78000004, inst_id: inst7000011A} -// CHECK:STDOUT: import_ir_inst48: {ir_id: import_ir78000004, inst_id: inst7000011B} -// CHECK:STDOUT: import_ir_inst49: {ir_id: import_ir78000004, inst_id: inst70000141} -// CHECK:STDOUT: import_ir_inst4A: {ir_id: import_ir78000004, inst_id: inst7000013F} -// CHECK:STDOUT: import_ir_inst4B: {ir_id: import_ir78000004, inst_id: inst70000155} -// CHECK:STDOUT: import_ir_inst4C: {ir_id: import_ir78000004, inst_id: inst70000140} -// CHECK:STDOUT: import_ir_inst4D: {ir_id: import_ir78000004, inst_id: inst70000138} -// CHECK:STDOUT: import_ir_inst4E: {ir_id: import_ir78000004, inst_id: inst7000013A} -// CHECK:STDOUT: import_ir_inst4F: {ir_id: import_ir78000004, inst_id: inst7000013D} -// CHECK:STDOUT: import_ir_inst50: {ir_id: import_ir78000004, inst_id: inst70000135} -// CHECK:STDOUT: import_ir_inst51: {ir_id: import_ir78000004, inst_id: inst70000137} -// CHECK:STDOUT: import_ir_inst52: {ir_id: import_ir78000004, inst_id: inst7000013C} -// CHECK:STDOUT: import_ir_inst53: {ir_id: import_ir78000004, inst_id: inst70000143} -// CHECK:STDOUT: import_ir_inst54: {ir_id: import_ir78000004, inst_id: inst70000155} -// CHECK:STDOUT: import_ir_inst55: {ir_id: import_ir78000004, inst_id: inst70000150} -// CHECK:STDOUT: import_ir_inst56: {ir_id: import_ir78000004, inst_id: inst70000151} -// CHECK:STDOUT: import_ir_inst57: {ir_id: import_ir78000004, inst_id: inst70000148} -// CHECK:STDOUT: import_ir_inst58: {ir_id: import_ir78000004, inst_id: inst7000014B} -// CHECK:STDOUT: import_ir_inst59: {ir_id: import_ir78000004, inst_id: inst7000014C} -// CHECK:STDOUT: import_ir_inst5A: {ir_id: import_ir78000004, inst_id: inst7000014D} -// CHECK:STDOUT: import_ir_inst5B: {ir_id: import_ir78000004, inst_id: inst70000135} -// CHECK:STDOUT: import_ir_inst5C: {ir_id: import_ir78000004, inst_id: inst70000145} -// CHECK:STDOUT: import_ir_inst5D: {ir_id: import_ir78000004, inst_id: inst70000146} -// CHECK:STDOUT: import_ir_inst5E: {ir_id: import_ir78000004, inst_id: inst70000149} -// CHECK:STDOUT: import_ir_inst5F: {ir_id: import_ir78000004, inst_id: inst7000014F} -// CHECK:STDOUT: import_ir_inst60: {ir_id: import_ir78000004, inst_id: inst70000158} -// CHECK:STDOUT: import_ir_inst61: {ir_id: import_ir78000004, inst_id: inst70000159} -// CHECK:STDOUT: import_ir_inst62: {ir_id: import_ir78000004, inst_id: inst7000015C} -// CHECK:STDOUT: import_ir_inst63: {ir_id: import_ir78000004, inst_id: inst70000164} -// CHECK:STDOUT: import_ir_inst64: {ir_id: import_ir78000004, inst_id: inst70000162} -// CHECK:STDOUT: import_ir_inst65: {ir_id: import_ir78000004, inst_id: inst70000160} -// CHECK:STDOUT: import_ir_inst66: {ir_id: import_ir78000004, inst_id: inst70000161} -// CHECK:STDOUT: import_ir_inst67: {ir_id: import_ir78000004, inst_id: inst7000017D} -// CHECK:STDOUT: import_ir_inst68: {ir_id: import_ir78000004, inst_id: inst7000017B} -// CHECK:STDOUT: import_ir_inst69: {ir_id: import_ir78000004, inst_id: inst70000179} -// CHECK:STDOUT: import_ir_inst6A: {ir_id: import_ir78000004, inst_id: inst7000017A} -// CHECK:STDOUT: import_ir_inst6B: {ir_id: import_ir78000004, inst_id: inst700001B3} -// CHECK:STDOUT: import_ir_inst6C: {ir_id: import_ir78000004, inst_id: inst700001B1} -// CHECK:STDOUT: import_ir_inst6D: {ir_id: import_ir78000004, inst_id: inst700001CE} -// CHECK:STDOUT: import_ir_inst6E: {ir_id: import_ir78000004, inst_id: inst700001B2} -// CHECK:STDOUT: import_ir_inst6F: {ir_id: import_ir78000004, inst_id: inst700001CE} -// CHECK:STDOUT: import_ir_inst70: {ir_id: import_ir78000004, inst_id: inst700001C9} -// CHECK:STDOUT: import_ir_inst71: {ir_id: import_ir78000004, inst_id: inst700001CA} -// CHECK:STDOUT: import_ir_inst72: {ir_id: import_ir78000004, inst_id: inst700001C1} -// CHECK:STDOUT: import_ir_inst73: {ir_id: import_ir78000004, inst_id: inst700001C4} -// CHECK:STDOUT: import_ir_inst74: {ir_id: import_ir78000004, inst_id: inst700001C5} -// CHECK:STDOUT: import_ir_inst75: {ir_id: import_ir78000004, inst_id: inst700001C6} -// CHECK:STDOUT: import_ir_inst76: {ir_id: import_ir78000004, inst_id: inst70000194} -// CHECK:STDOUT: import_ir_inst77: {ir_id: import_ir78000004, inst_id: inst70000199} -// CHECK:STDOUT: import_ir_inst78: {ir_id: import_ir78000004, inst_id: inst700001BB} -// CHECK:STDOUT: import_ir_inst79: {ir_id: import_ir78000004, inst_id: inst700001BC} -// CHECK:STDOUT: import_ir_inst7A: {ir_id: import_ir78000004, inst_id: inst700001BD} -// CHECK:STDOUT: import_ir_inst7B: {ir_id: import_ir78000004, inst_id: inst700001BE} -// CHECK:STDOUT: import_ir_inst7C: {ir_id: import_ir78000004, inst_id: inst700001BF} -// CHECK:STDOUT: import_ir_inst7D: {ir_id: import_ir78000004, inst_id: inst700001C2} -// CHECK:STDOUT: import_ir_inst7E: {ir_id: import_ir78000004, inst_id: inst700001C8} -// CHECK:STDOUT: import_ir_inst7F: {ir_id: import_ir78000004, inst_id: inst700001D9} -// CHECK:STDOUT: import_ir_inst80: {ir_id: import_ir78000004, inst_id: inst700001DF} -// CHECK:STDOUT: import_ir_inst81: {ir_id: import_ir78000004, inst_id: inst700001E3} -// CHECK:STDOUT: import_ir_inst82: {ir_id: import_ir78000004, inst_id: inst700001E4} -// CHECK:STDOUT: import_ir_inst83: {ir_id: import_ir78000004, inst_id: inst700001E5} -// CHECK:STDOUT: import_ir_inst84: {ir_id: import_ir78000004, inst_id: inst700001E6} -// CHECK:STDOUT: import_ir_inst85: {ir_id: import_ir78000004, inst_id: inst700001E9} -// CHECK:STDOUT: import_ir_inst86: {ir_id: import_ir78000004, inst_id: inst700001F3} -// CHECK:STDOUT: import_ir_inst87: {ir_id: import_ir78000004, inst_id: inst700001FC} -// CHECK:STDOUT: import_ir_inst88: {ir_id: import_ir78000004, inst_id: inst700001FD} -// CHECK:STDOUT: import_ir_inst89: {ir_id: import_ir78000004, inst_id: inst700001FE} -// CHECK:STDOUT: import_ir_inst8A: {ir_id: import_ir78000004, inst_id: inst700001FF} -// CHECK:STDOUT: import_ir_inst8B: {ir_id: import_ir78000004, inst_id: inst70000205} -// CHECK:STDOUT: import_ir_inst8C: {ir_id: import_ir78000004, inst_id: inst7000019C} -// CHECK:STDOUT: import_ir_inst8D: {ir_id: import_ir78000004, inst_id: inst70000196} -// CHECK:STDOUT: import_ir_inst8E: {ir_id: import_ir78000004, inst_id: inst700001AC} -// CHECK:STDOUT: import_ir_inst8F: {ir_id: import_ir78000004, inst_id: inst700001AE} -// CHECK:STDOUT: import_ir_inst90: {ir_id: import_ir78000004, inst_id: inst70000194} -// CHECK:STDOUT: import_ir_inst91: {ir_id: import_ir78000004, inst_id: inst70000199} -// CHECK:STDOUT: import_ir_inst92: {ir_id: import_ir78000004, inst_id: inst70000195} -// CHECK:STDOUT: import_ir_inst93: {ir_id: import_ir78000004, inst_id: inst7000019B} -// CHECK:STDOUT: import_ir_inst94: {ir_id: import_ir78000004, inst_id: inst700001A2} -// CHECK:STDOUT: import_ir_inst95: {ir_id: import_ir78000004, inst_id: inst700001A5} -// CHECK:STDOUT: import_ir_inst96: {ir_id: import_ir78000004, inst_id: inst700001A9} -// CHECK:STDOUT: import_ir_inst97: {ir_id: import_ir78000004, inst_id: inst700001AD} -// CHECK:STDOUT: import_ir_inst98: {ir_id: import_ir78000004, inst_id: inst700001B5} -// CHECK:STDOUT: import_ir_inst99: {ir_id: import_ir78000004, inst_id: inst700001D1} -// CHECK:STDOUT: import_ir_inst9A: {ir_id: import_ir78000004, inst_id: inst700001D2} -// CHECK:STDOUT: import_ir_inst9B: {ir_id: import_ir78000004, inst_id: inst7000023F} -// CHECK:STDOUT: import_ir_inst9C: {ir_id: import_ir78000004, inst_id: inst7000023D} -// CHECK:STDOUT: import_ir_inst9D: {ir_id: import_ir78000004, inst_id: inst7000025E} -// CHECK:STDOUT: import_ir_inst9E: {ir_id: import_ir78000004, inst_id: inst7000023E} -// CHECK:STDOUT: import_ir_inst9F: {ir_id: import_ir78000004, inst_id: inst7000025E} -// CHECK:STDOUT: import_ir_instA0: {ir_id: import_ir78000004, inst_id: inst70000259} -// CHECK:STDOUT: import_ir_instA1: {ir_id: import_ir78000004, inst_id: inst7000025A} -// CHECK:STDOUT: import_ir_instA2: {ir_id: import_ir78000004, inst_id: inst70000251} -// CHECK:STDOUT: import_ir_instA3: {ir_id: import_ir78000004, inst_id: inst70000254} -// CHECK:STDOUT: import_ir_instA4: {ir_id: import_ir78000004, inst_id: inst70000255} -// CHECK:STDOUT: import_ir_instA5: {ir_id: import_ir78000004, inst_id: inst70000256} -// CHECK:STDOUT: import_ir_instA6: {ir_id: import_ir78000004, inst_id: inst70000216} -// CHECK:STDOUT: import_ir_instA7: {ir_id: import_ir78000004, inst_id: inst7000021B} -// CHECK:STDOUT: import_ir_instA8: {ir_id: import_ir78000004, inst_id: inst70000220} -// CHECK:STDOUT: import_ir_instA9: {ir_id: import_ir78000004, inst_id: inst70000249} -// CHECK:STDOUT: import_ir_instAA: {ir_id: import_ir78000004, inst_id: inst7000024A} -// CHECK:STDOUT: import_ir_instAB: {ir_id: import_ir78000004, inst_id: inst7000024B} -// CHECK:STDOUT: import_ir_instAC: {ir_id: import_ir78000004, inst_id: inst7000024C} -// CHECK:STDOUT: import_ir_instAD: {ir_id: import_ir78000004, inst_id: inst7000024D} -// CHECK:STDOUT: import_ir_instAE: {ir_id: import_ir78000004, inst_id: inst7000024E} -// CHECK:STDOUT: import_ir_instAF: {ir_id: import_ir78000004, inst_id: inst7000024F} -// CHECK:STDOUT: import_ir_instB0: {ir_id: import_ir78000004, inst_id: inst70000252} -// CHECK:STDOUT: import_ir_instB1: {ir_id: import_ir78000004, inst_id: inst70000258} -// CHECK:STDOUT: import_ir_instB2: {ir_id: import_ir78000004, inst_id: inst70000269} -// CHECK:STDOUT: import_ir_instB3: {ir_id: import_ir78000004, inst_id: inst7000026E} -// CHECK:STDOUT: import_ir_instB4: {ir_id: import_ir78000004, inst_id: inst70000272} -// CHECK:STDOUT: import_ir_instB5: {ir_id: import_ir78000004, inst_id: inst70000273} -// CHECK:STDOUT: import_ir_instB6: {ir_id: import_ir78000004, inst_id: inst70000274} -// CHECK:STDOUT: import_ir_instB7: {ir_id: import_ir78000004, inst_id: inst70000275} -// CHECK:STDOUT: import_ir_instB8: {ir_id: import_ir78000004, inst_id: inst70000278} -// CHECK:STDOUT: import_ir_instB9: {ir_id: import_ir78000004, inst_id: inst70000280} -// CHECK:STDOUT: import_ir_instBA: {ir_id: import_ir78000004, inst_id: inst70000284} -// CHECK:STDOUT: import_ir_instBB: {ir_id: import_ir78000004, inst_id: inst70000285} -// CHECK:STDOUT: import_ir_instBC: {ir_id: import_ir78000004, inst_id: inst70000286} -// CHECK:STDOUT: import_ir_instBD: {ir_id: import_ir78000004, inst_id: inst70000287} -// CHECK:STDOUT: import_ir_instBE: {ir_id: import_ir78000004, inst_id: inst7000028A} -// CHECK:STDOUT: import_ir_instBF: {ir_id: import_ir78000004, inst_id: inst70000294} -// CHECK:STDOUT: import_ir_instC0: {ir_id: import_ir78000004, inst_id: inst7000029D} -// CHECK:STDOUT: import_ir_instC1: {ir_id: import_ir78000004, inst_id: inst7000029E} -// CHECK:STDOUT: import_ir_instC2: {ir_id: import_ir78000004, inst_id: inst7000029F} -// CHECK:STDOUT: import_ir_instC3: {ir_id: import_ir78000004, inst_id: inst700002A0} -// CHECK:STDOUT: import_ir_instC4: {ir_id: import_ir78000004, inst_id: inst700002A6} -// CHECK:STDOUT: import_ir_instC5: {ir_id: import_ir78000004, inst_id: inst70000223} -// CHECK:STDOUT: import_ir_instC6: {ir_id: import_ir78000004, inst_id: inst7000021D} -// CHECK:STDOUT: import_ir_instC7: {ir_id: import_ir78000004, inst_id: inst70000218} -// CHECK:STDOUT: import_ir_instC8: {ir_id: import_ir78000004, inst_id: inst70000237} -// CHECK:STDOUT: import_ir_instC9: {ir_id: import_ir78000004, inst_id: inst70000239} -// CHECK:STDOUT: import_ir_instCA: {ir_id: import_ir78000004, inst_id: inst70000216} -// CHECK:STDOUT: import_ir_instCB: {ir_id: import_ir78000004, inst_id: inst7000021B} -// CHECK:STDOUT: import_ir_instCC: {ir_id: import_ir78000004, inst_id: inst70000220} -// CHECK:STDOUT: import_ir_instCD: {ir_id: import_ir78000004, inst_id: inst70000217} -// CHECK:STDOUT: import_ir_instCE: {ir_id: import_ir78000004, inst_id: inst7000021C} -// CHECK:STDOUT: import_ir_instCF: {ir_id: import_ir78000004, inst_id: inst70000222} -// CHECK:STDOUT: import_ir_instD0: {ir_id: import_ir78000004, inst_id: inst7000022A} -// CHECK:STDOUT: import_ir_instD1: {ir_id: import_ir78000004, inst_id: inst7000022D} -// CHECK:STDOUT: import_ir_instD2: {ir_id: import_ir78000004, inst_id: inst70000230} -// CHECK:STDOUT: import_ir_instD3: {ir_id: import_ir78000004, inst_id: inst70000234} -// CHECK:STDOUT: import_ir_instD4: {ir_id: import_ir78000004, inst_id: inst70000238} -// CHECK:STDOUT: import_ir_instD5: {ir_id: import_ir78000004, inst_id: inst70000241} -// CHECK:STDOUT: import_ir_instD6: {ir_id: import_ir78000004, inst_id: inst70000261} -// CHECK:STDOUT: import_ir_instD7: {ir_id: import_ir78000004, inst_id: inst70000262} +// CHECK:STDOUT: import_ir_inst39: {ir_id: import_ir78000004, inst_id: inst700000D4} +// CHECK:STDOUT: import_ir_inst3A: {ir_id: import_ir78000004, inst_id: inst700000D2} +// CHECK:STDOUT: import_ir_inst3B: {ir_id: import_ir78000004, inst_id: inst700000D0} +// CHECK:STDOUT: import_ir_inst3C: {ir_id: import_ir78000004, inst_id: inst700000D1} +// CHECK:STDOUT: import_ir_inst3D: {ir_id: import_ir78000004, inst_id: inst700000ED} +// CHECK:STDOUT: import_ir_inst3E: {ir_id: import_ir78000004, inst_id: inst700000EB} +// CHECK:STDOUT: import_ir_inst3F: {ir_id: import_ir78000004, inst_id: inst700000E9} +// CHECK:STDOUT: import_ir_inst40: {ir_id: import_ir78000004, inst_id: inst700000EA} +// CHECK:STDOUT: import_ir_inst41: {ir_id: import_ir78000004, inst_id: inst70000106} +// CHECK:STDOUT: import_ir_inst42: {ir_id: import_ir78000004, inst_id: inst70000104} +// CHECK:STDOUT: import_ir_inst43: {ir_id: import_ir78000004, inst_id: inst70000102} +// CHECK:STDOUT: import_ir_inst44: {ir_id: import_ir78000004, inst_id: inst70000103} +// CHECK:STDOUT: import_ir_inst45: {ir_id: import_ir78000004, inst_id: inst7000011F} +// CHECK:STDOUT: import_ir_inst46: {ir_id: import_ir78000004, inst_id: inst7000011D} +// CHECK:STDOUT: import_ir_inst47: {ir_id: import_ir78000004, inst_id: inst7000011B} +// CHECK:STDOUT: import_ir_inst48: {ir_id: import_ir78000004, inst_id: inst7000011C} +// CHECK:STDOUT: import_ir_inst49: {ir_id: import_ir78000004, inst_id: inst70000142} +// CHECK:STDOUT: import_ir_inst4A: {ir_id: import_ir78000004, inst_id: inst70000140} +// CHECK:STDOUT: import_ir_inst4B: {ir_id: import_ir78000004, inst_id: inst70000156} +// CHECK:STDOUT: import_ir_inst4C: {ir_id: import_ir78000004, inst_id: inst70000141} +// CHECK:STDOUT: import_ir_inst4D: {ir_id: import_ir78000004, inst_id: inst70000139} +// CHECK:STDOUT: import_ir_inst4E: {ir_id: import_ir78000004, inst_id: inst7000013B} +// CHECK:STDOUT: import_ir_inst4F: {ir_id: import_ir78000004, inst_id: inst7000013E} +// CHECK:STDOUT: import_ir_inst50: {ir_id: import_ir78000004, inst_id: inst70000136} +// CHECK:STDOUT: import_ir_inst51: {ir_id: import_ir78000004, inst_id: inst70000138} +// CHECK:STDOUT: import_ir_inst52: {ir_id: import_ir78000004, inst_id: inst7000013D} +// CHECK:STDOUT: import_ir_inst53: {ir_id: import_ir78000004, inst_id: inst70000144} +// CHECK:STDOUT: import_ir_inst54: {ir_id: import_ir78000004, inst_id: inst70000156} +// CHECK:STDOUT: import_ir_inst55: {ir_id: import_ir78000004, inst_id: inst70000151} +// CHECK:STDOUT: import_ir_inst56: {ir_id: import_ir78000004, inst_id: inst70000152} +// CHECK:STDOUT: import_ir_inst57: {ir_id: import_ir78000004, inst_id: inst70000149} +// CHECK:STDOUT: import_ir_inst58: {ir_id: import_ir78000004, inst_id: inst7000014C} +// CHECK:STDOUT: import_ir_inst59: {ir_id: import_ir78000004, inst_id: inst7000014D} +// CHECK:STDOUT: import_ir_inst5A: {ir_id: import_ir78000004, inst_id: inst7000014E} +// CHECK:STDOUT: import_ir_inst5B: {ir_id: import_ir78000004, inst_id: inst70000136} +// CHECK:STDOUT: import_ir_inst5C: {ir_id: import_ir78000004, inst_id: inst70000146} +// CHECK:STDOUT: import_ir_inst5D: {ir_id: import_ir78000004, inst_id: inst70000147} +// CHECK:STDOUT: import_ir_inst5E: {ir_id: import_ir78000004, inst_id: inst7000014A} +// CHECK:STDOUT: import_ir_inst5F: {ir_id: import_ir78000004, inst_id: inst70000150} +// CHECK:STDOUT: import_ir_inst60: {ir_id: import_ir78000004, inst_id: inst70000159} +// CHECK:STDOUT: import_ir_inst61: {ir_id: import_ir78000004, inst_id: inst7000015A} +// CHECK:STDOUT: import_ir_inst62: {ir_id: import_ir78000004, inst_id: inst7000015D} +// CHECK:STDOUT: import_ir_inst63: {ir_id: import_ir78000004, inst_id: inst70000165} +// CHECK:STDOUT: import_ir_inst64: {ir_id: import_ir78000004, inst_id: inst70000163} +// CHECK:STDOUT: import_ir_inst65: {ir_id: import_ir78000004, inst_id: inst70000161} +// CHECK:STDOUT: import_ir_inst66: {ir_id: import_ir78000004, inst_id: inst70000162} +// CHECK:STDOUT: import_ir_inst67: {ir_id: import_ir78000004, inst_id: inst7000017E} +// CHECK:STDOUT: import_ir_inst68: {ir_id: import_ir78000004, inst_id: inst7000017C} +// CHECK:STDOUT: import_ir_inst69: {ir_id: import_ir78000004, inst_id: inst7000017A} +// CHECK:STDOUT: import_ir_inst6A: {ir_id: import_ir78000004, inst_id: inst7000017B} +// CHECK:STDOUT: import_ir_inst6B: {ir_id: import_ir78000004, inst_id: inst700001B4} +// CHECK:STDOUT: import_ir_inst6C: {ir_id: import_ir78000004, inst_id: inst700001B2} +// CHECK:STDOUT: import_ir_inst6D: {ir_id: import_ir78000004, inst_id: inst700001CF} +// CHECK:STDOUT: import_ir_inst6E: {ir_id: import_ir78000004, inst_id: inst700001B3} +// CHECK:STDOUT: import_ir_inst6F: {ir_id: import_ir78000004, inst_id: inst700001CF} +// CHECK:STDOUT: import_ir_inst70: {ir_id: import_ir78000004, inst_id: inst700001CA} +// CHECK:STDOUT: import_ir_inst71: {ir_id: import_ir78000004, inst_id: inst700001CB} +// CHECK:STDOUT: import_ir_inst72: {ir_id: import_ir78000004, inst_id: inst700001C2} +// CHECK:STDOUT: import_ir_inst73: {ir_id: import_ir78000004, inst_id: inst700001C5} +// CHECK:STDOUT: import_ir_inst74: {ir_id: import_ir78000004, inst_id: inst700001C6} +// CHECK:STDOUT: import_ir_inst75: {ir_id: import_ir78000004, inst_id: inst700001C7} +// CHECK:STDOUT: import_ir_inst76: {ir_id: import_ir78000004, inst_id: inst70000195} +// CHECK:STDOUT: import_ir_inst77: {ir_id: import_ir78000004, inst_id: inst7000019A} +// CHECK:STDOUT: import_ir_inst78: {ir_id: import_ir78000004, inst_id: inst700001BC} +// CHECK:STDOUT: import_ir_inst79: {ir_id: import_ir78000004, inst_id: inst700001BD} +// CHECK:STDOUT: import_ir_inst7A: {ir_id: import_ir78000004, inst_id: inst700001BE} +// CHECK:STDOUT: import_ir_inst7B: {ir_id: import_ir78000004, inst_id: inst700001BF} +// CHECK:STDOUT: import_ir_inst7C: {ir_id: import_ir78000004, inst_id: inst700001C0} +// CHECK:STDOUT: import_ir_inst7D: {ir_id: import_ir78000004, inst_id: inst700001C3} +// CHECK:STDOUT: import_ir_inst7E: {ir_id: import_ir78000004, inst_id: inst700001C9} +// CHECK:STDOUT: import_ir_inst7F: {ir_id: import_ir78000004, inst_id: inst700001DA} +// CHECK:STDOUT: import_ir_inst80: {ir_id: import_ir78000004, inst_id: inst700001E0} +// CHECK:STDOUT: import_ir_inst81: {ir_id: import_ir78000004, inst_id: inst700001E4} +// CHECK:STDOUT: import_ir_inst82: {ir_id: import_ir78000004, inst_id: inst700001E5} +// CHECK:STDOUT: import_ir_inst83: {ir_id: import_ir78000004, inst_id: inst700001E6} +// CHECK:STDOUT: import_ir_inst84: {ir_id: import_ir78000004, inst_id: inst700001E7} +// CHECK:STDOUT: import_ir_inst85: {ir_id: import_ir78000004, inst_id: inst700001EB} +// CHECK:STDOUT: import_ir_inst86: {ir_id: import_ir78000004, inst_id: inst700001F5} +// CHECK:STDOUT: import_ir_inst87: {ir_id: import_ir78000004, inst_id: inst700001FE} +// CHECK:STDOUT: import_ir_inst88: {ir_id: import_ir78000004, inst_id: inst700001FF} +// CHECK:STDOUT: import_ir_inst89: {ir_id: import_ir78000004, inst_id: inst70000200} +// CHECK:STDOUT: import_ir_inst8A: {ir_id: import_ir78000004, inst_id: inst70000201} +// CHECK:STDOUT: import_ir_inst8B: {ir_id: import_ir78000004, inst_id: inst70000208} +// CHECK:STDOUT: import_ir_inst8C: {ir_id: import_ir78000004, inst_id: inst7000019D} +// CHECK:STDOUT: import_ir_inst8D: {ir_id: import_ir78000004, inst_id: inst70000197} +// CHECK:STDOUT: import_ir_inst8E: {ir_id: import_ir78000004, inst_id: inst700001AD} +// CHECK:STDOUT: import_ir_inst8F: {ir_id: import_ir78000004, inst_id: inst700001AF} +// CHECK:STDOUT: import_ir_inst90: {ir_id: import_ir78000004, inst_id: inst70000195} +// CHECK:STDOUT: import_ir_inst91: {ir_id: import_ir78000004, inst_id: inst7000019A} +// CHECK:STDOUT: import_ir_inst92: {ir_id: import_ir78000004, inst_id: inst70000196} +// CHECK:STDOUT: import_ir_inst93: {ir_id: import_ir78000004, inst_id: inst7000019C} +// CHECK:STDOUT: import_ir_inst94: {ir_id: import_ir78000004, inst_id: inst700001A3} +// CHECK:STDOUT: import_ir_inst95: {ir_id: import_ir78000004, inst_id: inst700001A6} +// CHECK:STDOUT: import_ir_inst96: {ir_id: import_ir78000004, inst_id: inst700001AA} +// CHECK:STDOUT: import_ir_inst97: {ir_id: import_ir78000004, inst_id: inst700001AE} +// CHECK:STDOUT: import_ir_inst98: {ir_id: import_ir78000004, inst_id: inst700001B6} +// CHECK:STDOUT: import_ir_inst99: {ir_id: import_ir78000004, inst_id: inst700001D2} +// CHECK:STDOUT: import_ir_inst9A: {ir_id: import_ir78000004, inst_id: inst700001D3} +// CHECK:STDOUT: import_ir_inst9B: {ir_id: import_ir78000004, inst_id: inst70000242} +// CHECK:STDOUT: import_ir_inst9C: {ir_id: import_ir78000004, inst_id: inst70000240} +// CHECK:STDOUT: import_ir_inst9D: {ir_id: import_ir78000004, inst_id: inst70000261} +// CHECK:STDOUT: import_ir_inst9E: {ir_id: import_ir78000004, inst_id: inst70000241} +// CHECK:STDOUT: import_ir_inst9F: {ir_id: import_ir78000004, inst_id: inst70000261} +// CHECK:STDOUT: import_ir_instA0: {ir_id: import_ir78000004, inst_id: inst7000025C} +// CHECK:STDOUT: import_ir_instA1: {ir_id: import_ir78000004, inst_id: inst7000025D} +// CHECK:STDOUT: import_ir_instA2: {ir_id: import_ir78000004, inst_id: inst70000254} +// CHECK:STDOUT: import_ir_instA3: {ir_id: import_ir78000004, inst_id: inst70000257} +// CHECK:STDOUT: import_ir_instA4: {ir_id: import_ir78000004, inst_id: inst70000258} +// CHECK:STDOUT: import_ir_instA5: {ir_id: import_ir78000004, inst_id: inst70000259} +// CHECK:STDOUT: import_ir_instA6: {ir_id: import_ir78000004, inst_id: inst70000219} +// CHECK:STDOUT: import_ir_instA7: {ir_id: import_ir78000004, inst_id: inst7000021E} +// CHECK:STDOUT: import_ir_instA8: {ir_id: import_ir78000004, inst_id: inst70000223} +// CHECK:STDOUT: import_ir_instA9: {ir_id: import_ir78000004, inst_id: inst7000024C} +// CHECK:STDOUT: import_ir_instAA: {ir_id: import_ir78000004, inst_id: inst7000024D} +// CHECK:STDOUT: import_ir_instAB: {ir_id: import_ir78000004, inst_id: inst7000024E} +// CHECK:STDOUT: import_ir_instAC: {ir_id: import_ir78000004, inst_id: inst7000024F} +// CHECK:STDOUT: import_ir_instAD: {ir_id: import_ir78000004, inst_id: inst70000250} +// CHECK:STDOUT: import_ir_instAE: {ir_id: import_ir78000004, inst_id: inst70000251} +// CHECK:STDOUT: import_ir_instAF: {ir_id: import_ir78000004, inst_id: inst70000252} +// CHECK:STDOUT: import_ir_instB0: {ir_id: import_ir78000004, inst_id: inst70000255} +// CHECK:STDOUT: import_ir_instB1: {ir_id: import_ir78000004, inst_id: inst7000025B} +// CHECK:STDOUT: import_ir_instB2: {ir_id: import_ir78000004, inst_id: inst7000026C} +// CHECK:STDOUT: import_ir_instB3: {ir_id: import_ir78000004, inst_id: inst70000271} +// CHECK:STDOUT: import_ir_instB4: {ir_id: import_ir78000004, inst_id: inst70000275} +// CHECK:STDOUT: import_ir_instB5: {ir_id: import_ir78000004, inst_id: inst70000276} +// CHECK:STDOUT: import_ir_instB6: {ir_id: import_ir78000004, inst_id: inst70000277} +// CHECK:STDOUT: import_ir_instB7: {ir_id: import_ir78000004, inst_id: inst70000278} +// CHECK:STDOUT: import_ir_instB8: {ir_id: import_ir78000004, inst_id: inst7000027C} +// CHECK:STDOUT: import_ir_instB9: {ir_id: import_ir78000004, inst_id: inst70000284} +// CHECK:STDOUT: import_ir_instBA: {ir_id: import_ir78000004, inst_id: inst70000288} +// CHECK:STDOUT: import_ir_instBB: {ir_id: import_ir78000004, inst_id: inst70000289} +// CHECK:STDOUT: import_ir_instBC: {ir_id: import_ir78000004, inst_id: inst7000028A} +// CHECK:STDOUT: import_ir_instBD: {ir_id: import_ir78000004, inst_id: inst7000028B} +// CHECK:STDOUT: import_ir_instBE: {ir_id: import_ir78000004, inst_id: inst7000028F} +// CHECK:STDOUT: import_ir_instBF: {ir_id: import_ir78000004, inst_id: inst70000299} +// CHECK:STDOUT: import_ir_instC0: {ir_id: import_ir78000004, inst_id: inst700002A2} +// CHECK:STDOUT: import_ir_instC1: {ir_id: import_ir78000004, inst_id: inst700002A3} +// CHECK:STDOUT: import_ir_instC2: {ir_id: import_ir78000004, inst_id: inst700002A4} +// CHECK:STDOUT: import_ir_instC3: {ir_id: import_ir78000004, inst_id: inst700002A5} +// CHECK:STDOUT: import_ir_instC4: {ir_id: import_ir78000004, inst_id: inst700002AC} +// CHECK:STDOUT: import_ir_instC5: {ir_id: import_ir78000004, inst_id: inst70000226} +// CHECK:STDOUT: import_ir_instC6: {ir_id: import_ir78000004, inst_id: inst70000220} +// CHECK:STDOUT: import_ir_instC7: {ir_id: import_ir78000004, inst_id: inst7000021B} +// CHECK:STDOUT: import_ir_instC8: {ir_id: import_ir78000004, inst_id: inst7000023A} +// CHECK:STDOUT: import_ir_instC9: {ir_id: import_ir78000004, inst_id: inst7000023C} +// CHECK:STDOUT: import_ir_instCA: {ir_id: import_ir78000004, inst_id: inst70000219} +// CHECK:STDOUT: import_ir_instCB: {ir_id: import_ir78000004, inst_id: inst7000021E} +// CHECK:STDOUT: import_ir_instCC: {ir_id: import_ir78000004, inst_id: inst70000223} +// CHECK:STDOUT: import_ir_instCD: {ir_id: import_ir78000004, inst_id: inst7000021A} +// CHECK:STDOUT: import_ir_instCE: {ir_id: import_ir78000004, inst_id: inst7000021F} +// CHECK:STDOUT: import_ir_instCF: {ir_id: import_ir78000004, inst_id: inst70000225} +// CHECK:STDOUT: import_ir_instD0: {ir_id: import_ir78000004, inst_id: inst7000022D} +// CHECK:STDOUT: import_ir_instD1: {ir_id: import_ir78000004, inst_id: inst70000230} +// CHECK:STDOUT: import_ir_instD2: {ir_id: import_ir78000004, inst_id: inst70000233} +// CHECK:STDOUT: import_ir_instD3: {ir_id: import_ir78000004, inst_id: inst70000237} +// CHECK:STDOUT: import_ir_instD4: {ir_id: import_ir78000004, inst_id: inst7000023B} +// CHECK:STDOUT: import_ir_instD5: {ir_id: import_ir78000004, inst_id: inst70000244} +// CHECK:STDOUT: import_ir_instD6: {ir_id: import_ir78000004, inst_id: inst70000264} +// CHECK:STDOUT: import_ir_instD7: {ir_id: import_ir78000004, inst_id: inst70000265} // CHECK:STDOUT: clang_decls: {} // CHECK:STDOUT: clang_decl_signatures: {} // CHECK:STDOUT: name_scopes: @@ -874,19 +875,23 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800017C: {kind: FunctionTypeWithSelfType, arg0: inst7800017B, arg1: inst7800017A, type: type(TypeType)} // CHECK:STDOUT: inst7800017D: {kind: ImplWitnessAccess, arg0: inst78000179, arg1: element0, type: type(symbolic_constant7800014A)} // CHECK:STDOUT: inst7800017E: {kind: BoundMethod, arg0: inst78000048, arg1: inst78000177, type: type(inst(BoundMethodType))} -// CHECK:STDOUT: inst7800017F: {kind: SpecificImplFunction, arg0: inst78000177, arg1: specific78000025, type: type(inst(SpecificFunctionType))} -// CHECK:STDOUT: inst78000180: {kind: SpecificImplFunction, arg0: inst78000178, arg1: specific78000025, type: type(inst(SpecificFunctionType))} -// CHECK:STDOUT: inst78000181: {kind: SpecificImplFunction, arg0: inst7800017D, arg1: specific78000026, type: type(inst(SpecificFunctionType))} -// CHECK:STDOUT: inst78000182: {kind: BoundMethod, arg0: inst78000048, arg1: inst7800017F, type: type(inst(BoundMethodType))} -// CHECK:STDOUT: inst78000183: {kind: Call, arg0: inst78000182, arg1: inst_block78000089, type: type(symbolic_constant78000004)} -// CHECK:STDOUT: inst78000184: {kind: InPlaceInit, arg0: inst78000183, arg1: inst7800004C, type: type(symbolic_constant78000004)} -// CHECK:STDOUT: inst78000185: {kind: TupleAccess, arg0: inst7800003C, arg1: element1, type: type(inst78000026)} -// CHECK:STDOUT: inst78000186: {kind: TupleInit, arg0: inst_block_empty, arg1: inst78000185, type: type(inst78000026)} -// CHECK:STDOUT: inst78000187: {kind: Converted, arg0: inst78000049, arg1: inst78000186, type: type(inst78000026)} -// CHECK:STDOUT: inst78000188: {kind: InPlaceInit, arg0: inst78000187, arg1: inst78000185, type: type(inst78000026)} -// CHECK:STDOUT: inst78000189: {kind: TupleInit, arg0: inst_block7800008A, arg1: inst7800003C, type: type(symbolic_constant7800000A)} -// CHECK:STDOUT: inst7800018A: {kind: Converted, arg0: inst7800004A, arg1: inst78000189, type: type(symbolic_constant7800000A)} -// CHECK:STDOUT: inst7800018B: {kind: ReturnExpr, arg0: inst7800018A, arg1: inst7800003C} +// CHECK:STDOUT: inst7800017F: {kind: LookupImplWitness, arg0: inst7800001D, arg1: specific_interface78000000, type: type(inst(WitnessType))} +// CHECK:STDOUT: inst78000180: {kind: RequireSpecificDefinition, arg0: specific7800000B, type: type(inst(RequireSpecificDefinitionType))} +// CHECK:STDOUT: inst78000181: {kind: FacetValue, arg0: inst7800001D, arg1: inst_block78000082, type: type(inst78000050)} +// CHECK:STDOUT: inst78000182: {kind: Converted, arg0: inst7800001D, arg1: inst78000181, type: type(inst78000050)} +// CHECK:STDOUT: inst78000183: {kind: SpecificImplFunction, arg0: inst78000177, arg1: specific78000025, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst78000184: {kind: SpecificImplFunction, arg0: inst78000178, arg1: specific78000025, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst78000185: {kind: SpecificImplFunction, arg0: inst7800017D, arg1: specific78000026, type: type(inst(SpecificFunctionType))} +// CHECK:STDOUT: inst78000186: {kind: BoundMethod, arg0: inst78000048, arg1: inst78000183, type: type(inst(BoundMethodType))} +// CHECK:STDOUT: inst78000187: {kind: Call, arg0: inst78000186, arg1: inst_block78000089, type: type(symbolic_constant78000004)} +// CHECK:STDOUT: inst78000188: {kind: InPlaceInit, arg0: inst78000187, arg1: inst7800004C, type: type(symbolic_constant78000004)} +// CHECK:STDOUT: inst78000189: {kind: TupleAccess, arg0: inst7800003C, arg1: element1, type: type(inst78000026)} +// CHECK:STDOUT: inst7800018A: {kind: TupleInit, arg0: inst_block_empty, arg1: inst78000189, type: type(inst78000026)} +// CHECK:STDOUT: inst7800018B: {kind: Converted, arg0: inst78000049, arg1: inst7800018A, type: type(inst78000026)} +// CHECK:STDOUT: inst7800018C: {kind: InPlaceInit, arg0: inst7800018B, arg1: inst78000189, type: type(inst78000026)} +// CHECK:STDOUT: inst7800018D: {kind: TupleInit, arg0: inst_block7800008A, arg1: inst7800003C, type: type(symbolic_constant7800000A)} +// CHECK:STDOUT: inst7800018E: {kind: Converted, arg0: inst7800004A, arg1: inst7800018D, type: type(symbolic_constant7800000A)} +// CHECK:STDOUT: inst7800018F: {kind: ReturnExpr, arg0: inst7800018E, arg1: inst7800003C} // CHECK:STDOUT: bundles: {} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: values: @@ -1248,12 +1253,15 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst7800017B: symbolic_constant78000149 // CHECK:STDOUT: inst7800017C: symbolic_constant7800014A // CHECK:STDOUT: inst7800017D: symbolic_constant7800014B -// CHECK:STDOUT: inst7800017F: symbolic_constant7800014D -// CHECK:STDOUT: inst78000180: symbolic_constant7800014C -// CHECK:STDOUT: inst78000181: symbolic_constant7800014D -// CHECK:STDOUT: inst78000186: concrete_constant(inst78000028) -// CHECK:STDOUT: inst78000187: concrete_constant(inst78000028) -// CHECK:STDOUT: inst78000188: concrete_constant(inst78000028) +// CHECK:STDOUT: inst78000180: symbolic_constant78000141 +// CHECK:STDOUT: inst78000181: symbolic_constant78000148 +// CHECK:STDOUT: inst78000182: symbolic_constant78000148 +// CHECK:STDOUT: inst78000183: symbolic_constant7800014D +// CHECK:STDOUT: inst78000184: symbolic_constant7800014C +// CHECK:STDOUT: inst78000185: symbolic_constant7800014D +// CHECK:STDOUT: inst7800018A: concrete_constant(inst78000028) +// CHECK:STDOUT: inst7800018B: concrete_constant(inst78000028) +// CHECK:STDOUT: inst7800018C: concrete_constant(inst78000028) // CHECK:STDOUT: symbolic_constants: // CHECK:STDOUT: symbolic_constant78000000: {inst: inst78000014, kind: self, attached: null} // CHECK:STDOUT: symbolic_constant78000001: {inst: inst78000018, kind: checked, attached: null} @@ -1587,8 +1595,8 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: symbolic_constant78000149: {inst: inst78000174, kind: checked, attached: {generic: generic78000000, index: generic_inst_in_def5}} // CHECK:STDOUT: symbolic_constant7800014A: {inst: inst78000176, kind: checked, attached: {generic: generic78000000, index: generic_inst_in_def6}} // CHECK:STDOUT: symbolic_constant7800014B: {inst: inst78000178, kind: checked, attached: {generic: generic78000000, index: generic_inst_in_def7}} -// CHECK:STDOUT: symbolic_constant7800014C: {inst: inst78000180, kind: checked, attached: null} -// CHECK:STDOUT: symbolic_constant7800014D: {inst: inst78000180, kind: checked, attached: {generic: generic78000000, index: generic_inst_in_def8}} +// CHECK:STDOUT: symbolic_constant7800014C: {inst: inst78000184, kind: checked, attached: null} +// CHECK:STDOUT: symbolic_constant7800014D: {inst: inst78000184, kind: checked, attached: {generic: generic78000000, index: generic_inst_in_def8}} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: @@ -1794,18 +1802,20 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 2: inst7800004A // CHECK:STDOUT: 3: inst78000177 // CHECK:STDOUT: 4: inst7800017E -// CHECK:STDOUT: 5: inst7800017F +// CHECK:STDOUT: 5: inst78000181 // CHECK:STDOUT: 6: inst78000182 // CHECK:STDOUT: 7: inst78000183 -// CHECK:STDOUT: 8: inst7800004C -// CHECK:STDOUT: 9: inst78000184 -// CHECK:STDOUT: 10: inst78000185 -// CHECK:STDOUT: 11: inst78000186 -// CHECK:STDOUT: 12: inst78000187 -// CHECK:STDOUT: 13: inst78000188 -// CHECK:STDOUT: 14: inst78000189 -// CHECK:STDOUT: 15: inst7800018A -// CHECK:STDOUT: 16: inst7800018B +// CHECK:STDOUT: 8: inst78000186 +// CHECK:STDOUT: 9: inst78000187 +// CHECK:STDOUT: 10: inst7800004C +// CHECK:STDOUT: 11: inst78000188 +// CHECK:STDOUT: 12: inst78000189 +// CHECK:STDOUT: 13: inst7800018A +// CHECK:STDOUT: 14: inst7800018B +// CHECK:STDOUT: 15: inst7800018C +// CHECK:STDOUT: 16: inst7800018D +// CHECK:STDOUT: 17: inst7800018E +// CHECK:STDOUT: 18: inst7800018F // CHECK:STDOUT: inst_block78000019: // CHECK:STDOUT: 0: inst78000048 // CHECK:STDOUT: 1: inst78000049 @@ -2228,8 +2238,8 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst_block78000089: // CHECK:STDOUT: 0: inst78000048 // CHECK:STDOUT: inst_block7800008A: -// CHECK:STDOUT: 0: inst78000184 -// CHECK:STDOUT: 1: inst78000188 +// CHECK:STDOUT: 0: inst78000188 +// CHECK:STDOUT: 1: inst7800018C // CHECK:STDOUT: inst_block7800008B: // CHECK:STDOUT: 0: inst78000043 // CHECK:STDOUT: 1: inst78000047 @@ -2239,7 +2249,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst7800017B // CHECK:STDOUT: 6: inst7800017C // CHECK:STDOUT: 7: inst7800017D -// CHECK:STDOUT: 8: inst78000181 +// CHECK:STDOUT: 8: inst78000185 // CHECK:STDOUT: inst_block7800008C: // CHECK:STDOUT: 0: instF // CHECK:STDOUT: 1: inst78000010 diff --git a/toolchain/check/testdata/class/access/access_modifers.carbon b/toolchain/check/testdata/class/access/access_modifers.carbon index 2dc934e8edde..bc06410741de 100644 --- a/toolchain/check/testdata/class/access/access_modifers.carbon +++ b/toolchain/check/testdata/class/access/access_modifers.carbon @@ -92,7 +92,7 @@ library "[[@TEST_NAME]]"; class Circle { private var radius: i32; - fn GetRadius[self: Self]() -> i32 { + fn GetRadius(self) -> i32 { return self.radius; } @@ -100,7 +100,7 @@ class Circle { return 0; } - fn Compute[self: Self]() -> i32 { + fn Compute(self) -> i32 { return self.SomeInternalFunction(); } } diff --git a/toolchain/check/testdata/class/access/inheritance_access.carbon b/toolchain/check/testdata/class/access/inheritance_access.carbon index 13a2280909f7..8d85f85fae0f 100644 --- a/toolchain/check/testdata/class/access/inheritance_access.carbon +++ b/toolchain/check/testdata/class/access/inheritance_access.carbon @@ -25,7 +25,7 @@ base class Shape { class Circle { extend base: Shape; - fn GetPosition[self: Self]() -> (i32, i32) { + fn GetPosition(self) -> (i32, i32) { return (self.x, self.y); } } @@ -45,7 +45,7 @@ base class B { base class C { extend base: B; - fn G[self: Self]() -> () { return self.F(); } + fn G(self) -> () { return self.F(); } } // --- inherited_member_access.carbon @@ -82,7 +82,7 @@ base class Shape { class Square { extend base: Shape; - fn GetPosition[self: Self]() -> i32 { + fn GetPosition(self) -> i32 { // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE+7]]:12: error: cannot access private member `y` of type `Shape` [ClassInvalidMemberAccess] // CHECK:STDERR: return self.y; // CHECK:STDERR: ^~~~~~ @@ -233,7 +233,7 @@ class B { return A.SOME_PROTECTED_CONSTANT; } - fn SomeFunc[self: Self]() -> i32{ + fn SomeFunc(self) -> i32{ // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error: cannot access protected member `INTERNAL_CONSTANT` of type `Internal` [ClassInvalidMemberAccess] // CHECK:STDERR: return self.internal.INTERNAL_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -255,7 +255,7 @@ base class A { class B { extend base: A; - fn F[self: Self]() { + fn F(self) { // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE+7]]:11: error: cannot access private member `x` of type `A` [ClassInvalidMemberAccess] // CHECK:STDERR: self.(A.x); // CHECK:STDERR: ^~~ @@ -278,11 +278,12 @@ base class A { class B { extend base: A; - fn F[self: Self]() { + fn F(self) { self.(A.x); } } + // CHECK:STDOUT: --- instance_protected_field_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -362,13 +363,13 @@ class B { // CHECK:STDOUT: %self.param_patt: %pattern_type.f70 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.f70 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.394 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.394 = return_slot_pattern %return.param_patt, %.loc12_44.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.394 = return_slot_pattern %return.param_patt, %.loc12_36.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %i32.loc12_36: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %i32.loc12_41: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc12_44.1: %tuple.type.24b = tuple_literal (%i32.loc12_36, %i32.loc12_41) [concrete = constants.%tuple.b59] -// CHECK:STDOUT: %.loc12_44.2: type = converted %.loc12_44.1, constants.%tuple.type.e55 [concrete = constants.%tuple.type.e55] -// CHECK:STDOUT: %.loc12_44.3: Core.Form = init_form %.loc12_44.2 [concrete = constants.%.c11] +// CHECK:STDOUT: %i32.loc12_28: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %i32.loc12_33: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc12_36.1: %tuple.type.24b = tuple_literal (%i32.loc12_28, %i32.loc12_33) [concrete = constants.%tuple.b59] +// CHECK:STDOUT: %.loc12_36.2: type = converted %.loc12_36.1, constants.%tuple.type.e55 [concrete = constants.%tuple.type.e55] +// CHECK:STDOUT: %.loc12_36.3: Core.Form = init_form %.loc12_36.2 [concrete = constants.%.c11] // CHECK:STDOUT: %self.param: %Circle = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [concrete = constants.%Circle] // CHECK:STDOUT: %self: %Circle = value_binding self, %self.param @@ -517,11 +518,11 @@ class B { // CHECK:STDOUT: %self.param_patt: %pattern_type.98b = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.98b = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc15_26.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc15_18.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc15_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_26.2: type = converted %.loc15_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc15_26.3: Core.Form = init_form %.loc15_26.2 [concrete = constants.%.262] +// CHECK:STDOUT: %.loc15_18.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc15_18.2: type = converted %.loc15_18.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc15_18.3: Core.Form = init_form %.loc15_18.2 [concrete = constants.%.262] // CHECK:STDOUT: %self.param: %C = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param diff --git a/toolchain/check/testdata/class/access/method_access.carbon b/toolchain/check/testdata/class/access/method_access.carbon index 9892f3f6edc7..e02be98d19fc 100644 --- a/toolchain/check/testdata/class/access/method_access.carbon +++ b/toolchain/check/testdata/class/access/method_access.carbon @@ -15,7 +15,7 @@ // --- fail_multiple_bindings.carbon class X { - fn F[self: Self](); + fn F(self); } fn G(x: X) { diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index 48d9f7a80e4b..a112bc2ae2c2 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -24,7 +24,7 @@ class SomeClass { fn StaticMemberFunction(); - fn AdapterMethod[self: SomeClassAdapter](); + fn AdapterMethod(self: SomeClassAdapter); } class SomeClassAdapter { @@ -44,7 +44,7 @@ fn TestAdapterMethod(a: SomeClassAdapter) { library "[[@TEST_NAME]]"; class SomeClass { - fn F[self: Self](); + fn F(self); } class SomeClassAdapter { @@ -59,8 +59,8 @@ fn F(a: SomeClassAdapter) { // CHECK:STDERR: a.F(); // CHECK:STDERR: ^ // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn F(self); + // CHECK:STDERR: ^~~~ // CHECK:STDERR: a.F(); } diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon index bd14af0be868..45d244c28557 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon @@ -11,13 +11,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon class Simple {}; base class AdaptWithVirtual { - virtual fn F[self: Self](); + virtual fn F(self); // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+7]]:3: error: adapter with virtual function [AdaptWithVirtual] // CHECK:STDERR: adapt Simple; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE-4]]:3: note: first virtual function declaration is here [AdaptWithVirtualHere] - // CHECK:STDERR: virtual fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: virtual fn F(self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: adapt Simple; } diff --git a/toolchain/check/testdata/class/destroy_calls.carbon b/toolchain/check/testdata/class/destroy_calls.carbon index 2d5d99b0fc22..b4dde37625d6 100644 --- a/toolchain/check/testdata/class/destroy_calls.carbon +++ b/toolchain/check/testdata/class/destroy_calls.carbon @@ -88,6 +88,7 @@ fn F(template T:! type) { fn G() { F({}); } + // CHECK:STDOUT: --- implicit_return.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -456,11 +457,11 @@ fn G() { F({}); } // CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc7_20.2 [template = %pattern_type (constants.%pattern_type.ebe)] // CHECK:STDOUT: %C.val: @F.%C.loc7_20.2 (%C.1d0) = struct_value () [template = %C.val (constants.%C.val.d4f)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.loc7_20.2, @Destroy [template = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C.loc7_20.2, (%Destroy.lookup_impl_witness) [template = %Destroy.facet (constants.%Destroy.facet.19f)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [template = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.fc4)] -// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [template = %.loc7_3.2 (constants.%.cb3)] -// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3.2 (%.cb3) = impl_witness_access %Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet) [template = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value %C.loc7_20.2, (%Destroy.lookup_impl_witness) [template = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.19f)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7_3.2) [template = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.fc4)] +// CHECK:STDOUT: %.loc7_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc7_3.2 [template = %.loc7_3.3 (constants.%.cb3)] +// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3.3 (%.cb3) = impl_witness_access %Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7_3.2) [template = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -479,8 +480,10 @@ fn G() { F({}); } // CHECK:STDOUT: %C.loc7_20.1: type = class_type @C, @C(constants.%T) [template = %C.loc7_20.2 (constants.%C.1d0)] // CHECK:STDOUT: } // CHECK:STDOUT: %v: ref @F.%C.loc7_20.2 (%C.1d0) = ref_binding v, %v.var -// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3.2 (%.cb3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3.3 (%.cb3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0.loc7_3.1 +// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness) [template = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.19f)] +// CHECK:STDOUT: %.loc7_3.2: %Destroy.type = converted constants.%C.1d0, %Destroy.facet.loc7_3.1 [template = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.19f)] // CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.19f) [template = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_impl_fn.loc7_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%v.var) @@ -508,9 +511,9 @@ fn G() { F({}); } // CHECK:STDOUT: %pattern_type => constants.%pattern_type.2fd // CHECK:STDOUT: %C.val => constants.%C.val.58e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.2 -// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.da3 +// CHECK:STDOUT: %Destroy.facet.loc7_3.2 => constants.%Destroy.facet.da3 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.294 -// CHECK:STDOUT: %.loc7_3.2 => constants.%.98c +// CHECK:STDOUT: %.loc7_3.3 => constants.%.98c // CHECK:STDOUT: %impl.elem0.loc7_3.2 => constants.%Destroy.Op.1a2547.2 // CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.Op.1a2547.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_error_recovery.carbon b/toolchain/check/testdata/class/fail_error_recovery.carbon index c77ca396e69a..b31a06d5c46d 100644 --- a/toolchain/check/testdata/class/fail_error_recovery.carbon +++ b/toolchain/check/testdata/class/fail_error_recovery.carbon @@ -18,7 +18,7 @@ // CHECK:STDERR: fn F(unused N:! error_not_found) { base class C { - virtual fn Foo[unused self: Self]() {} + virtual fn Foo(unused self) {} } base class D { diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 37d1b455efe9..0e1fd68ef993 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -11,7 +11,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_memaccess_category.carbon class A { - fn F[ref self: A](); + fn F(ref self: A); } class B { @@ -24,7 +24,7 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDERR: s.a.F(); // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:8: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[ref self: A](); + // CHECK:STDERR: fn F(ref self: A); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: s.a.F(); @@ -35,7 +35,7 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDERR: b.a.F(); // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:8: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[ref self: A](); + // CHECK:STDERR: fn F(ref self: A); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: b.a.F(); diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index 1a743d7c7c2f..12f1528ed02b 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -85,16 +85,16 @@ abstract protected class WrongOrder { } abstract base class AbstractAndBase {} abstract class AbstractWithDefinition { - // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:38: error: definition of `abstract` function [DefinedAbstractFunction] - // CHECK:STDERR: abstract fn F[unused self: Self]() {} - // CHECK:STDERR: ^ + // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:30: error: definition of `abstract` function [DefinedAbstractFunction] + // CHECK:STDERR: abstract fn F(unused self) {} + // CHECK:STDERR: ^ // CHECK:STDERR: - abstract fn F[unused self: Self]() {} - abstract fn G[self: Self](); + abstract fn F(unused self) {} + abstract fn G(self); } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:50: error: definition of `abstract` function [DefinedAbstractFunction] -// CHECK:STDERR: fn AbstractWithDefinition.G[unused self: Self]() { -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:42: error: definition of `abstract` function [DefinedAbstractFunction] +// CHECK:STDERR: fn AbstractWithDefinition.G(unused self) { +// CHECK:STDERR: ^ // CHECK:STDERR: -fn AbstractWithDefinition.G[unused self: Self]() { +fn AbstractWithDefinition.G(unused self) { } diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index 3075ce94696f..5debf894e111 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -16,11 +16,11 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin class Class(T:! Core.Copy) { - fn GetAddr[ref self: Self]() -> T* { + fn GetAddr(ref self) -> T* { return &self.k; } - fn GetValue[self: Self]() -> T { + fn GetValue(self) -> T { return self.k; } @@ -30,6 +30,7 @@ class Class(T:! Core.Copy) { class Declaration(T:! type); //@dump-sem-ir-end + // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -124,43 +125,43 @@ class Declaration(T:! type); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Class.GetAddr.decl: @Class.%Class.GetAddr.type (%Class.GetAddr.type) = fn_decl @Class.GetAddr [symbolic = @Class.%Class.GetAddr (constants.%Class.GetAddr)] { -// CHECK:STDOUT: %self.param_patt: @Class.GetAddr.%pattern_type.loc6_22 (%pattern_type.e18) = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Class.GetAddr.%pattern_type.loc6_22 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Class.GetAddr.%pattern_type.loc6_36 (%pattern_type.d5b) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Class.GetAddr.%pattern_type.loc6_36 (%pattern_type.d5b) = return_slot_pattern %return.param_patt, %ptr.loc6_36.2 [concrete] +// CHECK:STDOUT: %self.param_patt: @Class.GetAddr.%pattern_type.loc6_18 (%pattern_type.e18) = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Class.GetAddr.%pattern_type.loc6_18 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @Class.GetAddr.%pattern_type.loc6_28 (%pattern_type.d5b) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @Class.GetAddr.%pattern_type.loc6_28 (%pattern_type.d5b) = return_slot_pattern %return.param_patt, %ptr.loc6_28.2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Class.%T.loc5_14.2 [symbolic = %T (constants.%T.f84)] -// CHECK:STDOUT: %T.as_type.loc6_36.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc6_36.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc6_36.2: type = converted %T.ref, %T.as_type.loc6_36.2 [symbolic = %T.as_type.loc6_36.1 (constants.%T.as_type)] -// CHECK:STDOUT: %ptr.loc6_36.2: type = ptr_type %.loc6_36.2 [symbolic = %ptr.loc6_36.1 (constants.%ptr.215)] -// CHECK:STDOUT: %.loc6_36.3: Core.Form = init_form %ptr.loc6_36.2 [symbolic = %.loc6_36.1 (constants.%.4fb)] +// CHECK:STDOUT: %T.as_type.loc6_28.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc6_28.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc6_28.2: type = converted %T.ref, %T.as_type.loc6_28.2 [symbolic = %T.as_type.loc6_28.1 (constants.%T.as_type)] +// CHECK:STDOUT: %ptr.loc6_28.2: type = ptr_type %.loc6_28.2 [symbolic = %ptr.loc6_28.1 (constants.%ptr.215)] +// CHECK:STDOUT: %.loc6_28.3: Core.Form = init_form %ptr.loc6_28.2 [symbolic = %.loc6_28.1 (constants.%.4fb)] // CHECK:STDOUT: %self.param: ref @Class.GetAddr.%Class (%Class) = ref_param call_param0 -// CHECK:STDOUT: %.loc6_24.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc6_24.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_24.2 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %.loc6_18.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc6_18.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_18.2 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: ref @Class.GetAddr.%Class (%Class) = ref_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @Class.GetAddr.%ptr.loc6_36.1 (%ptr.215) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Class.GetAddr.%ptr.loc6_36.1 (%ptr.215) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @Class.GetAddr.%ptr.loc6_28.1 (%ptr.215) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Class.GetAddr.%ptr.loc6_28.1 (%ptr.215) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Class.GetValue.decl: @Class.%Class.GetValue.type (%Class.GetValue.type) = fn_decl @Class.GetValue [symbolic = @Class.%Class.GetValue (constants.%Class.GetValue)] { -// CHECK:STDOUT: %self.param_patt: @Class.GetValue.%pattern_type.loc10_19 (%pattern_type.e18) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Class.GetValue.%pattern_type.loc10_19 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Class.GetValue.%pattern_type.loc10_32 (%pattern_type.2c66b4.2) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Class.GetValue.%pattern_type.loc10_32 (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc10_32.3 [concrete] +// CHECK:STDOUT: %self.param_patt: @Class.GetValue.%pattern_type.loc10_15 (%pattern_type.e18) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Class.GetValue.%pattern_type.loc10_15 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @Class.GetValue.%pattern_type.loc10_24 (%pattern_type.2c66b4.2) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @Class.GetValue.%pattern_type.loc10_24 (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc10_24.3 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Class.%T.loc5_14.2 [symbolic = %T (constants.%T.f84)] -// CHECK:STDOUT: %T.as_type.loc10_32.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc10_32.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc10_32.3: type = converted %T.ref, %T.as_type.loc10_32.2 [symbolic = %T.as_type.loc10_32.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc10_32.4: Core.Form = init_form %.loc10_32.3 [symbolic = %.loc10_32.2 (constants.%.1ce700.2)] +// CHECK:STDOUT: %T.as_type.loc10_24.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc10_24.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc10_24.3: type = converted %T.ref, %T.as_type.loc10_24.2 [symbolic = %T.as_type.loc10_24.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc10_24.4: Core.Form = init_form %.loc10_24.3 [symbolic = %.loc10_24.2 (constants.%.1ce700.2)] // CHECK:STDOUT: %self.param: @Class.GetValue.%Class (%Class) = value_param call_param0 -// CHECK:STDOUT: %.loc10_21.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc10_21.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_21.2 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %.loc10_15.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc10_15.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_15.2 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Class.GetValue.%Class (%Class) = value_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @Class.GetValue.%T.as_type.loc10_24.1 (%T.as_type) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Class.GetValue.%T.as_type.loc10_24.1 (%T.as_type) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: @Class.%Class.elem (%Class.elem) = field_decl k, element0 [concrete] // CHECK:STDOUT: %complete_type.loc15_1.1: = complete_type_witness constants.%struct_type.k [symbolic = %complete_type.loc15_1.2 (constants.%complete_type)] @@ -184,35 +185,37 @@ class Declaration(T:! type); // CHECK:STDOUT: generic fn @Class.GetAddr(@Class.%T.loc5_14.2: %Copy.type) { // CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %pattern_type.loc6_22: type = pattern_type %Class [symbolic = %pattern_type.loc6_22 (constants.%pattern_type.e18)] -// CHECK:STDOUT: %T.as_type.loc6_36.1: type = facet_access_type %T [symbolic = %T.as_type.loc6_36.1 (constants.%T.as_type)] -// CHECK:STDOUT: %ptr.loc6_36.1: type = ptr_type %T.as_type.loc6_36.1 [symbolic = %ptr.loc6_36.1 (constants.%ptr.215)] -// CHECK:STDOUT: %.loc6_36.1: Core.Form = init_form %ptr.loc6_36.1 [symbolic = %.loc6_36.1 (constants.%.4fb)] -// CHECK:STDOUT: %pattern_type.loc6_36: type = pattern_type %ptr.loc6_36.1 [symbolic = %pattern_type.loc6_36 (constants.%pattern_type.d5b)] +// CHECK:STDOUT: %pattern_type.loc6_18: type = pattern_type %Class [symbolic = %pattern_type.loc6_18 (constants.%pattern_type.e18)] +// CHECK:STDOUT: %T.as_type.loc6_28.1: type = facet_access_type %T [symbolic = %T.as_type.loc6_28.1 (constants.%T.as_type)] +// CHECK:STDOUT: %ptr.loc6_28.1: type = ptr_type %T.as_type.loc6_28.1 [symbolic = %ptr.loc6_28.1 (constants.%ptr.215)] +// CHECK:STDOUT: %.loc6_28.1: Core.Form = init_form %ptr.loc6_28.1 [symbolic = %.loc6_28.1 (constants.%.4fb)] +// CHECK:STDOUT: %pattern_type.loc6_28: type = pattern_type %ptr.loc6_28.1 [symbolic = %pattern_type.loc6_28 (constants.%pattern_type.d5b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc6_22: = require_complete_type %Class [symbolic = %require_complete.loc6_22 (constants.%require_complete.1dd)] -// CHECK:STDOUT: %require_complete.loc6_32: = require_complete_type %ptr.loc6_36.1 [symbolic = %require_complete.loc6_32 (constants.%require_complete.94b)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc6_36.1 [symbolic = %Class.elem (constants.%Class.elem)] -// CHECK:STDOUT: %.loc7_12.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.as_type.loc6_36.1) [symbolic = %.loc7_12.1 (constants.%.a33)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc6_36.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cf6)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc6_36.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.6e0)] -// CHECK:STDOUT: %.loc7_12.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc7_12.2 (constants.%.45d)] -// CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.GetAddr.%.loc7_12.2 (%.45d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.c5d)] -// CHECK:STDOUT: %specific_impl_fn.loc7_12.2: = specific_impl_function %impl.elem0.loc7_12.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5cf)] +// CHECK:STDOUT: %require_complete.loc6_18: = require_complete_type %Class [symbolic = %require_complete.loc6_18 (constants.%require_complete.1dd)] +// CHECK:STDOUT: %require_complete.loc6_24: = require_complete_type %ptr.loc6_28.1 [symbolic = %require_complete.loc6_24 (constants.%require_complete.94b)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc6_28.1 [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %.loc7_12.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.as_type.loc6_28.1) [symbolic = %.loc7_12.2 (constants.%.a33)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc6_28.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cf6)] +// CHECK:STDOUT: %Copy.facet.loc7_12.2: %Copy.type = facet_value %ptr.loc6_28.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc7_12.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc7_12.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.6e0)] +// CHECK:STDOUT: %.loc7_12.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc7_12.2 [symbolic = %.loc7_12.3 (constants.%.45d)] +// CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.GetAddr.%.loc7_12.3 (%.45d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.c5d)] +// CHECK:STDOUT: %specific_impl_fn.loc7_12.2: = specific_impl_function %impl.elem0.loc7_12.2, @Copy.WithSelf.Op(%Copy.facet.loc7_12.2) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5cf)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: ref @Class.GetAddr.%Class (%Class)) -> out %return.param: @Class.GetAddr.%ptr.loc6_36.1 (%ptr.215) { +// CHECK:STDOUT: fn(%self.param: ref @Class.GetAddr.%Class (%Class)) -> out %return.param: @Class.GetAddr.%ptr.loc6_28.1 (%ptr.215) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: ref @Class.GetAddr.%Class (%Class) = name_ref self, %self // CHECK:STDOUT: %k.ref: @Class.GetAddr.%Class.elem (%Class.elem) = name_ref k, @Class.%.loc14 [concrete = @Class.%.loc14] -// CHECK:STDOUT: %.loc7_17: ref @Class.GetAddr.%T.as_type.loc6_36.1 (%T.as_type) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc6_36.1 (%ptr.215) = addr_of %.loc7_17 -// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.GetAddr.%.loc7_12.2 (%.45d) = impl_witness_access constants.%Copy.lookup_impl_witness.cf6, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.c5d)] +// CHECK:STDOUT: %.loc7_17: ref @Class.GetAddr.%T.as_type.loc6_28.1 (%T.as_type) = class_element_access %self.ref, element0 +// CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc6_28.1 (%ptr.215) = addr_of %.loc7_17 +// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.GetAddr.%.loc7_12.3 (%.45d) = impl_witness_access constants.%Copy.lookup_impl_witness.cf6, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.c5d)] // CHECK:STDOUT: %bound_method.loc7_12.1: = bound_method %addr, %impl.elem0.loc7_12.1 +// CHECK:STDOUT: %Copy.facet.loc7_12.1: %Copy.type = facet_value constants.%ptr.215, (constants.%Copy.lookup_impl_witness.cf6) [symbolic = %Copy.facet.loc7_12.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %.loc7_12.1: %Copy.type = converted constants.%ptr.215, %Copy.facet.loc7_12.1 [symbolic = %Copy.facet.loc7_12.2 (constants.%Copy.facet)] // CHECK:STDOUT: %specific_impl_fn.loc7_12.1: = specific_impl_function %impl.elem0.loc7_12.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.5cf)] // CHECK:STDOUT: %bound_method.loc7_12.2: = bound_method %addr, %specific_impl_fn.loc7_12.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.GetAddr.%ptr.loc6_36.1 (%ptr.215) = call %bound_method.loc7_12.2(%addr) +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.GetAddr.%ptr.loc6_28.1 (%ptr.215) = call %bound_method.loc7_12.2(%addr) // CHECK:STDOUT: return %Copy.WithSelf.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -220,33 +223,34 @@ class Declaration(T:! type); // CHECK:STDOUT: generic fn @Class.GetValue(@Class.%T.loc5_14.2: %Copy.type) { // CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %pattern_type.loc10_19: type = pattern_type %Class [symbolic = %pattern_type.loc10_19 (constants.%pattern_type.e18)] -// CHECK:STDOUT: %T.as_type.loc10_32.1: type = facet_access_type %T [symbolic = %T.as_type.loc10_32.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc10_32.2: Core.Form = init_form %T.as_type.loc10_32.1 [symbolic = %.loc10_32.2 (constants.%.1ce700.2)] -// CHECK:STDOUT: %pattern_type.loc10_32: type = pattern_type %T.as_type.loc10_32.1 [symbolic = %pattern_type.loc10_32 (constants.%pattern_type.2c66b4.2)] +// CHECK:STDOUT: %pattern_type.loc10_15: type = pattern_type %Class [symbolic = %pattern_type.loc10_15 (constants.%pattern_type.e18)] +// CHECK:STDOUT: %T.as_type.loc10_24.1: type = facet_access_type %T [symbolic = %T.as_type.loc10_24.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc10_24.2: Core.Form = init_form %T.as_type.loc10_24.1 [symbolic = %.loc10_24.2 (constants.%.1ce700.2)] +// CHECK:STDOUT: %pattern_type.loc10_24: type = pattern_type %T.as_type.loc10_24.1 [symbolic = %pattern_type.loc10_24 (constants.%pattern_type.2c66b4.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc10: = require_complete_type %Class [symbolic = %require_complete.loc10 (constants.%require_complete.1dd)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc10_32.1 [symbolic = %Class.elem (constants.%Class.elem)] -// CHECK:STDOUT: %require_complete.loc11: = require_complete_type %T.as_type.loc10_32.1 [symbolic = %require_complete.loc11 (constants.%require_complete.d83)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc10_24.1 [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %require_complete.loc11: = require_complete_type %T.as_type.loc10_24.1 [symbolic = %require_complete.loc11 (constants.%require_complete.d83)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc11_16.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc11_16.3 (constants.%.c29)] +// CHECK:STDOUT: %.loc11_16.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc11_16.4 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc11_16.2: @Class.GetValue.%.loc11_16.3 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc11_16.2: @Class.GetValue.%.loc11_16.4 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc11_16.2: = specific_impl_function %impl.elem0.loc11_16.2, @Copy.WithSelf.Op(%T) [symbolic = %specific_impl_fn.loc11_16.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Class.GetValue.%Class (%Class)) -> out %return.param: @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) { +// CHECK:STDOUT: fn(%self.param: @Class.GetValue.%Class (%Class)) -> out %return.param: @Class.GetValue.%T.as_type.loc10_24.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @Class.GetValue.%Class (%Class) = name_ref self, %self // CHECK:STDOUT: %k.ref: @Class.GetValue.%Class.elem (%Class.elem) = name_ref k, @Class.%.loc14 [concrete = @Class.%.loc14] -// CHECK:STDOUT: %.loc11_16.1: ref @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc11_16.2: @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = acquire_value %.loc11_16.1 -// CHECK:STDOUT: %impl.elem0.loc11_16.1: @Class.GetValue.%.loc11_16.3 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %.loc11_16.1: ref @Class.GetValue.%T.as_type.loc10_24.1 (%T.as_type) = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc11_16.2: @Class.GetValue.%T.as_type.loc10_24.1 (%T.as_type) = acquire_value %.loc11_16.1 +// CHECK:STDOUT: %impl.elem0.loc11_16.1: @Class.GetValue.%.loc11_16.4 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc11_16.1: = bound_method %.loc11_16.2, %impl.elem0.loc11_16.1 +// CHECK:STDOUT: %.loc11_16.3: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc11_16.1: = specific_impl_function %impl.elem0.loc11_16.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc11_16.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc11_16.2: = bound_method %.loc11_16.2, %specific_impl_fn.loc11_16.1 -// CHECK:STDOUT: %.loc10_32.1: ref @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = splice_block %return.param {} -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) to %.loc10_32.1 = call %bound_method.loc11_16.2(%.loc11_16.2) +// CHECK:STDOUT: %.loc10_24.1: ref @Class.GetValue.%T.as_type.loc10_24.1 (%T.as_type) = splice_block %return.param {} +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.GetValue.%T.as_type.loc10_24.1 (%T.as_type) to %.loc10_24.1 = call %bound_method.loc11_16.2(%.loc11_16.2) // CHECK:STDOUT: return %Copy.WithSelf.Op.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -270,20 +274,20 @@ class Declaration(T:! type); // CHECK:STDOUT: specific @Class.GetAddr(constants.%T.f84) { // CHECK:STDOUT: %T => constants.%T.f84 // CHECK:STDOUT: %Class => constants.%Class -// CHECK:STDOUT: %pattern_type.loc6_22 => constants.%pattern_type.e18 -// CHECK:STDOUT: %T.as_type.loc6_36.1 => constants.%T.as_type -// CHECK:STDOUT: %ptr.loc6_36.1 => constants.%ptr.215 -// CHECK:STDOUT: %.loc6_36.1 => constants.%.4fb -// CHECK:STDOUT: %pattern_type.loc6_36 => constants.%pattern_type.d5b +// CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.e18 +// CHECK:STDOUT: %T.as_type.loc6_28.1 => constants.%T.as_type +// CHECK:STDOUT: %ptr.loc6_28.1 => constants.%ptr.215 +// CHECK:STDOUT: %.loc6_28.1 => constants.%.4fb +// CHECK:STDOUT: %pattern_type.loc6_28 => constants.%pattern_type.d5b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class.GetValue(constants.%T.f84) { // CHECK:STDOUT: %T => constants.%T.f84 // CHECK:STDOUT: %Class => constants.%Class -// CHECK:STDOUT: %pattern_type.loc10_19 => constants.%pattern_type.e18 -// CHECK:STDOUT: %T.as_type.loc10_32.1 => constants.%T.as_type -// CHECK:STDOUT: %.loc10_32.2 => constants.%.1ce700.2 -// CHECK:STDOUT: %pattern_type.loc10_32 => constants.%pattern_type.2c66b4.2 +// CHECK:STDOUT: %pattern_type.loc10_15 => constants.%pattern_type.e18 +// CHECK:STDOUT: %T.as_type.loc10_24.1 => constants.%T.as_type +// CHECK:STDOUT: %.loc10_24.2 => constants.%.1ce700.2 +// CHECK:STDOUT: %pattern_type.loc10_24 => constants.%pattern_type.2c66b4.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Declaration(constants.%T.67d) { diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index d59c10109d6c..e78f9c55c6cc 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -32,6 +32,7 @@ fn H(U:! Core.Copy, c: Class(U)) -> U { } //@dump-sem-ir-end + // CHECK:STDOUT: --- field.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -261,9 +262,9 @@ fn H(U:! Core.Copy, c: Class(U)) -> U { // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc13_31.1, %T.as_type.loc13_31.1 [symbolic = %Class.elem (constants.%Class.elem.14b853.1)] // CHECK:STDOUT: %require_complete.loc14: = require_complete_type %T.as_type.loc13_31.1 [symbolic = %require_complete.loc14 (constants.%require_complete.d83f06.1)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc13_7.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc14_11.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc13_7.1 [symbolic = %.loc14_11.3 (constants.%.c29330.1)] +// CHECK:STDOUT: %.loc14_11.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc13_7.1 [symbolic = %.loc14_11.4 (constants.%.c29330.1)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc13_7.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c332.1)] -// CHECK:STDOUT: %impl.elem0.loc14_11.2: @G.%.loc14_11.3 (%.c29330.1) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_11.2 (constants.%impl.elem0.bd2456.1)] +// CHECK:STDOUT: %impl.elem0.loc14_11.2: @G.%.loc14_11.4 (%.c29330.1) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_11.2 (constants.%impl.elem0.bd2456.1)] // CHECK:STDOUT: %specific_impl_fn.loc14_11.2: = specific_impl_function %impl.elem0.loc14_11.2, @Copy.WithSelf.Op(%T.loc13_7.1) [symbolic = %specific_impl_fn.loc14_11.2 (constants.%specific_impl_fn.e2af7e.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%c.param: @G.%Class.loc13_31.1 (%Class.c74ef3.1)) -> out %return.param: @G.%T.as_type.loc13_31.1 (%T.as_type) { @@ -272,8 +273,9 @@ fn H(U:! Core.Copy, c: Class(U)) -> U { // CHECK:STDOUT: %x.ref: @G.%Class.elem (%Class.elem.14b853.1) = name_ref x, @Class.%.loc6 [concrete = @Class.%.loc6] // CHECK:STDOUT: %.loc14_11.1: ref @G.%T.as_type.loc13_31.1 (%T.as_type) = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc14_11.2: @G.%T.as_type.loc13_31.1 (%T.as_type) = acquire_value %.loc14_11.1 -// CHECK:STDOUT: %impl.elem0.loc14_11.1: @G.%.loc14_11.3 (%.c29330.1) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c332.1, element0 [symbolic = %impl.elem0.loc14_11.2 (constants.%impl.elem0.bd2456.1)] +// CHECK:STDOUT: %impl.elem0.loc14_11.1: @G.%.loc14_11.4 (%.c29330.1) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c332.1, element0 [symbolic = %impl.elem0.loc14_11.2 (constants.%impl.elem0.bd2456.1)] // CHECK:STDOUT: %bound_method.loc14_11.1: = bound_method %.loc14_11.2, %impl.elem0.loc14_11.1 +// CHECK:STDOUT: %.loc14_11.3: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T.loc13_7.1 (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc14_11.1: = specific_impl_function %impl.elem0.loc14_11.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc14_11.2 (constants.%specific_impl_fn.e2af7e.1)] // CHECK:STDOUT: %bound_method.loc14_11.2: = bound_method %.loc14_11.2, %specific_impl_fn.loc14_11.1 // CHECK:STDOUT: %.loc13_37.1: ref @G.%T.as_type.loc13_31.1 (%T.as_type) = splice_block %return.param {} @@ -295,9 +297,9 @@ fn H(U:! Core.Copy, c: Class(U)) -> U { // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc17_31.1, %U.as_type.loc17_31.1 [symbolic = %Class.elem (constants.%Class.elem.14b853.2)] // CHECK:STDOUT: %require_complete.loc18: = require_complete_type %U.as_type.loc17_31.1 [symbolic = %require_complete.loc18 (constants.%require_complete.d83f06.2)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%U.loc17_7.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.3)] -// CHECK:STDOUT: %.loc18_11.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc17_7.1 [symbolic = %.loc18_11.3 (constants.%.c29330.2)] +// CHECK:STDOUT: %.loc18_11.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc17_7.1 [symbolic = %.loc18_11.4 (constants.%.c29330.2)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %U.loc17_7.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c332.2)] -// CHECK:STDOUT: %impl.elem0.loc18_11.2: @H.%.loc18_11.3 (%.c29330.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_11.2 (constants.%impl.elem0.bd2456.2)] +// CHECK:STDOUT: %impl.elem0.loc18_11.2: @H.%.loc18_11.4 (%.c29330.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_11.2 (constants.%impl.elem0.bd2456.2)] // CHECK:STDOUT: %specific_impl_fn.loc18_11.2: = specific_impl_function %impl.elem0.loc18_11.2, @Copy.WithSelf.Op(%U.loc17_7.1) [symbolic = %specific_impl_fn.loc18_11.2 (constants.%specific_impl_fn.e2af7e.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%c.param: @H.%Class.loc17_31.1 (%Class.c74ef3.2)) -> out %return.param: @H.%U.as_type.loc17_31.1 (%U.as_type.c1c) { @@ -306,8 +308,9 @@ fn H(U:! Core.Copy, c: Class(U)) -> U { // CHECK:STDOUT: %x.ref: @H.%Class.elem (%Class.elem.14b853.2) = name_ref x, @Class.%.loc6 [concrete = @Class.%.loc6] // CHECK:STDOUT: %.loc18_11.1: ref @H.%U.as_type.loc17_31.1 (%U.as_type.c1c) = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc18_11.2: @H.%U.as_type.loc17_31.1 (%U.as_type.c1c) = acquire_value %.loc18_11.1 -// CHECK:STDOUT: %impl.elem0.loc18_11.1: @H.%.loc18_11.3 (%.c29330.2) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c332.2, element0 [symbolic = %impl.elem0.loc18_11.2 (constants.%impl.elem0.bd2456.2)] +// CHECK:STDOUT: %impl.elem0.loc18_11.1: @H.%.loc18_11.4 (%.c29330.2) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c332.2, element0 [symbolic = %impl.elem0.loc18_11.2 (constants.%impl.elem0.bd2456.2)] // CHECK:STDOUT: %bound_method.loc18_11.1: = bound_method %.loc18_11.2, %impl.elem0.loc18_11.1 +// CHECK:STDOUT: %.loc18_11.3: %Copy.type = converted constants.%U.as_type.c1c, constants.%U.f84 [symbolic = %U.loc17_7.1 (constants.%U.f84)] // CHECK:STDOUT: %specific_impl_fn.loc18_11.1: = specific_impl_function %impl.elem0.loc18_11.1, @Copy.WithSelf.Op(constants.%U.f84) [symbolic = %specific_impl_fn.loc18_11.2 (constants.%specific_impl_fn.e2af7e.2)] // CHECK:STDOUT: %bound_method.loc18_11.2: = bound_method %.loc18_11.2, %specific_impl_fn.loc18_11.1 // CHECK:STDOUT: %.loc17_37.1: ref @H.%U.as_type.loc17_31.1 (%U.as_type.c1c) = splice_block %return.param {} diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index ed5e12fd2fcf..6ef9a966931f 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -48,6 +48,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { } //@dump-sem-ir-end + // CHECK:STDOUT: --- from_struct.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -212,18 +213,18 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %pattern_type.loc10: type = pattern_type %Class.loc10_17.2 [symbolic = %pattern_type.loc10 (constants.%pattern_type.0b6)] // CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b)} [symbolic = %struct_type.k (constants.%struct_type.k.aa4)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc9_27.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.4df)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %T.as_type.loc9_59.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.3f0)] -// 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.090)] -// CHECK:STDOUT: %.loc10_27: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc10_27 (constants.%.018)] -// CHECK:STDOUT: %impl.elem0.loc10_27.2: @InitFromStructGeneric.%.loc10_27 (%.018) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.170)] -// CHECK:STDOUT: %specific_impl_fn.loc10_27.2: = specific_impl_function %impl.elem0.loc10_27.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.be5)] +// CHECK:STDOUT: %Copy.facet.loc10_27.2: %Copy.type = facet_value %T.as_type.loc9_59.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_27.2 (constants.%Copy.facet.3f0)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc10_27.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.090)] +// CHECK:STDOUT: %.loc10_27.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc10_27.2 [symbolic = %.loc10_27.2 (constants.%.018)] +// CHECK:STDOUT: %impl.elem0.loc10_27.2: @InitFromStructGeneric.%.loc10_27.2 (%.018) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.170)] +// CHECK:STDOUT: %specific_impl_fn.loc10_27.2: = specific_impl_function %impl.elem0.loc10_27.2, @Copy.WithSelf.Op(%Copy.facet.loc10_27.2) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.be5)] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc10_17.2, %T.as_type.loc9_59.1 [symbolic = %Class.elem (constants.%Class.elem.b97)] // CHECK:STDOUT: %Destroy.lookup_impl_witness.loc10_3: = lookup_impl_witness %Class.loc10_17.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc10_3 (constants.%Destroy.lookup_impl_witness.62e)] -// CHECK:STDOUT: %Destroy.facet.loc10_3: %Destroy.type = facet_value %Class.loc10_17.2, (%Destroy.lookup_impl_witness.loc10_3) [symbolic = %Destroy.facet.loc10_3 (constants.%Destroy.facet.25e)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc10_3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d76)] -// CHECK:STDOUT: %.loc10_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc10_3 [symbolic = %.loc10_3.2 (constants.%.0da)] -// CHECK:STDOUT: %impl.elem0.loc10_3.2: @InitFromStructGeneric.%.loc10_3.2 (%.0da) = impl_witness_access %Destroy.lookup_impl_witness.loc10_3, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.730)] -// CHECK:STDOUT: %specific_impl_fn.loc10_3.2: = specific_impl_function %impl.elem0.loc10_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc10_3) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.fa9)] +// CHECK:STDOUT: %Destroy.facet.loc10_3.2: %Destroy.type = facet_value %Class.loc10_17.2, (%Destroy.lookup_impl_witness.loc10_3) [symbolic = %Destroy.facet.loc10_3.2 (constants.%Destroy.facet.25e)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc10_3.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d76)] +// CHECK:STDOUT: %.loc10_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc10_3.2 [symbolic = %.loc10_3.3 (constants.%.0da)] +// CHECK:STDOUT: %impl.elem0.loc10_3.2: @InitFromStructGeneric.%.loc10_3.3 (%.0da) = impl_witness_access %Destroy.lookup_impl_witness.loc10_3, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.730)] +// CHECK:STDOUT: %specific_impl_fn.loc10_3.2: = specific_impl_function %impl.elem0.loc10_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc10_3.2) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.fa9)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b)) -> out %return.param: @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b) { // CHECK:STDOUT: !entry: @@ -234,8 +235,10 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.55b) = var %v.var_patt // CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b) = name_ref x, %x // CHECK:STDOUT: %.loc10_28.1: @InitFromStructGeneric.%struct_type.k (%struct_type.k.aa4) = struct_literal (%x.ref) -// CHECK:STDOUT: %impl.elem0.loc10_27.1: @InitFromStructGeneric.%.loc10_27 (%.018) = impl_witness_access constants.%Copy.lookup_impl_witness.4df, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.170)] +// CHECK:STDOUT: %impl.elem0.loc10_27.1: @InitFromStructGeneric.%.loc10_27.2 (%.018) = impl_witness_access constants.%Copy.lookup_impl_witness.4df, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.170)] // CHECK:STDOUT: %bound_method.loc10_27.1: = bound_method %x.ref, %impl.elem0.loc10_27.1 +// CHECK:STDOUT: %Copy.facet.loc10_27.1: %Copy.type = facet_value constants.%T.as_type.74b, (constants.%Copy.lookup_impl_witness.4df) [symbolic = %Copy.facet.loc10_27.2 (constants.%Copy.facet.3f0)] +// CHECK:STDOUT: %.loc10_27.1: %Copy.type = converted constants.%T.as_type.74b, %Copy.facet.loc10_27.1 [symbolic = %Copy.facet.loc10_27.2 (constants.%Copy.facet.3f0)] // CHECK:STDOUT: %specific_impl_fn.loc10_27.1: = specific_impl_function %impl.elem0.loc10_27.1, @Copy.WithSelf.Op(constants.%Copy.facet.3f0) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.be5)] // CHECK:STDOUT: %bound_method.loc10_27.2: = bound_method %x.ref, %specific_impl_fn.loc10_27.1 // CHECK:STDOUT: %.loc10_28.2: ref @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b) = class_element_access %v.var, element0 @@ -257,14 +260,18 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.b97) = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5] // CHECK:STDOUT: %.loc11_11.1: ref @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b) = class_element_access %v.ref, element0 // CHECK:STDOUT: %.loc11_11.2: @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b) = acquire_value %.loc11_11.1 -// CHECK:STDOUT: %impl.elem0.loc11: @InitFromStructGeneric.%.loc10_27 (%.018) = impl_witness_access constants.%Copy.lookup_impl_witness.4df, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.170)] +// CHECK:STDOUT: %impl.elem0.loc11: @InitFromStructGeneric.%.loc10_27.2 (%.018) = impl_witness_access constants.%Copy.lookup_impl_witness.4df, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.170)] // CHECK:STDOUT: %bound_method.loc11_11.1: = bound_method %.loc11_11.2, %impl.elem0.loc11 +// CHECK:STDOUT: %Copy.facet.loc11: %Copy.type = facet_value constants.%T.as_type.74b, (constants.%Copy.lookup_impl_witness.4df) [symbolic = %Copy.facet.loc10_27.2 (constants.%Copy.facet.3f0)] +// CHECK:STDOUT: %.loc11_11.3: %Copy.type = converted constants.%T.as_type.74b, %Copy.facet.loc11 [symbolic = %Copy.facet.loc10_27.2 (constants.%Copy.facet.3f0)] // CHECK:STDOUT: %specific_impl_fn.loc11: = specific_impl_function %impl.elem0.loc11, @Copy.WithSelf.Op(constants.%Copy.facet.3f0) [symbolic = %specific_impl_fn.loc10_27.2 (constants.%specific_impl_fn.be5)] // CHECK:STDOUT: %bound_method.loc11_11.2: = bound_method %.loc11_11.2, %specific_impl_fn.loc11 // CHECK:STDOUT: %.loc9_65.1: ref @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b) = splice_block %return.param {} // CHECK:STDOUT: %Copy.WithSelf.Op.call.loc11: init @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.74b) to %.loc9_65.1 = call %bound_method.loc11_11.2(%.loc11_11.2) -// CHECK:STDOUT: %impl.elem0.loc10_3.1: @InitFromStructGeneric.%.loc10_3.2 (%.0da) = impl_witness_access constants.%Destroy.lookup_impl_witness.62e, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.730)] +// CHECK:STDOUT: %impl.elem0.loc10_3.1: @InitFromStructGeneric.%.loc10_3.3 (%.0da) = impl_witness_access constants.%Destroy.lookup_impl_witness.62e, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.730)] // CHECK:STDOUT: %bound_method.loc10_3.1: = bound_method %v.var, %impl.elem0.loc10_3.1 +// CHECK:STDOUT: %Destroy.facet.loc10_3.1: %Destroy.type = facet_value constants.%Class.55b, (constants.%Destroy.lookup_impl_witness.62e) [symbolic = %Destroy.facet.loc10_3.2 (constants.%Destroy.facet.25e)] +// CHECK:STDOUT: %.loc10_3.2: %Destroy.type = converted constants.%Class.55b, %Destroy.facet.loc10_3.1 [symbolic = %Destroy.facet.loc10_3.2 (constants.%Destroy.facet.25e)] // CHECK:STDOUT: %specific_impl_fn.loc10_3.1: = specific_impl_function %impl.elem0.loc10_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.25e) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.fa9)] // CHECK:STDOUT: %bound_method.loc10_3.2: = bound_method %v.var, %specific_impl_fn.loc10_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc10_3.2(%v.var) @@ -449,9 +456,9 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %Adapt.loc10_23.2: type = class_type @Adapt, @Adapt(%T.as_type.loc9_45.1) [symbolic = %Adapt.loc10_23.2 (constants.%Adapt.210)] // CHECK:STDOUT: %require_complete.loc10: = require_complete_type %Adapt.loc10_23.2 [symbolic = %require_complete.loc10 (constants.%require_complete.29a)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc9_28.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc10_26.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc9_28.1 [symbolic = %.loc10_26.3 (constants.%.c29)] +// CHECK:STDOUT: %.loc10_26.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc9_28.1 [symbolic = %.loc10_26.4 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc9_28.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc10_26.2: @InitFromAdaptedGeneric.%.loc10_26.3 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_26.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc10_26.2: @InitFromAdaptedGeneric.%.loc10_26.4 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_26.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc10_26.2: = specific_impl_function %impl.elem0.loc10_26.2, @Copy.WithSelf.Op(%T.loc9_28.1) [symbolic = %specific_impl_fn.loc10_26.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @InitFromAdaptedGeneric.%T.as_type.loc9_45.1 (%T.as_type)) -> out %return.param: @InitFromAdaptedGeneric.%T.as_type.loc9_45.1 (%T.as_type) { @@ -469,8 +476,9 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %.loc10_29: type = converted %T.ref.loc10_29, %T.as_type.loc10_29 [symbolic = %T.as_type.loc9_45.1 (constants.%T.as_type)] // CHECK:STDOUT: %.loc10_26.1: @InitFromAdaptedGeneric.%T.as_type.loc9_45.1 (%T.as_type) = as_compatible %.loc10_13.2 // CHECK:STDOUT: %.loc10_26.2: @InitFromAdaptedGeneric.%T.as_type.loc9_45.1 (%T.as_type) = converted %.loc10_13.2, %.loc10_26.1 -// CHECK:STDOUT: %impl.elem0.loc10_26.1: @InitFromAdaptedGeneric.%.loc10_26.3 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc10_26.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc10_26.1: @InitFromAdaptedGeneric.%.loc10_26.4 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc10_26.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc10_26.1: = bound_method %.loc10_26.2, %impl.elem0.loc10_26.1 +// CHECK:STDOUT: %.loc10_26.3: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T.loc9_28.1 (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc10_26.1: = specific_impl_function %impl.elem0.loc10_26.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc10_26.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc10_26.2: = bound_method %.loc10_26.2, %specific_impl_fn.loc10_26.1 // CHECK:STDOUT: %.loc9_51.1: ref @InitFromAdaptedGeneric.%T.as_type.loc9_45.1 (%T.as_type) = splice_block %return.param {} diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index fc5b9a3f25c4..e55077f32916 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -17,13 +17,13 @@ library "[[@TEST_NAME]]"; class Class(T:! Core.Copy) { var x: T; - fn Get[self: Self]() -> T { + fn Get(self) -> T { //@dump-sem-ir-begin return self.x; //@dump-sem-ir-end } - fn GetAddr[ref self: Self]() -> T* { + fn GetAddr(ref self) -> T* { //@dump-sem-ir-begin return &self.x; //@dump-sem-ir-end @@ -62,6 +62,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { //@dump-sem-ir-end } + // CHECK:STDOUT: --- member_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -171,26 +172,27 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc7_27.1 [symbolic = %Class.elem (constants.%Class.elem.1ee)] -// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %T.as_type.loc7_27.1 [symbolic = %require_complete.loc9 (constants.%require_complete.d83)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc7_19.1 [symbolic = %Class.elem (constants.%Class.elem.1ee)] +// CHECK:STDOUT: %require_complete.loc9: = require_complete_type %T.as_type.loc7_19.1 [symbolic = %require_complete.loc9 (constants.%require_complete.d83)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc9_16.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc9_16.3 (constants.%.c29)] +// CHECK:STDOUT: %.loc9_16.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc9_16.4 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc9_16.2: @Class.Get.%.loc9_16.3 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_16.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc9_16.2: @Class.Get.%.loc9_16.4 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_16.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc9_16.2: = specific_impl_function %impl.elem0.loc9_16.2, @Copy.WithSelf.Op(%T) [symbolic = %specific_impl_fn.loc9_16.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Class.Get.%Class (%Class.575)) -> out %return.param: @Class.Get.%T.as_type.loc7_27.1 (%T.as_type) { +// CHECK:STDOUT: fn(%self.param: @Class.Get.%Class (%Class.575)) -> out %return.param: @Class.Get.%T.as_type.loc7_19.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @Class.Get.%Class (%Class.575) = name_ref self, %self // CHECK:STDOUT: %x.ref: @Class.Get.%Class.elem (%Class.elem.1ee) = name_ref x, @Class.%.loc5 [concrete = @Class.%.loc5] -// CHECK:STDOUT: %.loc9_16.1: ref @Class.Get.%T.as_type.loc7_27.1 (%T.as_type) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc9_16.2: @Class.Get.%T.as_type.loc7_27.1 (%T.as_type) = acquire_value %.loc9_16.1 -// CHECK:STDOUT: %impl.elem0.loc9_16.1: @Class.Get.%.loc9_16.3 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc9_16.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %.loc9_16.1: ref @Class.Get.%T.as_type.loc7_19.1 (%T.as_type) = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc9_16.2: @Class.Get.%T.as_type.loc7_19.1 (%T.as_type) = acquire_value %.loc9_16.1 +// CHECK:STDOUT: %impl.elem0.loc9_16.1: @Class.Get.%.loc9_16.4 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc9_16.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc9_16.1: = bound_method %.loc9_16.2, %impl.elem0.loc9_16.1 +// CHECK:STDOUT: %.loc9_16.3: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc9_16.1: = specific_impl_function %impl.elem0.loc9_16.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc9_16.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc9_16.2: = bound_method %.loc9_16.2, %specific_impl_fn.loc9_16.1 // CHECK:STDOUT: -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.Get.%T.as_type.loc7_27.1 (%T.as_type) to %.loc7_27.1 = call %bound_method.loc9_16.2(%.loc9_16.2) +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.Get.%T.as_type.loc7_19.1 (%T.as_type) to %.loc7_19.1 = call %bound_method.loc9_16.2(%.loc9_16.2) // CHECK:STDOUT: return %Copy.WithSelf.Op.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -200,26 +202,28 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc13_36.1 [symbolic = %Class.elem (constants.%Class.elem.1ee)] -// CHECK:STDOUT: %.loc15_12.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.as_type.loc13_36.1) [symbolic = %.loc15_12.1 (constants.%.a33)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc13_36.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cf6)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc13_36.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.ed3)] -// 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.6e0)] -// CHECK:STDOUT: %.loc15_12.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc15_12.2 (constants.%.45d)] -// CHECK:STDOUT: %impl.elem0.loc15_12.2: @Class.GetAddr.%.loc15_12.2 (%.45d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.c5d)] -// CHECK:STDOUT: %specific_impl_fn.loc15_12.2: = specific_impl_function %impl.elem0.loc15_12.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc15_12.2 (constants.%specific_impl_fn.5cf)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc13_28.1 [symbolic = %Class.elem (constants.%Class.elem.1ee)] +// CHECK:STDOUT: %.loc15_12.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.as_type.loc13_28.1) [symbolic = %.loc15_12.2 (constants.%.a33)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc13_28.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cf6)] +// CHECK:STDOUT: %Copy.facet.loc15_12.2: %Copy.type = facet_value %ptr.loc13_28.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc15_12.2 (constants.%Copy.facet.ed3)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc15_12.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.6e0)] +// CHECK:STDOUT: %.loc15_12.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc15_12.2 [symbolic = %.loc15_12.3 (constants.%.45d)] +// CHECK:STDOUT: %impl.elem0.loc15_12.2: @Class.GetAddr.%.loc15_12.3 (%.45d) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.c5d)] +// CHECK:STDOUT: %specific_impl_fn.loc15_12.2: = specific_impl_function %impl.elem0.loc15_12.2, @Copy.WithSelf.Op(%Copy.facet.loc15_12.2) [symbolic = %specific_impl_fn.loc15_12.2 (constants.%specific_impl_fn.5cf)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: ref @Class.GetAddr.%Class (%Class.575)) -> out %return.param: @Class.GetAddr.%ptr.loc13_36.1 (%ptr.215) { +// CHECK:STDOUT: fn(%self.param: ref @Class.GetAddr.%Class (%Class.575)) -> out %return.param: @Class.GetAddr.%ptr.loc13_28.1 (%ptr.215) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: ref @Class.GetAddr.%Class (%Class.575) = name_ref self, %self // CHECK:STDOUT: %x.ref: @Class.GetAddr.%Class.elem (%Class.elem.1ee) = name_ref x, @Class.%.loc5 [concrete = @Class.%.loc5] -// CHECK:STDOUT: %.loc15_17: ref @Class.GetAddr.%T.as_type.loc13_36.1 (%T.as_type) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc13_36.1 (%ptr.215) = addr_of %.loc15_17 -// CHECK:STDOUT: %impl.elem0.loc15_12.1: @Class.GetAddr.%.loc15_12.2 (%.45d) = impl_witness_access constants.%Copy.lookup_impl_witness.cf6, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.c5d)] +// CHECK:STDOUT: %.loc15_17: ref @Class.GetAddr.%T.as_type.loc13_28.1 (%T.as_type) = class_element_access %self.ref, element0 +// CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc13_28.1 (%ptr.215) = addr_of %.loc15_17 +// CHECK:STDOUT: %impl.elem0.loc15_12.1: @Class.GetAddr.%.loc15_12.3 (%.45d) = impl_witness_access constants.%Copy.lookup_impl_witness.cf6, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.c5d)] // CHECK:STDOUT: %bound_method.loc15_12.1: = bound_method %addr, %impl.elem0.loc15_12.1 +// CHECK:STDOUT: %Copy.facet.loc15_12.1: %Copy.type = facet_value constants.%ptr.215, (constants.%Copy.lookup_impl_witness.cf6) [symbolic = %Copy.facet.loc15_12.2 (constants.%Copy.facet.ed3)] +// CHECK:STDOUT: %.loc15_12.1: %Copy.type = converted constants.%ptr.215, %Copy.facet.loc15_12.1 [symbolic = %Copy.facet.loc15_12.2 (constants.%Copy.facet.ed3)] // CHECK:STDOUT: %specific_impl_fn.loc15_12.1: = specific_impl_function %impl.elem0.loc15_12.1, @Copy.WithSelf.Op(constants.%Copy.facet.ed3) [symbolic = %specific_impl_fn.loc15_12.2 (constants.%specific_impl_fn.5cf)] // CHECK:STDOUT: %bound_method.loc15_12.2: = bound_method %addr, %specific_impl_fn.loc15_12.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.GetAddr.%ptr.loc13_36.1 (%ptr.215) = call %bound_method.loc15_12.2(%addr) +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.GetAddr.%ptr.loc13_28.1 (%ptr.215) = call %bound_method.loc15_12.2(%addr) // CHECK:STDOUT: return %Copy.WithSelf.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -291,20 +295,20 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: specific @Class.Get(constants.%T.f84) { // CHECK:STDOUT: %T => constants.%T.f84 // CHECK:STDOUT: %Class => constants.%Class.575 -// CHECK:STDOUT: %pattern_type.loc7_14 => constants.%pattern_type.e18 -// CHECK:STDOUT: %T.as_type.loc7_27.1 => constants.%T.as_type -// CHECK:STDOUT: %.loc7_27.2 => constants.%.1ce700.2 -// CHECK:STDOUT: %pattern_type.loc7_27 => constants.%pattern_type.2c66b4.2 +// CHECK:STDOUT: %pattern_type.loc7_10 => constants.%pattern_type.e18 +// CHECK:STDOUT: %T.as_type.loc7_19.1 => constants.%T.as_type +// CHECK:STDOUT: %.loc7_19.2 => constants.%.1ce700.2 +// CHECK:STDOUT: %pattern_type.loc7_19 => constants.%pattern_type.2c66b4.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class.GetAddr(constants.%T.f84) { // CHECK:STDOUT: %T => constants.%T.f84 // CHECK:STDOUT: %Class => constants.%Class.575 -// CHECK:STDOUT: %pattern_type.loc13_22 => constants.%pattern_type.e18 -// CHECK:STDOUT: %T.as_type.loc13_36.1 => constants.%T.as_type -// CHECK:STDOUT: %ptr.loc13_36.1 => constants.%ptr.215 -// CHECK:STDOUT: %.loc13_36.1 => constants.%.4fb -// CHECK:STDOUT: %pattern_type.loc13_36 => constants.%pattern_type.d5b +// CHECK:STDOUT: %pattern_type.loc13_18 => constants.%pattern_type.e18 +// CHECK:STDOUT: %T.as_type.loc13_28.1 => constants.%T.as_type +// CHECK:STDOUT: %ptr.loc13_28.1 => constants.%ptr.215 +// CHECK:STDOUT: %.loc13_28.1 => constants.%.4fb +// CHECK:STDOUT: %pattern_type.loc13_28 => constants.%pattern_type.d5b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%Copy.facet.987) { @@ -326,17 +330,17 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: specific @Class.Get(constants.%Copy.facet.987) { // CHECK:STDOUT: %T => constants.%Copy.facet.987 // CHECK:STDOUT: %Class => constants.%Class.ce6 -// CHECK:STDOUT: %pattern_type.loc7_14 => constants.%pattern_type.658 -// CHECK:STDOUT: %T.as_type.loc7_27.1 => constants.%i32 -// CHECK:STDOUT: %.loc7_27.2 => constants.%.795 -// CHECK:STDOUT: %pattern_type.loc7_27 => constants.%pattern_type.6b6 +// CHECK:STDOUT: %pattern_type.loc7_10 => constants.%pattern_type.658 +// CHECK:STDOUT: %T.as_type.loc7_19.1 => constants.%i32 +// CHECK:STDOUT: %.loc7_19.2 => constants.%.795 +// CHECK:STDOUT: %pattern_type.loc7_19 => constants.%pattern_type.6b6 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc7 => constants.%complete_type.0c6 // CHECK:STDOUT: %Class.elem => constants.%Class.elem.32a // CHECK:STDOUT: %require_complete.loc9 => constants.%complete_type.f8a // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.d09 -// CHECK:STDOUT: %.loc9_16.3 => constants.%.7a6 +// CHECK:STDOUT: %.loc9_16.4 => constants.%.7a6 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.0e0 // CHECK:STDOUT: %impl.elem0.loc9_16.2 => constants.%Int.as.Copy.impl.Op.4f6 // CHECK:STDOUT: %specific_impl_fn.loc9_16.2 => constants.%Int.as.Copy.impl.Op.specific_fn @@ -345,21 +349,21 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: specific @Class.GetAddr(constants.%Copy.facet.987) { // CHECK:STDOUT: %T => constants.%Copy.facet.987 // CHECK:STDOUT: %Class => constants.%Class.ce6 -// CHECK:STDOUT: %pattern_type.loc13_22 => constants.%pattern_type.658 -// CHECK:STDOUT: %T.as_type.loc13_36.1 => constants.%i32 -// CHECK:STDOUT: %ptr.loc13_36.1 => constants.%ptr.d08 -// CHECK:STDOUT: %.loc13_36.1 => constants.%.952 -// CHECK:STDOUT: %pattern_type.loc13_36 => constants.%pattern_type.f00 +// CHECK:STDOUT: %pattern_type.loc13_18 => constants.%pattern_type.658 +// CHECK:STDOUT: %T.as_type.loc13_28.1 => constants.%i32 +// CHECK:STDOUT: %ptr.loc13_28.1 => constants.%ptr.d08 +// CHECK:STDOUT: %.loc13_28.1 => constants.%.952 +// CHECK:STDOUT: %pattern_type.loc13_28 => constants.%pattern_type.f00 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc13_22 => constants.%complete_type.0c6 -// CHECK:STDOUT: %require_complete.loc13_32 => constants.%complete_type.07f +// CHECK:STDOUT: %require_complete.loc13_18 => constants.%complete_type.0c6 +// CHECK:STDOUT: %require_complete.loc13_24 => constants.%complete_type.07f // CHECK:STDOUT: %Class.elem => constants.%Class.elem.32a -// CHECK:STDOUT: %.loc15_12.1 => constants.%.c00 +// CHECK:STDOUT: %.loc15_12.2 => constants.%.c00 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.ce1 -// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.b49 +// CHECK:STDOUT: %Copy.facet.loc15_12.2 => constants.%Copy.facet.b49 // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.f9d -// CHECK:STDOUT: %.loc15_12.2 => constants.%.ac9 +// CHECK:STDOUT: %.loc15_12.3 => constants.%.ac9 // CHECK:STDOUT: %impl.elem0.loc15_12.2 => constants.%ptr.as.Copy.impl.Op.d1c // CHECK:STDOUT: %specific_impl_fn.loc15_12.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index 0cff51dfcef7..3a2943e9b56c 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -20,7 +20,7 @@ class Class(T:! Core.Copy) { return n; } - fn G[self: Self]() -> T { + fn G(self) -> T { return self.n; } @@ -45,6 +45,7 @@ class C(T:! Core.Copy) { } //@dump-sem-ir-end + // CHECK:STDOUT: --- member_inline.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -135,23 +136,23 @@ class C(T:! Core.Copy) { // CHECK:STDOUT: %return: ref @Class.F.%T.as_type.loc6_11.1 (%T.as_type) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Class.G.decl: @Class.%Class.G.type (%Class.G.type) = fn_decl @Class.G [symbolic = @Class.%Class.G (constants.%Class.G)] { -// CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc10_12 (%pattern_type.e18) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc10_12 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc10_25 (%pattern_type.2c66b4.2) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc10_25 (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc10_25.3 [concrete] +// CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc10_8 (%pattern_type.e18) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc10_8 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc10_17 (%pattern_type.2c66b4.2) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc10_17 (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc10_17.3 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Class.%T.loc5_14.2 [symbolic = %T (constants.%T.f84)] -// CHECK:STDOUT: %T.as_type.loc10_25.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc10_25.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc10_25.3: type = converted %T.ref, %T.as_type.loc10_25.2 [symbolic = %T.as_type.loc10_25.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc10_25.4: Core.Form = init_form %.loc10_25.3 [symbolic = %.loc10_25.2 (constants.%.1ce700.2)] +// CHECK:STDOUT: %T.as_type.loc10_17.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc10_17.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc10_17.3: type = converted %T.ref, %T.as_type.loc10_17.2 [symbolic = %T.as_type.loc10_17.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc10_17.4: Core.Form = init_form %.loc10_17.3 [symbolic = %.loc10_17.2 (constants.%.1ce700.2)] // CHECK:STDOUT: %self.param: @Class.G.%Class (%Class) = value_param call_param0 -// CHECK:STDOUT: %.loc10_14.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc10_14.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_14.2 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %.loc10_8.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc10_8.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_8.2 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @Class.G.%Class (%Class) = value_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @Class.G.%T.as_type.loc10_17.1 (%T.as_type) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Class.G.%T.as_type.loc10_17.1 (%T.as_type) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc14: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [concrete] // CHECK:STDOUT: %complete_type.loc15_1.1: = complete_type_witness constants.%struct_type.n [symbolic = %complete_type.loc15_1.2 (constants.%complete_type)] @@ -175,16 +176,17 @@ class C(T:! Core.Copy) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc6_11.1 [symbolic = %require_complete (constants.%require_complete.d83)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc7: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc7 (constants.%.c29)] +// CHECK:STDOUT: %.loc7_12.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc7_12.2 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.F.%.loc7 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc7_12.2: @Class.F.%.loc7_12.2 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc7_12.2: = specific_impl_function %impl.elem0.loc7_12.2, @Copy.WithSelf.Op(%T) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%n.param: @Class.F.%T.as_type.loc6_11.1 (%T.as_type)) -> out %return.param: @Class.F.%T.as_type.loc6_11.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: @Class.F.%T.as_type.loc6_11.1 (%T.as_type) = name_ref n, %n -// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.F.%.loc7 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.F.%.loc7_12.2 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc7_12.1: = bound_method %n.ref, %impl.elem0.loc7_12.1 +// CHECK:STDOUT: %.loc7_12.1: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc7_12.1: = specific_impl_function %impl.elem0.loc7_12.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc7_12.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc7_12.2: = bound_method %n.ref, %specific_impl_fn.loc7_12.1 // CHECK:STDOUT: %.loc6_17.1: ref @Class.F.%T.as_type.loc6_11.1 (%T.as_type) = splice_block %return.param {} @@ -196,33 +198,34 @@ class C(T:! Core.Copy) { // CHECK:STDOUT: generic fn @Class.G(@Class.%T.loc5_14.2: %Copy.type) { // CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %pattern_type.loc10_12: type = pattern_type %Class [symbolic = %pattern_type.loc10_12 (constants.%pattern_type.e18)] -// CHECK:STDOUT: %T.as_type.loc10_25.1: type = facet_access_type %T [symbolic = %T.as_type.loc10_25.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc10_25.2: Core.Form = init_form %T.as_type.loc10_25.1 [symbolic = %.loc10_25.2 (constants.%.1ce700.2)] -// CHECK:STDOUT: %pattern_type.loc10_25: type = pattern_type %T.as_type.loc10_25.1 [symbolic = %pattern_type.loc10_25 (constants.%pattern_type.2c66b4.2)] +// CHECK:STDOUT: %pattern_type.loc10_8: type = pattern_type %Class [symbolic = %pattern_type.loc10_8 (constants.%pattern_type.e18)] +// CHECK:STDOUT: %T.as_type.loc10_17.1: type = facet_access_type %T [symbolic = %T.as_type.loc10_17.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc10_17.2: Core.Form = init_form %T.as_type.loc10_17.1 [symbolic = %.loc10_17.2 (constants.%.1ce700.2)] +// CHECK:STDOUT: %pattern_type.loc10_17: type = pattern_type %T.as_type.loc10_17.1 [symbolic = %pattern_type.loc10_17 (constants.%pattern_type.2c66b4.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc10: = require_complete_type %Class [symbolic = %require_complete.loc10 (constants.%require_complete.1dd)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc10_25.1 [symbolic = %Class.elem (constants.%Class.elem)] -// CHECK:STDOUT: %require_complete.loc11: = require_complete_type %T.as_type.loc10_25.1 [symbolic = %require_complete.loc11 (constants.%require_complete.d83)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc10_17.1 [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %require_complete.loc11: = require_complete_type %T.as_type.loc10_17.1 [symbolic = %require_complete.loc11 (constants.%require_complete.d83)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc11_16.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc11_16.3 (constants.%.c29)] +// CHECK:STDOUT: %.loc11_16.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc11_16.4 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc11_16.2: @Class.G.%.loc11_16.3 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc11_16.2: @Class.G.%.loc11_16.4 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc11_16.2: = specific_impl_function %impl.elem0.loc11_16.2, @Copy.WithSelf.Op(%T) [symbolic = %specific_impl_fn.loc11_16.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Class.G.%Class (%Class)) -> out %return.param: @Class.G.%T.as_type.loc10_25.1 (%T.as_type) { +// CHECK:STDOUT: fn(%self.param: @Class.G.%Class (%Class)) -> out %return.param: @Class.G.%T.as_type.loc10_17.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @Class.G.%Class (%Class) = name_ref self, %self // CHECK:STDOUT: %n.ref: @Class.G.%Class.elem (%Class.elem) = name_ref n, @Class.%.loc14 [concrete = @Class.%.loc14] -// CHECK:STDOUT: %.loc11_16.1: ref @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc11_16.2: @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = acquire_value %.loc11_16.1 -// CHECK:STDOUT: %impl.elem0.loc11_16.1: @Class.G.%.loc11_16.3 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %.loc11_16.1: ref @Class.G.%T.as_type.loc10_17.1 (%T.as_type) = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc11_16.2: @Class.G.%T.as_type.loc10_17.1 (%T.as_type) = acquire_value %.loc11_16.1 +// CHECK:STDOUT: %impl.elem0.loc11_16.1: @Class.G.%.loc11_16.4 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc11_16.1: = bound_method %.loc11_16.2, %impl.elem0.loc11_16.1 +// CHECK:STDOUT: %.loc11_16.3: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc11_16.1: = specific_impl_function %impl.elem0.loc11_16.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc11_16.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc11_16.2: = bound_method %.loc11_16.2, %specific_impl_fn.loc11_16.1 -// CHECK:STDOUT: %.loc10_25.1: ref @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = splice_block %return.param {} -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.G.%T.as_type.loc10_25.1 (%T.as_type) to %.loc10_25.1 = call %bound_method.loc11_16.2(%.loc11_16.2) +// CHECK:STDOUT: %.loc10_17.1: ref @Class.G.%T.as_type.loc10_17.1 (%T.as_type) = splice_block %return.param {} +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.G.%T.as_type.loc10_17.1 (%T.as_type) to %.loc10_17.1 = call %bound_method.loc11_16.2(%.loc11_16.2) // CHECK:STDOUT: return %Copy.WithSelf.Op.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -253,10 +256,10 @@ class C(T:! Core.Copy) { // CHECK:STDOUT: specific @Class.G(constants.%T.f84) { // CHECK:STDOUT: %T => constants.%T.f84 // CHECK:STDOUT: %Class => constants.%Class -// CHECK:STDOUT: %pattern_type.loc10_12 => constants.%pattern_type.e18 -// CHECK:STDOUT: %T.as_type.loc10_25.1 => constants.%T.as_type -// CHECK:STDOUT: %.loc10_25.2 => constants.%.1ce700.2 -// CHECK:STDOUT: %pattern_type.loc10_25 => constants.%pattern_type.2c66b4.2 +// CHECK:STDOUT: %pattern_type.loc10_8 => constants.%pattern_type.e18 +// CHECK:STDOUT: %T.as_type.loc10_17.1 => constants.%T.as_type +// CHECK:STDOUT: %.loc10_17.2 => constants.%.1ce700.2 +// CHECK:STDOUT: %pattern_type.loc10_17 => constants.%pattern_type.2c66b4.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_member_inline_missing_self_dot.carbon diff --git a/toolchain/check/testdata/class/generic/member_lookup.carbon b/toolchain/check/testdata/class/generic/member_lookup.carbon index 4609ff577e8a..58b7c0d1850b 100644 --- a/toolchain/check/testdata/class/generic/member_lookup.carbon +++ b/toolchain/check/testdata/class/generic/member_lookup.carbon @@ -76,6 +76,7 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { return x.nonesuch; } + // CHECK:STDOUT: --- member_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -106,9 +107,9 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived.loc13_45.1, %T.as_type.loc13_45.1 [symbolic = %Derived.elem (constants.%Derived.elem.eb3)] // CHECK:STDOUT: %require_complete.loc15: = require_complete_type %T.as_type.loc13_45.1 [symbolic = %require_complete.loc15 (constants.%require_complete.d83)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc13_19.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc15_11.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc13_19.1 [symbolic = %.loc15_11.3 (constants.%.c29)] +// CHECK:STDOUT: %.loc15_11.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc13_19.1 [symbolic = %.loc15_11.4 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc13_19.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc15_11.2: @AccessDerived.%.loc15_11.3 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_11.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc15_11.2: @AccessDerived.%.loc15_11.4 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_11.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc15_11.2: = specific_impl_function %impl.elem0.loc15_11.2, @Copy.WithSelf.Op(%T.loc13_19.1) [symbolic = %specific_impl_fn.loc15_11.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @AccessDerived.%Derived.loc13_45.1 (%Derived.e87)) -> out %return.param: @AccessDerived.%T.as_type.loc13_45.1 (%T.as_type) { @@ -117,8 +118,9 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %d.ref: @AccessDerived.%Derived.elem (%Derived.elem.eb3) = name_ref d, @Derived.%.loc10 [concrete = @Derived.%.loc10] // CHECK:STDOUT: %.loc15_11.1: ref @AccessDerived.%T.as_type.loc13_45.1 (%T.as_type) = class_element_access %x.ref, element1 // CHECK:STDOUT: %.loc15_11.2: @AccessDerived.%T.as_type.loc13_45.1 (%T.as_type) = acquire_value %.loc15_11.1 -// CHECK:STDOUT: %impl.elem0.loc15_11.1: @AccessDerived.%.loc15_11.3 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc15_11.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc15_11.1: @AccessDerived.%.loc15_11.4 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc15_11.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc15_11.1: = bound_method %.loc15_11.2, %impl.elem0.loc15_11.1 +// CHECK:STDOUT: %.loc15_11.3: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T.loc13_19.1 (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc15_11.1: = specific_impl_function %impl.elem0.loc15_11.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc15_11.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc15_11.2: = bound_method %.loc15_11.2, %specific_impl_fn.loc15_11.1 // CHECK:STDOUT: @@ -137,9 +139,9 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %require_complete.loc21_11: = require_complete_type %Base [symbolic = %require_complete.loc21_11 (constants.%require_complete.0fb)] // CHECK:STDOUT: %require_complete.loc21_13: = require_complete_type %T.as_type.loc19_42.1 [symbolic = %require_complete.loc21_13 (constants.%require_complete.d83)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc19_16.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc21_11.5: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc19_16.1 [symbolic = %.loc21_11.5 (constants.%.c29)] +// CHECK:STDOUT: %.loc21_11.6: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc19_16.1 [symbolic = %.loc21_11.6 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc19_16.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc21_11.2: @AccessBase.%.loc21_11.5 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc21_11.2: @AccessBase.%.loc21_11.6 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc21_11.2: = specific_impl_function %impl.elem0.loc21_11.2, @Copy.WithSelf.Op(%T.loc19_16.1) [symbolic = %specific_impl_fn.loc21_11.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @AccessBase.%Derived.loc19_42.1 (%Derived.e87)) -> out %return.param: @AccessBase.%T.as_type.loc19_42.1 (%T.as_type) { @@ -150,8 +152,9 @@ fn AccessMissingConcrete(x: Derived(i32)) -> i32 { // CHECK:STDOUT: %.loc21_11.2: ref @AccessBase.%Base (%Base.146) = converted %x.ref, %.loc21_11.1 // CHECK:STDOUT: %.loc21_11.3: ref @AccessBase.%T.as_type.loc19_42.1 (%T.as_type) = class_element_access %.loc21_11.2, element0 // CHECK:STDOUT: %.loc21_11.4: @AccessBase.%T.as_type.loc19_42.1 (%T.as_type) = acquire_value %.loc21_11.3 -// CHECK:STDOUT: %impl.elem0.loc21_11.1: @AccessBase.%.loc21_11.5 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc21_11.1: @AccessBase.%.loc21_11.6 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc21_11.1: = bound_method %.loc21_11.4, %impl.elem0.loc21_11.1 +// CHECK:STDOUT: %.loc21_11.5: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T.loc19_16.1 (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc21_11.1: = specific_impl_function %impl.elem0.loc21_11.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc21_11.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc21_11.2: = bound_method %.loc21_11.4, %specific_impl_fn.loc21_11.1 // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index b2401955169c..8d6500fa301e 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin class Class(T:! Core.Copy) { fn F(n: T) -> T; - fn G[self: Self]() -> T; + fn G(self) -> T; var n: T; } @@ -25,7 +25,7 @@ fn Class(T:! Core.Copy).F(n: T) -> T { return n; } -fn Class(T:! Core.Copy).G[self: Self]() -> T { +fn Class(T:! Core.Copy).G(self) -> T { return self.n; } //@dump-sem-ir-end @@ -37,11 +37,11 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin class A(T:! type) { class B(_:! T) { - fn F[self: Self](a: T); + fn F(self, a: T); } } -fn A(T:! type).B(_:! T).F[unused self: Self](unused a: T) {} +fn A(T:! type).B(_:! T).F(unused self, unused a: T) {} //@dump-sem-ir-end // --- fail_mismatched_not_generic_vs_generic.carbon @@ -112,6 +112,7 @@ class Generic(unused T:! type) { // CHECK:STDERR: fn Generic(unused T:! ()).WrongType() {} + // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -190,10 +191,10 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: %return.loc11: ref @Class.F.%T.as_type.loc6_11.1 (%T.as_type) = return_slot %return.param.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: %Class.G.decl: %Class.G.type = fn_decl @Class.G [symbolic = constants.%Class.G] { -// CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc7_12 (%pattern_type.e18) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc7_12 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc7_25 (%pattern_type.2c66b4.2) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc7_25 (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc15_44.2 [concrete] +// CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc7_8 (%pattern_type.e18) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc7_8 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc7_17 (%pattern_type.2c66b4.2) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc7_17 (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc15_36.2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc15_18: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] @@ -202,17 +203,17 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc15: %Copy.type = symbolic_binding T, 0 [symbolic = @Class.%T.loc5_14.1 (constants.%T.f84)] // CHECK:STDOUT: %T.ref.loc15: %Copy.type = name_ref T, %T.loc15 [symbolic = %T.loc7 (constants.%T.f84)] -// CHECK:STDOUT: %T.as_type.loc15: type = facet_access_type %T.ref.loc15 [symbolic = %T.as_type.loc7_25.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc15_44.2: type = converted %T.ref.loc15, %T.as_type.loc15 [symbolic = %T.as_type.loc7_25.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc15_44.3: Core.Form = init_form %.loc15_44.2 [symbolic = %.loc7_25.1 (constants.%.1ce700.2)] +// CHECK:STDOUT: %T.as_type.loc15: type = facet_access_type %T.ref.loc15 [symbolic = %T.as_type.loc7_17.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc15_36.2: type = converted %T.ref.loc15, %T.as_type.loc15 [symbolic = %T.as_type.loc7_17.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc15_36.3: Core.Form = init_form %.loc15_36.2 [symbolic = %.loc7_17.1 (constants.%.1ce700.2)] // CHECK:STDOUT: %self.param.loc15: @Class.G.%Class (%Class) = value_param call_param0 -// CHECK:STDOUT: %.loc15_33.1: type = splice_block %Self.ref.loc15 [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc15_33.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, %.loc15_33.2 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %.loc15_27.1: type = splice_block %Self.ref.loc15 [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc15_27.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, %.loc15_27.2 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc15: @Class.G.%Class (%Class) = value_binding self, %self.param.loc15 -// CHECK:STDOUT: %return.param.loc15: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = out_param call_param1 -// CHECK:STDOUT: %return.loc15: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = return_slot %return.param.loc15 +// CHECK:STDOUT: %return.param.loc15: ref @Class.G.%T.as_type.loc7_17.1 (%T.as_type) = out_param call_param1 +// CHECK:STDOUT: %return.loc15: ref @Class.G.%T.as_type.loc7_17.1 (%T.as_type) = return_slot %return.param.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -253,23 +254,23 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: %return.loc6: ref @Class.F.%T.as_type.loc6_11.1 (%T.as_type) = return_slot %return.param.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %Class.G.decl: @Class.%Class.G.type (%Class.G.type) = fn_decl @Class.G [symbolic = @Class.%Class.G (constants.%Class.G)] { -// CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc7_12 (%pattern_type.e18) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc7_12 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc7_25 (%pattern_type.2c66b4.2) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc7_25 (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc15_44.2 [concrete] +// CHECK:STDOUT: %self.param_patt: @Class.G.%pattern_type.loc7_8 (%pattern_type.e18) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Class.G.%pattern_type.loc7_8 (%pattern_type.e18) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @Class.G.%pattern_type.loc7_17 (%pattern_type.2c66b4.2) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @Class.G.%pattern_type.loc7_17 (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc15_36.2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref.loc7: %Copy.type = name_ref T, @Class.%T.loc5_14.2 [symbolic = %T.loc7 (constants.%T.f84)] -// CHECK:STDOUT: %T.as_type.loc7_25.2: type = facet_access_type %T.ref.loc7 [symbolic = %T.as_type.loc7_25.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc7_25.2: type = converted %T.ref.loc7, %T.as_type.loc7_25.2 [symbolic = %T.as_type.loc7_25.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc7_25.3: Core.Form = init_form %.loc7_25.2 [symbolic = %.loc7_25.1 (constants.%.1ce700.2)] +// CHECK:STDOUT: %T.as_type.loc7_17.2: type = facet_access_type %T.ref.loc7 [symbolic = %T.as_type.loc7_17.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc7_17.2: type = converted %T.ref.loc7, %T.as_type.loc7_17.2 [symbolic = %T.as_type.loc7_17.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc7_17.3: Core.Form = init_form %.loc7_17.2 [symbolic = %.loc7_17.1 (constants.%.1ce700.2)] // CHECK:STDOUT: %self.param.loc7: @Class.G.%Class (%Class) = value_param call_param0 -// CHECK:STDOUT: %.loc7_14.1: type = splice_block %Self.ref.loc7 [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc7_14.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_14.2 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %.loc7_8.1: type = splice_block %Self.ref.loc7 [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc7_8.2: type = specific_constant constants.%Class, @Class(constants.%T.f84) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_8.2 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc7: @Class.G.%Class (%Class) = value_binding self, %self.param.loc7 -// CHECK:STDOUT: %return.param.loc7: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = out_param call_param1 -// CHECK:STDOUT: %return.loc7: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = return_slot %return.param.loc7 +// CHECK:STDOUT: %return.param.loc7: ref @Class.G.%T.as_type.loc7_17.1 (%T.as_type) = out_param call_param1 +// CHECK:STDOUT: %return.loc7: ref @Class.G.%T.as_type.loc7_17.1 (%T.as_type) = return_slot %return.param.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [concrete] // CHECK:STDOUT: %complete_type.loc9_1.1: = complete_type_witness constants.%struct_type.n [symbolic = %complete_type.loc9_1.2 (constants.%complete_type)] @@ -293,16 +294,17 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc6_11.1 [symbolic = %require_complete (constants.%require_complete.d83)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc6) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc12: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc6 [symbolic = %.loc12 (constants.%.c29)] +// CHECK:STDOUT: %.loc12_10.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc6 [symbolic = %.loc12_10.2 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc6, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc12_10.2: @Class.F.%.loc12 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_10.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc12_10.2: @Class.F.%.loc12_10.2 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_10.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc12_10.2: = specific_impl_function %impl.elem0.loc12_10.2, @Copy.WithSelf.Op(%T.loc6) [symbolic = %specific_impl_fn.loc12_10.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%n.param.loc11: @Class.F.%T.as_type.loc6_11.1 (%T.as_type)) -> out %return.param.loc11: @Class.F.%T.as_type.loc6_11.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: @Class.F.%T.as_type.loc6_11.1 (%T.as_type) = name_ref n, %n.loc11 -// CHECK:STDOUT: %impl.elem0.loc12_10.1: @Class.F.%.loc12 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc12_10.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc12_10.1: @Class.F.%.loc12_10.2 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc12_10.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc12_10.1: = bound_method %n.ref, %impl.elem0.loc12_10.1 +// CHECK:STDOUT: %.loc12_10.1: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T.loc6 (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc12_10.1: = specific_impl_function %impl.elem0.loc12_10.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc12_10.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc12_10.2: = bound_method %n.ref, %specific_impl_fn.loc12_10.1 // CHECK:STDOUT: %.loc11_36.1: ref @Class.F.%T.as_type.loc6_11.1 (%T.as_type) = splice_block %return.param.loc11 {} @@ -314,33 +316,34 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: generic fn @Class.G(@Class.%T.loc5_14.2: %Copy.type) { // CHECK:STDOUT: %T.loc7: %Copy.type = symbolic_binding T, 0 [symbolic = %T.loc7 (constants.%T.f84)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc7) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %pattern_type.loc7_12: type = pattern_type %Class [symbolic = %pattern_type.loc7_12 (constants.%pattern_type.e18)] -// CHECK:STDOUT: %T.as_type.loc7_25.1: type = facet_access_type %T.loc7 [symbolic = %T.as_type.loc7_25.1 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc7_25.1: Core.Form = init_form %T.as_type.loc7_25.1 [symbolic = %.loc7_25.1 (constants.%.1ce700.2)] -// CHECK:STDOUT: %pattern_type.loc7_25: type = pattern_type %T.as_type.loc7_25.1 [symbolic = %pattern_type.loc7_25 (constants.%pattern_type.2c66b4.2)] +// CHECK:STDOUT: %pattern_type.loc7_8: type = pattern_type %Class [symbolic = %pattern_type.loc7_8 (constants.%pattern_type.e18)] +// CHECK:STDOUT: %T.as_type.loc7_17.1: type = facet_access_type %T.loc7 [symbolic = %T.as_type.loc7_17.1 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc7_17.1: Core.Form = init_form %T.as_type.loc7_17.1 [symbolic = %.loc7_17.1 (constants.%.1ce700.2)] +// CHECK:STDOUT: %pattern_type.loc7_17: type = pattern_type %T.as_type.loc7_17.1 [symbolic = %pattern_type.loc7_17 (constants.%pattern_type.2c66b4.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc15: = require_complete_type %Class [symbolic = %require_complete.loc15 (constants.%require_complete.1dd)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc7_25.1 [symbolic = %Class.elem (constants.%Class.elem)] -// CHECK:STDOUT: %require_complete.loc16: = require_complete_type %T.as_type.loc7_25.1 [symbolic = %require_complete.loc16 (constants.%require_complete.d83)] +// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc7_17.1 [symbolic = %Class.elem (constants.%Class.elem)] +// CHECK:STDOUT: %require_complete.loc16: = require_complete_type %T.as_type.loc7_17.1 [symbolic = %require_complete.loc16 (constants.%require_complete.d83)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T.loc7) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc16_14.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc7 [symbolic = %.loc16_14.3 (constants.%.c29)] +// CHECK:STDOUT: %.loc16_14.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T.loc7 [symbolic = %.loc16_14.4 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T.loc7, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc16_14.2: @Class.G.%.loc16_14.3 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_14.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc16_14.2: @Class.G.%.loc16_14.4 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_14.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc16_14.2: = specific_impl_function %impl.elem0.loc16_14.2, @Copy.WithSelf.Op(%T.loc7) [symbolic = %specific_impl_fn.loc16_14.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param.loc15: @Class.G.%Class (%Class)) -> out %return.param.loc15: @Class.G.%T.as_type.loc7_25.1 (%T.as_type) { +// CHECK:STDOUT: fn(%self.param.loc15: @Class.G.%Class (%Class)) -> out %return.param.loc15: @Class.G.%T.as_type.loc7_17.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @Class.G.%Class (%Class) = name_ref self, %self.loc15 // CHECK:STDOUT: %n.ref: @Class.G.%Class.elem (%Class.elem) = name_ref n, @Class.%.loc8 [concrete = @Class.%.loc8] -// CHECK:STDOUT: %.loc16_14.1: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc16_14.2: @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = acquire_value %.loc16_14.1 -// CHECK:STDOUT: %impl.elem0.loc16_14.1: @Class.G.%.loc16_14.3 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc16_14.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %.loc16_14.1: ref @Class.G.%T.as_type.loc7_17.1 (%T.as_type) = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc16_14.2: @Class.G.%T.as_type.loc7_17.1 (%T.as_type) = acquire_value %.loc16_14.1 +// CHECK:STDOUT: %impl.elem0.loc16_14.1: @Class.G.%.loc16_14.4 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc16_14.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc16_14.1: = bound_method %.loc16_14.2, %impl.elem0.loc16_14.1 +// CHECK:STDOUT: %.loc16_14.3: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T.loc7 (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc16_14.1: = specific_impl_function %impl.elem0.loc16_14.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc16_14.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc16_14.2: = bound_method %.loc16_14.2, %specific_impl_fn.loc16_14.1 -// CHECK:STDOUT: %.loc15_44.1: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = splice_block %return.param.loc15 {} -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.G.%T.as_type.loc7_25.1 (%T.as_type) to %.loc15_44.1 = call %bound_method.loc16_14.2(%.loc16_14.2) +// CHECK:STDOUT: %.loc15_36.1: ref @Class.G.%T.as_type.loc7_17.1 (%T.as_type) = splice_block %return.param.loc15 {} +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Class.G.%T.as_type.loc7_17.1 (%T.as_type) to %.loc15_36.1 = call %bound_method.loc16_14.2(%.loc16_14.2) // CHECK:STDOUT: return %Copy.WithSelf.Op.call to %return.param.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -371,10 +374,10 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: specific @Class.G(constants.%T.f84) { // CHECK:STDOUT: %T.loc7 => constants.%T.f84 // CHECK:STDOUT: %Class => constants.%Class -// CHECK:STDOUT: %pattern_type.loc7_12 => constants.%pattern_type.e18 -// CHECK:STDOUT: %T.as_type.loc7_25.1 => constants.%T.as_type -// CHECK:STDOUT: %.loc7_25.1 => constants.%.1ce700.2 -// CHECK:STDOUT: %pattern_type.loc7_25 => constants.%pattern_type.2c66b4.2 +// CHECK:STDOUT: %pattern_type.loc7_8 => constants.%pattern_type.e18 +// CHECK:STDOUT: %T.as_type.loc7_17.1 => constants.%T.as_type +// CHECK:STDOUT: %.loc7_17.1 => constants.%.1ce700.2 +// CHECK:STDOUT: %pattern_type.loc7_17 => constants.%pattern_type.2c66b4.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nested.carbon @@ -412,10 +415,10 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc5_10.2: type = symbolic_binding T, 0 [symbolic = %T.loc5_10.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %B.F.decl: %B.F.type = fn_decl @B.F [symbolic = constants.%B.F] { -// CHECK:STDOUT: %self.param_patt: @B.F.%pattern_type.loc7_14 (%pattern_type.b16) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @B.F.%pattern_type.loc7_14 (%pattern_type.b16) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %a.param_patt: @B.F.%pattern_type.loc7_23 (%pattern_type.51d) = value_param_pattern [concrete] -// CHECK:STDOUT: %a.patt: @B.F.%pattern_type.loc7_23 (%pattern_type.51d) = at_binding_pattern a, %a.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @B.F.%pattern_type.loc7_10 (%pattern_type.b16) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @B.F.%pattern_type.loc7_10 (%pattern_type.b16) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %a.param_patt: @B.F.%pattern_type.loc7_17 (%pattern_type.51d) = value_param_pattern [concrete] +// CHECK:STDOUT: %a.patt: @B.F.%pattern_type.loc7_17 (%pattern_type.51d) = at_binding_pattern a, %a.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc11_10.1: type = splice_block %.loc11_10.2 [concrete = type] { // CHECK:STDOUT: %.Self.loc11_7: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] @@ -428,13 +431,13 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %_.loc11: @B.%T (%T) = symbolic_binding _, 1 [symbolic = @B.%_.loc6_12.1 (constants.%_)] // CHECK:STDOUT: %self.param.loc11: @B.F.%B (%B) = value_param call_param0 -// CHECK:STDOUT: %.loc11_40.1: type = splice_block %Self.ref.loc11 [symbolic = %B (constants.%B)] { -// CHECK:STDOUT: %.loc11_40.2: type = specific_constant constants.%B, @B(constants.%T, constants.%_) [symbolic = %B (constants.%B)] -// CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, %.loc11_40.2 [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %.loc11_34.1: type = splice_block %Self.ref.loc11 [symbolic = %B (constants.%B)] { +// CHECK:STDOUT: %.loc11_34.2: type = specific_constant constants.%B, @B(constants.%T, constants.%_) [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, %.loc11_34.2 [symbolic = %B (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc11: @B.F.%B (%B) = value_binding self, %self.param.loc11 // CHECK:STDOUT: %a.param.loc11: @B.F.%T.loc7 (%T) = value_param call_param1 -// CHECK:STDOUT: %T.ref.loc11_56: type = name_ref T, %T.loc11 [symbolic = %T.loc7 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc11_50: type = name_ref T, %T.loc11 [symbolic = %T.loc7 (constants.%T)] // CHECK:STDOUT: %a.loc11: @B.F.%T.loc7 (%T) = value_binding a, %a.param.loc11 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -477,15 +480,15 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %B.F.decl: @B.%B.F.type (%B.F.type) = fn_decl @B.F [symbolic = @B.%B.F (constants.%B.F)] { -// CHECK:STDOUT: %self.param_patt: @B.F.%pattern_type.loc7_14 (%pattern_type.b16) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @B.F.%pattern_type.loc7_14 (%pattern_type.b16) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %a.param_patt: @B.F.%pattern_type.loc7_23 (%pattern_type.51d) = value_param_pattern [concrete] -// CHECK:STDOUT: %a.patt: @B.F.%pattern_type.loc7_23 (%pattern_type.51d) = at_binding_pattern a, %a.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @B.F.%pattern_type.loc7_10 (%pattern_type.b16) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @B.F.%pattern_type.loc7_10 (%pattern_type.b16) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %a.param_patt: @B.F.%pattern_type.loc7_17 (%pattern_type.51d) = value_param_pattern [concrete] +// CHECK:STDOUT: %a.patt: @B.F.%pattern_type.loc7_17 (%pattern_type.51d) = at_binding_pattern a, %a.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param.loc7: @B.F.%B (%B) = value_param call_param0 -// CHECK:STDOUT: %.loc7_16.1: type = splice_block %Self.ref.loc7 [symbolic = %B (constants.%B)] { -// CHECK:STDOUT: %.loc7_16.2: type = specific_constant constants.%B, @B(constants.%T, constants.%_) [symbolic = %B (constants.%B)] -// CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_16.2 [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %.loc7_10.1: type = splice_block %Self.ref.loc7 [symbolic = %B (constants.%B)] { +// CHECK:STDOUT: %.loc7_10.2: type = specific_constant constants.%B, @B(constants.%T, constants.%_) [symbolic = %B (constants.%B)] +// CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_10.2 [symbolic = %B (constants.%B)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc7: @B.F.%B (%B) = value_binding self, %self.param.loc7 // CHECK:STDOUT: %a.param.loc7: @B.F.%T.loc7 (%T) = value_param call_param1 @@ -506,12 +509,12 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc7: type = symbolic_binding T, 0 [symbolic = %T.loc7 (constants.%T)] // CHECK:STDOUT: %_.loc7: @B.F.%T.loc7 (%T) = symbolic_binding _, 1 [symbolic = %_.loc7 (constants.%_)] // CHECK:STDOUT: %B: type = class_type @B, @B(%T.loc7, %_.loc7) [symbolic = %B (constants.%B)] -// CHECK:STDOUT: %pattern_type.loc7_14: type = pattern_type %B [symbolic = %pattern_type.loc7_14 (constants.%pattern_type.b16)] -// CHECK:STDOUT: %pattern_type.loc7_23: type = pattern_type %T.loc7 [symbolic = %pattern_type.loc7_23 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %pattern_type.loc7_10: type = pattern_type %B [symbolic = %pattern_type.loc7_10 (constants.%pattern_type.b16)] +// CHECK:STDOUT: %pattern_type.loc7_17: type = pattern_type %T.loc7 [symbolic = %pattern_type.loc7_17 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc11_38: = require_complete_type %B [symbolic = %require_complete.loc11_38 (constants.%require_complete.0e8)] -// CHECK:STDOUT: %require_complete.loc11_54: = require_complete_type %T.loc7 [symbolic = %require_complete.loc11_54 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc11_34: = require_complete_type %B [symbolic = %require_complete.loc11_34 (constants.%require_complete.0e8)] +// CHECK:STDOUT: %require_complete.loc11_48: = require_complete_type %T.loc7 [symbolic = %require_complete.loc11_48 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param.loc11: @B.F.%B (%B), %a.param.loc11: @B.F.%T.loc7 (%T)) { // CHECK:STDOUT: !entry: @@ -541,7 +544,7 @@ fn Generic(unused T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc7 => constants.%T // CHECK:STDOUT: %_.loc7 => constants.%_ // CHECK:STDOUT: %B => constants.%B -// CHECK:STDOUT: %pattern_type.loc7_14 => constants.%pattern_type.b16 -// CHECK:STDOUT: %pattern_type.loc7_23 => constants.%pattern_type.51d +// CHECK:STDOUT: %pattern_type.loc7_10 => constants.%pattern_type.b16 +// CHECK:STDOUT: %pattern_type.loc7_17 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index 7692efecd6d4..a26449575873 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -35,19 +35,19 @@ library "[[@TEST_NAME]]"; class Outer(T:! type) { interface Inner { - fn F[self: Self]() -> T; + fn F(self) -> T; } class C { impl as Inner { - fn F[self: C]() -> T { return self.(Inner.F)(); } + fn F(self: C) -> T { return self.(Inner.F)(); } } } } class D { impl as Outer(i32).Inner { - fn F[self: D]() -> i32; + fn F(self: D) -> i32; } } @@ -56,6 +56,7 @@ fn Test() -> i32 { return c.(Outer(i32).Inner.F)(); } + // CHECK:STDOUT: --- class.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -265,17 +266,18 @@ fn Test() -> i32 { // CHECK:STDOUT: %require_complete.loc9_14: = require_complete_type %Inner [symbolic = %require_complete.loc9_14 (constants.%require_complete.972)] // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Outer.F.%T.as_type.loc9_11.1 (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n.797)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc9_38: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc9_38 (constants.%.c29)] +// CHECK:STDOUT: %.loc9_38.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc9_38.2 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc9_38.2: @Outer.F.%.loc9_38 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc9_38.2: @Outer.F.%.loc9_38.2 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %specific_impl_fn.loc9_38.2: = specific_impl_function %impl.elem0.loc9_38.2, @Copy.WithSelf.Op(%T) [symbolic = %specific_impl_fn.loc9_38.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%n.param: @Outer.F.%T.as_type.loc9_11.1 (%T.as_type)) -> out %return.param: @Outer.F.%Inner (%Inner.06b) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.ref: @Outer.F.%T.as_type.loc9_11.1 (%T.as_type) = name_ref n, %n // CHECK:STDOUT: %.loc9_39.1: @Outer.F.%struct_type.n (%struct_type.n.797) = struct_literal (%n.ref) -// CHECK:STDOUT: %impl.elem0.loc9_38.1: @Outer.F.%.loc9_38 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc9_38.1: @Outer.F.%.loc9_38.2 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc9_38.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc9_38.1: = bound_method %n.ref, %impl.elem0.loc9_38.1 +// CHECK:STDOUT: %.loc9_38.1: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc9_38.1: = specific_impl_function %impl.elem0.loc9_38.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc9_38.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc9_38.2: = bound_method %n.ref, %specific_impl_fn.loc9_38.1 // CHECK:STDOUT: %.loc9_39.2: ref @Outer.F.%T.as_type.loc9_11.1 (%T.as_type) = class_element_access %return.param, element0 @@ -418,7 +420,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %require_complete.loc9_14 => constants.%complete_type.cdf // CHECK:STDOUT: %struct_type.n => constants.%struct_type.n.9ed // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.d09 -// CHECK:STDOUT: %.loc9_38 => constants.%.7a6 +// CHECK:STDOUT: %.loc9_38.2 => constants.%.7a6 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.0e0 // CHECK:STDOUT: %impl.elem0.loc9_38.2 => constants.%Int.as.Copy.impl.Op.4f6 // CHECK:STDOUT: %specific_impl_fn.loc9_38.2 => constants.%Int.as.Copy.impl.Op.specific_fn @@ -562,31 +564,31 @@ fn Test() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %Inner.WithSelf.F.decl: @Inner.WithSelf.%Inner.WithSelf.F.type (%Inner.WithSelf.F.type.792) = fn_decl @Inner.WithSelf.F [symbolic = @Inner.WithSelf.%Inner.WithSelf.F (constants.%Inner.WithSelf.F.576)] { -// CHECK:STDOUT: %self.param_patt: @Inner.WithSelf.F.%pattern_type.loc6_14 (%pattern_type.397) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Inner.WithSelf.F.%pattern_type.loc6_14 (%pattern_type.397) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Inner.WithSelf.F.%pattern_type.loc6_27 (%pattern_type.51d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Inner.WithSelf.F.%pattern_type.loc6_27 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] +// CHECK:STDOUT: %self.param_patt: @Inner.WithSelf.F.%pattern_type.loc6_10 (%pattern_type.397) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Inner.WithSelf.F.%pattern_type.loc6_10 (%pattern_type.397) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @Inner.WithSelf.F.%pattern_type.loc6_19 (%pattern_type.51d) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @Inner.WithSelf.F.%pattern_type.loc6_19 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc4_14.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc6_27.2: Core.Form = init_form %T.ref [symbolic = %.loc6_27.1 (constants.%.184)] -// CHECK:STDOUT: %self.param: @Inner.WithSelf.F.%Self.as_type.loc6_16.1 (%Self.as_type.abe) = value_param call_param0 -// CHECK:STDOUT: %.loc6_16.1: type = splice_block %.loc6_16.3 [symbolic = %Self.as_type.loc6_16.1 (constants.%Self.as_type.abe)] { -// CHECK:STDOUT: %.loc6_16.2: @Inner.WithSelf.F.%Inner.type (%Inner.type.84b) = specific_constant @Inner.%Self.loc5_19.1, @Inner(constants.%T) [symbolic = %Self (constants.%Self.656)] -// CHECK:STDOUT: %Self.ref: @Inner.WithSelf.F.%Inner.type (%Inner.type.84b) = name_ref Self, %.loc6_16.2 [symbolic = %Self (constants.%Self.656)] -// CHECK:STDOUT: %Self.as_type.loc6_16.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_16.1 (constants.%Self.as_type.abe)] -// CHECK:STDOUT: %.loc6_16.3: type = converted %Self.ref, %Self.as_type.loc6_16.2 [symbolic = %Self.as_type.loc6_16.1 (constants.%Self.as_type.abe)] +// CHECK:STDOUT: %.loc6_19.2: Core.Form = init_form %T.ref [symbolic = %.loc6_19.1 (constants.%.184)] +// CHECK:STDOUT: %self.param: @Inner.WithSelf.F.%Self.as_type.loc6_10.1 (%Self.as_type.abe) = value_param call_param0 +// CHECK:STDOUT: %.loc6_10.1: type = splice_block %.loc6_10.3 [symbolic = %Self.as_type.loc6_10.1 (constants.%Self.as_type.abe)] { +// CHECK:STDOUT: %.loc6_10.2: @Inner.WithSelf.F.%Inner.type (%Inner.type.84b) = specific_constant @Inner.%Self.loc5_19.1, @Inner(constants.%T) [symbolic = %Self (constants.%Self.656)] +// CHECK:STDOUT: %Self.ref: @Inner.WithSelf.F.%Inner.type (%Inner.type.84b) = name_ref Self, %.loc6_10.2 [symbolic = %Self (constants.%Self.656)] +// CHECK:STDOUT: %Self.as_type.loc6_10.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_10.1 (constants.%Self.as_type.abe)] +// CHECK:STDOUT: %.loc6_10.3: type = converted %Self.ref, %Self.as_type.loc6_10.2 [symbolic = %Self.as_type.loc6_10.1 (constants.%Self.as_type.abe)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Inner.WithSelf.F.%Self.as_type.loc6_16.1 (%Self.as_type.abe) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Inner.WithSelf.F.%Self.as_type.loc6_10.1 (%Self.as_type.abe) = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref @Inner.WithSelf.F.%T (%T) = out_param call_param1 // CHECK:STDOUT: %return: ref @Inner.WithSelf.F.%T (%T) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc6_28.1: @Inner.WithSelf.%Inner.assoc_type (%Inner.assoc_type.b6b) = assoc_entity element0, %Inner.WithSelf.F.decl [symbolic = %assoc0.loc6_28.2 (constants.%assoc0.6dc)] +// CHECK:STDOUT: %assoc0.loc6_20.1: @Inner.WithSelf.%Inner.assoc_type (%Inner.assoc_type.b6b) = assoc_entity element0, %Inner.WithSelf.F.decl [symbolic = %assoc0.loc6_20.2 (constants.%assoc0.6dc)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc5_19.1 // CHECK:STDOUT: .T = // CHECK:STDOUT: .T = -// CHECK:STDOUT: .F = @Inner.WithSelf.%assoc0.loc6_28.1 +// CHECK:STDOUT: .F = @Inner.WithSelf.%assoc0.loc6_20.1 // CHECK:STDOUT: .C = // CHECK:STDOUT: .Inner = // CHECK:STDOUT: .D = @@ -611,11 +613,11 @@ fn Test() -> i32 { // CHECK:STDOUT: %C.as.Inner.impl.F.decl: @C.as.Inner.impl.%C.as.Inner.impl.F.type (%C.as.Inner.impl.F.type.1ec) = fn_decl @C.as.Inner.impl.F [symbolic = @C.as.Inner.impl.%C.as.Inner.impl.F (constants.%C.as.Inner.impl.F.4be)] { // CHECK:STDOUT: %self.param_patt: @C.as.Inner.impl.F.%pattern_type.loc11_16 (%pattern_type.6fd) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @C.as.Inner.impl.F.%pattern_type.loc11_16 (%pattern_type.6fd) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @C.as.Inner.impl.F.%pattern_type.loc11_26 (%pattern_type.51d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @C.as.Inner.impl.F.%pattern_type.loc11_26 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] +// CHECK:STDOUT: %return.param_patt: @C.as.Inner.impl.F.%pattern_type.loc11_24 (%pattern_type.51d) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @C.as.Inner.impl.F.%pattern_type.loc11_24 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc4_14.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc11_26.3: Core.Form = init_form %T.ref [symbolic = %.loc11_26.2 (constants.%.184)] +// CHECK:STDOUT: %.loc11_24.3: Core.Form = init_form %T.ref [symbolic = %.loc11_24.2 (constants.%.184)] // CHECK:STDOUT: %self.param: @C.as.Inner.impl.F.%C (%C.7d7) = value_param call_param0 // CHECK:STDOUT: %.loc11_18.1: type = splice_block %C.ref [symbolic = %C (constants.%C.7d7)] { // CHECK:STDOUT: %.loc11_18.2: type = specific_constant @Outer.%C.decl, @Outer(constants.%T) [symbolic = %C (constants.%C.7d7)] @@ -726,49 +728,49 @@ fn Test() -> i32 { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Inner.type: type = facet_type <@Inner, @Inner(%T)> [symbolic = %Inner.type (constants.%Inner.type.84b)] // CHECK:STDOUT: %Self: @Inner.WithSelf.F.%Inner.type (%Inner.type.84b) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.656)] -// CHECK:STDOUT: %Self.as_type.loc6_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_16.1 (constants.%Self.as_type.abe)] -// CHECK:STDOUT: %pattern_type.loc6_14: type = pattern_type %Self.as_type.loc6_16.1 [symbolic = %pattern_type.loc6_14 (constants.%pattern_type.397)] -// CHECK:STDOUT: %.loc6_27.1: Core.Form = init_form %T [symbolic = %.loc6_27.1 (constants.%.184)] -// CHECK:STDOUT: %pattern_type.loc6_27: type = pattern_type %T [symbolic = %pattern_type.loc6_27 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %Self.as_type.loc6_10.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_10.1 (constants.%Self.as_type.abe)] +// CHECK:STDOUT: %pattern_type.loc6_10: type = pattern_type %Self.as_type.loc6_10.1 [symbolic = %pattern_type.loc6_10 (constants.%pattern_type.397)] +// CHECK:STDOUT: %.loc6_19.1: Core.Form = init_form %T [symbolic = %.loc6_19.1 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc6_19: type = pattern_type %T [symbolic = %pattern_type.loc6_19 (constants.%pattern_type.51d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Inner.WithSelf.F.%Self.as_type.loc6_16.1 (%Self.as_type.abe)) -> out %return.param: @Inner.WithSelf.F.%T (%T); +// CHECK:STDOUT: fn(%self.param: @Inner.WithSelf.F.%Self.as_type.loc6_10.1 (%Self.as_type.abe)) -> out %return.param: @Inner.WithSelf.F.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @C.as.Inner.impl.F(@Outer.%T.loc4_14.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.7d7)] // CHECK:STDOUT: %pattern_type.loc11_16: type = pattern_type %C [symbolic = %pattern_type.loc11_16 (constants.%pattern_type.6fd)] -// CHECK:STDOUT: %.loc11_26.2: Core.Form = init_form %T [symbolic = %.loc11_26.2 (constants.%.184)] -// CHECK:STDOUT: %pattern_type.loc11_26: type = pattern_type %T [symbolic = %pattern_type.loc11_26 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %.loc11_24.2: Core.Form = init_form %T [symbolic = %.loc11_24.2 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc11_24: type = pattern_type %T [symbolic = %pattern_type.loc11_24 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc11_16: = require_complete_type %C [symbolic = %require_complete.loc11_16 (constants.%require_complete.895)] -// CHECK:STDOUT: %require_complete.loc11_23: = require_complete_type %T [symbolic = %require_complete.loc11_23 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc11_21: = require_complete_type %T [symbolic = %require_complete.loc11_21 (constants.%require_complete.944)] // CHECK:STDOUT: %Inner.type: type = facet_type <@Inner, @Inner(%T)> [symbolic = %Inner.type (constants.%Inner.type.84b)] -// CHECK:STDOUT: %require_complete.loc11_48: = require_complete_type %Inner.type [symbolic = %require_complete.loc11_48 (constants.%require_complete.fcc)] +// CHECK:STDOUT: %require_complete.loc11_46: = require_complete_type %Inner.type [symbolic = %require_complete.loc11_46 (constants.%require_complete.fcc)] // CHECK:STDOUT: %Inner.assoc_type: type = assoc_entity_type @Inner, @Inner(%T) [symbolic = %Inner.assoc_type (constants.%Inner.assoc_type.b6b)] // CHECK:STDOUT: %assoc0: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b6b) = assoc_entity element0, @Inner.WithSelf.%Inner.WithSelf.F.decl [symbolic = %assoc0 (constants.%assoc0.6dc)] -// CHECK:STDOUT: %.loc11_41.1: require_specific_def_type = require_specific_def @C.as.Inner.impl(%T) [symbolic = %.loc11_41.1 (constants.%.72e)] +// CHECK:STDOUT: %.loc11_39.1: require_specific_def_type = require_specific_def @C.as.Inner.impl(%T) [symbolic = %.loc11_39.1 (constants.%.72e)] // CHECK:STDOUT: %Inner.lookup_impl_witness: = lookup_impl_witness %C, @Inner, @Inner(%T) [symbolic = %Inner.lookup_impl_witness (constants.%Inner.lookup_impl_witness)] // CHECK:STDOUT: %Inner.facet: @C.as.Inner.impl.F.%Inner.type (%Inner.type.84b) = facet_value %C, (%Inner.lookup_impl_witness) [symbolic = %Inner.facet (constants.%Inner.facet.8ef)] // CHECK:STDOUT: %Inner.WithSelf.F.type: type = fn_type @Inner.WithSelf.F, @Inner.WithSelf(%T, %Inner.facet) [symbolic = %Inner.WithSelf.F.type (constants.%Inner.WithSelf.F.type.26a)] -// CHECK:STDOUT: %.loc11_41.2: type = fn_type_with_self_type %Inner.WithSelf.F.type, %Inner.facet [symbolic = %.loc11_41.2 (constants.%.35d)] -// CHECK:STDOUT: %impl.elem0.loc11_41.2: @C.as.Inner.impl.F.%.loc11_41.2 (%.35d) = impl_witness_access %Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_41.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc11_41.2: = specific_impl_function %impl.elem0.loc11_41.2, @Inner.WithSelf.F(%T, %Inner.facet) [symbolic = %specific_impl_fn.loc11_41.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %.loc11_39.2: type = fn_type_with_self_type %Inner.WithSelf.F.type, %Inner.facet [symbolic = %.loc11_39.2 (constants.%.35d)] +// CHECK:STDOUT: %impl.elem0.loc11_39.2: @C.as.Inner.impl.F.%.loc11_39.2 (%.35d) = impl_witness_access %Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_39.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc11_39.2: = specific_impl_function %impl.elem0.loc11_39.2, @Inner.WithSelf.F(%T, %Inner.facet) [symbolic = %specific_impl_fn.loc11_39.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @C.as.Inner.impl.F.%C (%C.7d7)) -> out %return.param: @C.as.Inner.impl.F.%T (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @C.as.Inner.impl.F.%C (%C.7d7) = name_ref self, %self -// CHECK:STDOUT: %.loc11_43: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.type (constants.%Inner.type.84b)] -// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc11_43 [symbolic = %Inner.type (constants.%Inner.type.84b)] -// CHECK:STDOUT: %.loc11_48: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b6b) = specific_constant @Inner.WithSelf.%assoc0.loc6_28.1, @Inner.WithSelf(constants.%T, constants.%Self.656) [symbolic = %assoc0 (constants.%assoc0.6dc)] -// CHECK:STDOUT: %F.ref: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b6b) = name_ref F, %.loc11_48 [symbolic = %assoc0 (constants.%assoc0.6dc)] -// CHECK:STDOUT: %impl.elem0.loc11_41.1: @C.as.Inner.impl.F.%.loc11_41.2 (%.35d) = impl_witness_access constants.%Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_41.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.loc11_41: = bound_method %self.ref, %impl.elem0.loc11_41.1 -// CHECK:STDOUT: %specific_impl_fn.loc11_41.1: = specific_impl_function %impl.elem0.loc11_41.1, @Inner.WithSelf.F(constants.%T, constants.%Inner.facet.8ef) [symbolic = %specific_impl_fn.loc11_41.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: %bound_method.loc11_52: = bound_method %self.ref, %specific_impl_fn.loc11_41.1 -// CHECK:STDOUT: %.loc11_26.1: ref @C.as.Inner.impl.F.%T (%T) = splice_block %return.param {} -// CHECK:STDOUT: %Inner.WithSelf.F.call: init @C.as.Inner.impl.F.%T (%T) to %.loc11_26.1 = call %bound_method.loc11_52(%self.ref) +// CHECK:STDOUT: %.loc11_41: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.type (constants.%Inner.type.84b)] +// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc11_41 [symbolic = %Inner.type (constants.%Inner.type.84b)] +// CHECK:STDOUT: %.loc11_46: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b6b) = specific_constant @Inner.WithSelf.%assoc0.loc6_20.1, @Inner.WithSelf(constants.%T, constants.%Self.656) [symbolic = %assoc0 (constants.%assoc0.6dc)] +// CHECK:STDOUT: %F.ref: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b6b) = name_ref F, %.loc11_46 [symbolic = %assoc0 (constants.%assoc0.6dc)] +// CHECK:STDOUT: %impl.elem0.loc11_39.1: @C.as.Inner.impl.F.%.loc11_39.2 (%.35d) = impl_witness_access constants.%Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_39.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %bound_method.loc11_39: = bound_method %self.ref, %impl.elem0.loc11_39.1 +// CHECK:STDOUT: %specific_impl_fn.loc11_39.1: = specific_impl_function %impl.elem0.loc11_39.1, @Inner.WithSelf.F(constants.%T, constants.%Inner.facet.8ef) [symbolic = %specific_impl_fn.loc11_39.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %bound_method.loc11_50: = bound_method %self.ref, %specific_impl_fn.loc11_39.1 +// CHECK:STDOUT: %.loc11_24.1: ref @C.as.Inner.impl.F.%T (%T) = splice_block %return.param {} +// CHECK:STDOUT: %Inner.WithSelf.F.call: init @C.as.Inner.impl.F.%T (%T) to %.loc11_24.1 = call %bound_method.loc11_50(%self.ref) // CHECK:STDOUT: return %Inner.WithSelf.F.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -800,7 +802,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %Outer.loc24: type = class_type @Outer, @Outer(constants.%i32) [concrete = constants.%Outer.e7c] // CHECK:STDOUT: %.loc24_23: type = specific_constant @Outer.%Inner.decl, @Outer(constants.%i32) [concrete = constants.%Inner.type.5cc] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc24_23 [concrete = constants.%Inner.type.5cc] -// CHECK:STDOUT: %.loc24_29: %Inner.assoc_type.477 = specific_constant @Inner.WithSelf.%assoc0.loc6_28.1, @Inner.WithSelf(constants.%i32, constants.%Self.656) [concrete = constants.%assoc0.7b8] +// CHECK:STDOUT: %.loc24_29: %Inner.assoc_type.477 = specific_constant @Inner.WithSelf.%assoc0.loc6_20.1, @Inner.WithSelf(constants.%i32, constants.%Self.656) [concrete = constants.%assoc0.7b8] // CHECK:STDOUT: %F.ref: %Inner.assoc_type.477 = name_ref F, %.loc24_29 [concrete = constants.%assoc0.7b8] // CHECK:STDOUT: %impl.elem0: %.8da = impl_witness_access constants.%Inner.impl_witness.cdc, element0 [concrete = constants.%C.as.Inner.impl.F.e77] // CHECK:STDOUT: %bound_method.loc24_11: = bound_method %c.ref, %impl.elem0 @@ -843,17 +845,17 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.WithSelf.F.type => constants.%Inner.WithSelf.F.type.792 // CHECK:STDOUT: %Inner.WithSelf.F => constants.%Inner.WithSelf.F.576 // CHECK:STDOUT: %Inner.assoc_type => constants.%Inner.assoc_type.b6b -// CHECK:STDOUT: %assoc0.loc6_28.2 => constants.%assoc0.6dc +// CHECK:STDOUT: %assoc0.loc6_20.2 => constants.%assoc0.6dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner.WithSelf.F(constants.%T, constants.%Self.656) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Inner.type => constants.%Inner.type.84b // CHECK:STDOUT: %Self => constants.%Self.656 -// CHECK:STDOUT: %Self.as_type.loc6_16.1 => constants.%Self.as_type.abe -// CHECK:STDOUT: %pattern_type.loc6_14 => constants.%pattern_type.397 -// CHECK:STDOUT: %.loc6_27.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc6_27 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc6_10.1 => constants.%Self.as_type.abe +// CHECK:STDOUT: %pattern_type.loc6_10 => constants.%pattern_type.397 +// CHECK:STDOUT: %.loc6_19.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%T) { @@ -876,8 +878,8 @@ fn Test() -> i32 { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %C => constants.%C.7d7 // CHECK:STDOUT: %pattern_type.loc11_16 => constants.%pattern_type.6fd -// CHECK:STDOUT: %.loc11_26.2 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc11_26 => constants.%pattern_type.51d +// CHECK:STDOUT: %.loc11_24.2 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc11_24 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner.WithSelf(constants.%T, constants.%Inner.facet.285) { @@ -888,17 +890,17 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.WithSelf.F.type => constants.%Inner.WithSelf.F.type.b47 // CHECK:STDOUT: %Inner.WithSelf.F => constants.%Inner.WithSelf.F.350 // CHECK:STDOUT: %Inner.assoc_type => constants.%Inner.assoc_type.b6b -// CHECK:STDOUT: %assoc0.loc6_28.2 => constants.%assoc0.6dc +// CHECK:STDOUT: %assoc0.loc6_20.2 => constants.%assoc0.6dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner.WithSelf.F(constants.%T, constants.%Inner.facet.285) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Inner.type => constants.%Inner.type.84b // CHECK:STDOUT: %Self => constants.%Inner.facet.285 -// CHECK:STDOUT: %Self.as_type.loc6_16.1 => constants.%C.7d7 -// CHECK:STDOUT: %pattern_type.loc6_14 => constants.%pattern_type.6fd -// CHECK:STDOUT: %.loc6_27.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc6_27 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc6_10.1 => constants.%C.7d7 +// CHECK:STDOUT: %pattern_type.loc6_10 => constants.%pattern_type.6fd +// CHECK:STDOUT: %.loc6_19.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner.WithSelf(constants.%T, constants.%Inner.facet.8ef) { @@ -909,17 +911,17 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.WithSelf.F.type => constants.%Inner.WithSelf.F.type.26a // CHECK:STDOUT: %Inner.WithSelf.F => constants.%Inner.WithSelf.F.3e0 // CHECK:STDOUT: %Inner.assoc_type => constants.%Inner.assoc_type.b6b -// CHECK:STDOUT: %assoc0.loc6_28.2 => constants.%assoc0.6dc +// CHECK:STDOUT: %assoc0.loc6_20.2 => constants.%assoc0.6dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner.WithSelf.F(constants.%T, constants.%Inner.facet.8ef) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Inner.type => constants.%Inner.type.84b // CHECK:STDOUT: %Self => constants.%Inner.facet.8ef -// CHECK:STDOUT: %Self.as_type.loc6_16.1 => constants.%C.7d7 -// CHECK:STDOUT: %pattern_type.loc6_14 => constants.%pattern_type.6fd -// CHECK:STDOUT: %.loc6_27.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc6_27 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc6_10.1 => constants.%C.7d7 +// CHECK:STDOUT: %pattern_type.loc6_10 => constants.%pattern_type.6fd +// CHECK:STDOUT: %.loc6_19.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Outer(constants.%i32) { @@ -949,7 +951,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.WithSelf.F.type => constants.%Inner.WithSelf.F.type.62d // CHECK:STDOUT: %Inner.WithSelf.F => constants.%Inner.WithSelf.F.389 // CHECK:STDOUT: %Inner.assoc_type => constants.%Inner.assoc_type.477 -// CHECK:STDOUT: %assoc0.loc6_28.2 => constants.%assoc0.7b8 +// CHECK:STDOUT: %assoc0.loc6_20.2 => constants.%assoc0.7b8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner.WithSelf(constants.%i32, constants.%Inner.facet.45b) { @@ -960,17 +962,17 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.WithSelf.F.type => constants.%Inner.WithSelf.F.type.576 // CHECK:STDOUT: %Inner.WithSelf.F => constants.%Inner.WithSelf.F.adb // CHECK:STDOUT: %Inner.assoc_type => constants.%Inner.assoc_type.477 -// CHECK:STDOUT: %assoc0.loc6_28.2 => constants.%assoc0.7b8 +// CHECK:STDOUT: %assoc0.loc6_20.2 => constants.%assoc0.7b8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner.WithSelf.F(constants.%i32, constants.%Inner.facet.45b) { // CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.5cc // CHECK:STDOUT: %Self => constants.%Inner.facet.45b -// CHECK:STDOUT: %Self.as_type.loc6_16.1 => constants.%D -// CHECK:STDOUT: %pattern_type.loc6_14 => constants.%pattern_type.d8d -// CHECK:STDOUT: %.loc6_27.1 => constants.%.795 -// CHECK:STDOUT: %pattern_type.loc6_27 => constants.%pattern_type.6b6 +// CHECK:STDOUT: %Self.as_type.loc6_10.1 => constants.%D +// CHECK:STDOUT: %pattern_type.loc6_10 => constants.%pattern_type.d8d +// CHECK:STDOUT: %.loc6_19.1 => constants.%.795 +// CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.6b6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.Inner.impl(constants.%i32) { @@ -993,39 +995,39 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.WithSelf.F.type => constants.%Inner.WithSelf.F.type.a78 // CHECK:STDOUT: %Inner.WithSelf.F => constants.%Inner.WithSelf.F.e60 // CHECK:STDOUT: %Inner.assoc_type => constants.%Inner.assoc_type.477 -// CHECK:STDOUT: %assoc0.loc6_28.2 => constants.%assoc0.7b8 +// CHECK:STDOUT: %assoc0.loc6_20.2 => constants.%assoc0.7b8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.Inner.impl.F(constants.%i32) { // CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %C => constants.%C.b7f // CHECK:STDOUT: %pattern_type.loc11_16 => constants.%pattern_type.9d0 -// CHECK:STDOUT: %.loc11_26.2 => constants.%.795 -// CHECK:STDOUT: %pattern_type.loc11_26 => constants.%pattern_type.6b6 +// CHECK:STDOUT: %.loc11_24.2 => constants.%.795 +// CHECK:STDOUT: %pattern_type.loc11_24 => constants.%pattern_type.6b6 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc11_16 => constants.%complete_type.357 -// CHECK:STDOUT: %require_complete.loc11_23 => constants.%complete_type.f8a +// CHECK:STDOUT: %require_complete.loc11_21 => constants.%complete_type.f8a // CHECK:STDOUT: %Inner.type => constants.%Inner.type.5cc -// CHECK:STDOUT: %require_complete.loc11_48 => constants.%complete_type.11e +// CHECK:STDOUT: %require_complete.loc11_46 => constants.%complete_type.11e // CHECK:STDOUT: %Inner.assoc_type => constants.%Inner.assoc_type.477 // CHECK:STDOUT: %assoc0 => constants.%assoc0.7b8 -// CHECK:STDOUT: %.loc11_41.1 => constants.%.fff +// CHECK:STDOUT: %.loc11_39.1 => constants.%.fff // CHECK:STDOUT: %Inner.lookup_impl_witness => constants.%Inner.impl_witness.cdc // CHECK:STDOUT: %Inner.facet => constants.%Inner.facet.39b // CHECK:STDOUT: %Inner.WithSelf.F.type => constants.%Inner.WithSelf.F.type.a78 -// CHECK:STDOUT: %.loc11_41.2 => constants.%.8da -// CHECK:STDOUT: %impl.elem0.loc11_41.2 => constants.%C.as.Inner.impl.F.e77 -// CHECK:STDOUT: %specific_impl_fn.loc11_41.2 => constants.%C.as.Inner.impl.F.specific_fn +// CHECK:STDOUT: %.loc11_39.2 => constants.%.8da +// CHECK:STDOUT: %impl.elem0.loc11_39.2 => constants.%C.as.Inner.impl.F.e77 +// CHECK:STDOUT: %specific_impl_fn.loc11_39.2 => constants.%C.as.Inner.impl.F.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Inner.WithSelf.F(constants.%i32, constants.%Inner.facet.39b) { // CHECK:STDOUT: %T => constants.%i32 // CHECK:STDOUT: %Inner.type => constants.%Inner.type.5cc // CHECK:STDOUT: %Self => constants.%Inner.facet.39b -// CHECK:STDOUT: %Self.as_type.loc6_16.1 => constants.%C.b7f -// CHECK:STDOUT: %pattern_type.loc6_14 => constants.%pattern_type.9d0 -// CHECK:STDOUT: %.loc6_27.1 => constants.%.795 -// CHECK:STDOUT: %pattern_type.loc6_27 => constants.%pattern_type.6b6 +// CHECK:STDOUT: %Self.as_type.loc6_10.1 => constants.%C.b7f +// CHECK:STDOUT: %pattern_type.loc6_10 => constants.%pattern_type.9d0 +// CHECK:STDOUT: %.loc6_19.1 => constants.%.795 +// CHECK:STDOUT: %pattern_type.loc6_19 => constants.%pattern_type.6b6 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index 706a8e9ff703..dd634452a652 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -18,6 +18,7 @@ class B {} class Class(T:! type) { fn Get(U:! type) -> (T, U) { return Get(U); } fn GetNoDeduce(x: T, U:! type) -> (T, U) { return GetNoDeduce(x, U); } + fn F[U:! type](self: Class(U)) -> U { return self.F(); } } fn CallGenericMethod(c: Class(A)) -> (A, B) { @@ -28,6 +29,11 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { return c.GetNoDeduce({}, B); } +fn CallMethodSelfDeduce(c: Class(A)) -> A { + return c.F(); +} + + // CHECK:STDOUT: --- method_deduce.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -54,10 +60,24 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic] // CHECK:STDOUT: %Class.GetNoDeduce.type.83e: type = fn_type @Class.GetNoDeduce, @Class(%T) [symbolic] // CHECK:STDOUT: %Class.GetNoDeduce.a04: %Class.GetNoDeduce.type.83e = struct_value () [symbolic] +// CHECK:STDOUT: %Class.d74: type = class_type @Class, @Class(%U) [symbolic] +// CHECK:STDOUT: %pattern_type.cc0: type = pattern_type %Class.d74 [symbolic] +// CHECK:STDOUT: %.822: Core.Form = init_form %U [symbolic] +// CHECK:STDOUT: %pattern_type.946: type = pattern_type %U [symbolic] +// CHECK:STDOUT: %Class.F.type.982: type = fn_type @Class.F, @Class(%T) [symbolic] +// CHECK:STDOUT: %Class.F.c63: %Class.F.type.982 = struct_value () [symbolic] // CHECK:STDOUT: %require_complete.220: = require_complete_type %tuple.type.a5e [symbolic] // CHECK:STDOUT: %Class.Get.specific_fn.ba5: = specific_function %Class.Get.ceb, @Class.Get(%T, %U) [symbolic] // CHECK:STDOUT: %require_complete.944: = require_complete_type %T [symbolic] // CHECK:STDOUT: %Class.GetNoDeduce.specific_fn.def: = specific_function %Class.GetNoDeduce.a04, @Class.GetNoDeduce(%T, %U) [symbolic] +// CHECK:STDOUT: %Class.Get.type.3dc: type = fn_type @Class.Get, @Class(%U) [symbolic] +// CHECK:STDOUT: %Class.Get.d1f: %Class.Get.type.3dc = struct_value () [symbolic] +// CHECK:STDOUT: %Class.GetNoDeduce.type.2cf: type = fn_type @Class.GetNoDeduce, @Class(%U) [symbolic] +// CHECK:STDOUT: %Class.GetNoDeduce.0cf: %Class.GetNoDeduce.type.2cf = struct_value () [symbolic] +// CHECK:STDOUT: %Class.F.type.6df: type = fn_type @Class.F, @Class(%U) [symbolic] +// CHECK:STDOUT: %Class.F.c29: %Class.F.type.6df = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete.716: = require_complete_type %Class.d74 [symbolic] +// CHECK:STDOUT: %Class.F.specific_fn.844: = specific_function %Class.F.c29, @Class.F(%U, %U) [symbolic] // CHECK:STDOUT: %Class.30a: type = class_type @Class, @Class(%A) [concrete] // CHECK:STDOUT: %pattern_type.89e: type = pattern_type %Class.30a [concrete] // CHECK:STDOUT: %tuple.9aa: %tuple.type.24b = tuple_value (%A, %B) [concrete] @@ -70,6 +90,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %Class.Get.e47: %Class.Get.type.9a5 = struct_value () [concrete] // CHECK:STDOUT: %Class.GetNoDeduce.type.7e9: type = fn_type @Class.GetNoDeduce, @Class(%A) [concrete] // CHECK:STDOUT: %Class.GetNoDeduce.c1e: %Class.GetNoDeduce.type.7e9 = struct_value () [concrete] +// CHECK:STDOUT: %Class.F.type.e68: type = fn_type @Class.F, @Class(%A) [concrete] +// CHECK:STDOUT: %Class.F.805: %Class.F.type.e68 = struct_value () [concrete] // CHECK:STDOUT: %Class.Get.specific_fn.0ec: = specific_function %Class.Get.e47, @Class.Get(%A, %B) [concrete] // CHECK:STDOUT: %CallGenericMethodWithNonDeducedParam.type: type = fn_type @CallGenericMethodWithNonDeducedParam [concrete] // CHECK:STDOUT: %CallGenericMethodWithNonDeducedParam: %CallGenericMethodWithNonDeducedParam.type = struct_value () [concrete] @@ -79,9 +101,13 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %A.val: %A = struct_value () [concrete] // CHECK:STDOUT: %.367: ref %A = temporary invalid, %A.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc28_25.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc29_25.2 [concrete] // CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.367, %Destroy.Op.1a2547.2 [concrete] +// CHECK:STDOUT: %.cbf: Core.Form = init_form %A [concrete] +// CHECK:STDOUT: %CallMethodSelfDeduce.type: type = fn_type @CallMethodSelfDeduce [concrete] +// CHECK:STDOUT: %CallMethodSelfDeduce: %CallMethodSelfDeduce.type = struct_value () [concrete] +// CHECK:STDOUT: %Class.F.specific_fn.0bd: = specific_function %Class.F.805, @Class.F(%A, %A) [concrete] // CHECK:STDOUT: %complete_type.c44: = complete_type_witness %tuple.type.1e7 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -102,6 +128,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .CallGenericMethod = %CallGenericMethod.decl // CHECK:STDOUT: .CallGenericMethodWithNonDeducedParam = %CallGenericMethodWithNonDeducedParam.decl +// CHECK:STDOUT: .CallMethodSelfDeduce = %CallMethodSelfDeduce.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {} @@ -119,17 +146,17 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %c.param_patt: %pattern_type.89e = value_param_pattern [concrete] // CHECK:STDOUT: %c.patt: %pattern_type.89e = at_binding_pattern c, %c.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7c6 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.7c6 = return_slot_pattern %return.param_patt, %.loc23_43.3 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.7c6 = return_slot_pattern %return.param_patt, %.loc24_43.3 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref.loc23_39: type = name_ref A, file.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %B.ref.loc23: type = name_ref B, file.%B.decl [concrete = constants.%B] -// CHECK:STDOUT: %.loc23_43.2: %tuple.type.24b = tuple_literal (%A.ref.loc23_39, %B.ref.loc23) [concrete = constants.%tuple.9aa] -// CHECK:STDOUT: %.loc23_43.3: type = converted %.loc23_43.2, constants.%tuple.type.1e7 [concrete = constants.%tuple.type.1e7] -// CHECK:STDOUT: %.loc23_43.4: Core.Form = init_form %.loc23_43.3 [concrete = constants.%.7f5] +// CHECK:STDOUT: %A.ref.loc24_39: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %B.ref.loc24: type = name_ref B, file.%B.decl [concrete = constants.%B] +// CHECK:STDOUT: %.loc24_43.2: %tuple.type.24b = tuple_literal (%A.ref.loc24_39, %B.ref.loc24) [concrete = constants.%tuple.9aa] +// CHECK:STDOUT: %.loc24_43.3: type = converted %.loc24_43.2, constants.%tuple.type.1e7 [concrete = constants.%tuple.type.1e7] +// CHECK:STDOUT: %.loc24_43.4: Core.Form = init_form %.loc24_43.3 [concrete = constants.%.7f5] // CHECK:STDOUT: %c.param: %Class.30a = value_param call_param0 -// CHECK:STDOUT: %.loc23_32: type = splice_block %Class [concrete = constants.%Class.30a] { +// CHECK:STDOUT: %.loc24_32: type = splice_block %Class [concrete = constants.%Class.30a] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] -// CHECK:STDOUT: %A.ref.loc23_31: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %A.ref.loc24_31: type = name_ref A, file.%A.decl [concrete = constants.%A] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [concrete = constants.%Class.30a] // CHECK:STDOUT: } // CHECK:STDOUT: %c: %Class.30a = value_binding c, %c.param @@ -140,23 +167,41 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %c.param_patt: %pattern_type.89e = value_param_pattern [concrete] // CHECK:STDOUT: %c.patt: %pattern_type.89e = at_binding_pattern c, %c.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.7c6 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.7c6 = return_slot_pattern %return.param_patt, %.loc27_62.3 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.7c6 = return_slot_pattern %return.param_patt, %.loc28_62.3 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref.loc27_58: type = name_ref A, file.%A.decl [concrete = constants.%A] -// CHECK:STDOUT: %B.ref.loc27: type = name_ref B, file.%B.decl [concrete = constants.%B] -// CHECK:STDOUT: %.loc27_62.2: %tuple.type.24b = tuple_literal (%A.ref.loc27_58, %B.ref.loc27) [concrete = constants.%tuple.9aa] -// CHECK:STDOUT: %.loc27_62.3: type = converted %.loc27_62.2, constants.%tuple.type.1e7 [concrete = constants.%tuple.type.1e7] -// CHECK:STDOUT: %.loc27_62.4: Core.Form = init_form %.loc27_62.3 [concrete = constants.%.7f5] +// CHECK:STDOUT: %A.ref.loc28_58: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %B.ref.loc28: type = name_ref B, file.%B.decl [concrete = constants.%B] +// CHECK:STDOUT: %.loc28_62.2: %tuple.type.24b = tuple_literal (%A.ref.loc28_58, %B.ref.loc28) [concrete = constants.%tuple.9aa] +// CHECK:STDOUT: %.loc28_62.3: type = converted %.loc28_62.2, constants.%tuple.type.1e7 [concrete = constants.%tuple.type.1e7] +// CHECK:STDOUT: %.loc28_62.4: Core.Form = init_form %.loc28_62.3 [concrete = constants.%.7f5] // CHECK:STDOUT: %c.param: %Class.30a = value_param call_param0 -// CHECK:STDOUT: %.loc27_51: type = splice_block %Class [concrete = constants.%Class.30a] { +// CHECK:STDOUT: %.loc28_51: type = splice_block %Class [concrete = constants.%Class.30a] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] -// CHECK:STDOUT: %A.ref.loc27_50: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %A.ref.loc28_50: type = name_ref A, file.%A.decl [concrete = constants.%A] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [concrete = constants.%Class.30a] // CHECK:STDOUT: } // CHECK:STDOUT: %c: %Class.30a = value_binding c, %c.param // CHECK:STDOUT: %return.param: ref %tuple.type.1e7 = out_param call_param1 // CHECK:STDOUT: %return: ref %tuple.type.1e7 = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %CallMethodSelfDeduce.decl: %CallMethodSelfDeduce.type = fn_decl @CallMethodSelfDeduce [concrete = constants.%CallMethodSelfDeduce] { +// CHECK:STDOUT: %c.param_patt: %pattern_type.89e = value_param_pattern [concrete] +// CHECK:STDOUT: %c.patt: %pattern_type.89e = at_binding_pattern c, %c.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.9ef = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.9ef = return_slot_pattern %return.param_patt, %A.ref.loc32_41 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %A.ref.loc32_41: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %.loc32_41.2: Core.Form = init_form %A.ref.loc32_41 [concrete = constants.%.cbf] +// CHECK:STDOUT: %c.param: %Class.30a = value_param call_param0 +// CHECK:STDOUT: %.loc32_35: type = splice_block %Class [concrete = constants.%Class.30a] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] +// CHECK:STDOUT: %A.ref.loc32_34: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%A) [concrete = constants.%Class.30a] +// CHECK:STDOUT: } +// CHECK:STDOUT: %c: %Class.30a = value_binding c, %c.param +// CHECK:STDOUT: %return.param: ref %A = out_param call_param1 +// CHECK:STDOUT: %return: ref %A = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -183,6 +228,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %Class.Get: @Class.%Class.Get.type (%Class.Get.type.49d) = struct_value () [symbolic = %Class.Get (constants.%Class.Get.ceb)] // CHECK:STDOUT: %Class.GetNoDeduce.type: type = fn_type @Class.GetNoDeduce, @Class(%T.loc18_14.1) [symbolic = %Class.GetNoDeduce.type (constants.%Class.GetNoDeduce.type.83e)] // CHECK:STDOUT: %Class.GetNoDeduce: @Class.%Class.GetNoDeduce.type (%Class.GetNoDeduce.type.83e) = struct_value () [symbolic = %Class.GetNoDeduce (constants.%Class.GetNoDeduce.a04)] +// CHECK:STDOUT: %Class.F.type: type = fn_type @Class.F, @Class(%T.loc18_14.1) [symbolic = %Class.F.type (constants.%Class.F.type.982)] +// CHECK:STDOUT: %Class.F: @Class.%Class.F.type (%Class.F.type.982) = struct_value () [symbolic = %Class.F (constants.%Class.F.c63)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %Class.Get.decl: @Class.%Class.Get.type (%Class.Get.type.49d) = fn_decl @Class.Get [symbolic = @Class.%Class.Get (constants.%Class.Get.ceb)] { @@ -226,6 +273,30 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %return.param: ref @Class.GetNoDeduce.%tuple.type (%tuple.type.a5e) = out_param call_param1 // CHECK:STDOUT: %return: ref @Class.GetNoDeduce.%tuple.type (%tuple.type.a5e) = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Class.F.decl: @Class.%Class.F.type (%Class.F.type.982) = fn_decl @Class.F [symbolic = @Class.%Class.F (constants.%Class.F.c63)] { +// CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 1 [concrete] +// CHECK:STDOUT: %self.param_patt: @Class.F.%pattern_type.loc21_22 (%pattern_type.cc0) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Class.F.%pattern_type.loc21_22 (%pattern_type.cc0) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @Class.F.%pattern_type.loc21_37 (%pattern_type.946) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @Class.F.%pattern_type.loc21_37 (%pattern_type.946) = return_slot_pattern %return.param_patt, %U.ref.loc21_37 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %U.ref.loc21_37: type = name_ref U, %U.loc21_9.2 [symbolic = %U.loc21_9.1 (constants.%U)] +// CHECK:STDOUT: %.loc21_37.3: Core.Form = init_form %U.ref.loc21_37 [symbolic = %.loc21_37.2 (constants.%.822)] +// CHECK:STDOUT: %.loc21_12.1: type = splice_block %.loc21_12.2 [concrete = type] { +// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.loc21_12.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %U.loc21_9.2: type = symbolic_binding U, 1 [symbolic = %U.loc21_9.1 (constants.%U)] +// CHECK:STDOUT: %self.param: @Class.F.%Class.loc21_31.1 (%Class.d74) = value_param call_param0 +// CHECK:STDOUT: %.loc21_31: type = splice_block %Class.loc21_31.2 [symbolic = %Class.loc21_31.1 (constants.%Class.d74)] { +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] +// CHECK:STDOUT: %U.ref.loc21_30: type = name_ref U, %U.loc21_9.2 [symbolic = %U.loc21_9.1 (constants.%U)] +// CHECK:STDOUT: %Class.loc21_31.2: type = class_type @Class, @Class(constants.%U) [symbolic = %Class.loc21_31.1 (constants.%Class.d74)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Class.F.%Class.loc21_31.1 (%Class.d74) = value_binding self, %self.param +// CHECK:STDOUT: %return.param: ref @Class.F.%U.loc21_9.1 (%U) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Class.F.%U.loc21_9.1 (%U) = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -234,6 +305,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: .T = // CHECK:STDOUT: .Get = %Class.Get.decl // CHECK:STDOUT: .GetNoDeduce = %Class.GetNoDeduce.decl +// CHECK:STDOUT: .Class = +// CHECK:STDOUT: .F = %Class.F.decl // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -291,44 +364,84 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Class.F(@Class.%T.loc18_14.2: type, %U.loc21_9.2: type) { +// CHECK:STDOUT: %U.loc21_9.1: type = symbolic_binding U, 1 [symbolic = %U.loc21_9.1 (constants.%U)] +// CHECK:STDOUT: %Class.loc21_31.1: type = class_type @Class, @Class(%U.loc21_9.1) [symbolic = %Class.loc21_31.1 (constants.%Class.d74)] +// CHECK:STDOUT: %pattern_type.loc21_22: type = pattern_type %Class.loc21_31.1 [symbolic = %pattern_type.loc21_22 (constants.%pattern_type.cc0)] +// CHECK:STDOUT: %.loc21_37.2: Core.Form = init_form %U.loc21_9.1 [symbolic = %.loc21_37.2 (constants.%.822)] +// CHECK:STDOUT: %pattern_type.loc21_37: type = pattern_type %U.loc21_9.1 [symbolic = %pattern_type.loc21_37 (constants.%pattern_type.946)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete: = require_complete_type %Class.loc21_31.1 [symbolic = %require_complete (constants.%require_complete.716)] +// CHECK:STDOUT: %Class.F.type: type = fn_type @Class.F, @Class(%U.loc21_9.1) [symbolic = %Class.F.type (constants.%Class.F.type.6df)] +// CHECK:STDOUT: %Class.F: @Class.F.%Class.F.type (%Class.F.type.6df) = struct_value () [symbolic = %Class.F (constants.%Class.F.c29)] +// CHECK:STDOUT: %Class.F.specific_fn.loc21_52.2: = specific_function %Class.F, @Class.F(%U.loc21_9.1, %U.loc21_9.1) [symbolic = %Class.F.specific_fn.loc21_52.2 (constants.%Class.F.specific_fn.844)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%self.param: @Class.F.%Class.loc21_31.1 (%Class.d74)) -> out %return.param: @Class.F.%U.loc21_9.1 (%U) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %self.ref: @Class.F.%Class.loc21_31.1 (%Class.d74) = name_ref self, %self +// CHECK:STDOUT: %.loc21_52: @Class.F.%Class.F.type (%Class.F.type.6df) = specific_constant @Class.%Class.F.decl, @Class(constants.%U) [symbolic = %Class.F (constants.%Class.F.c29)] +// CHECK:STDOUT: %F.ref: @Class.F.%Class.F.type (%Class.F.type.6df) = name_ref F, %.loc21_52 [symbolic = %Class.F (constants.%Class.F.c29)] +// CHECK:STDOUT: %Class.F.bound: = bound_method %self.ref, %F.ref +// CHECK:STDOUT: %Class.F.specific_fn.loc21_52.1: = specific_function %F.ref, @Class.F(constants.%U, constants.%U) [symbolic = %Class.F.specific_fn.loc21_52.2 (constants.%Class.F.specific_fn.844)] +// CHECK:STDOUT: %bound_method: = bound_method %self.ref, %Class.F.specific_fn.loc21_52.1 +// CHECK:STDOUT: %.loc21_37.1: ref @Class.F.%U.loc21_9.1 (%U) = splice_block %return.param {} +// CHECK:STDOUT: %Class.F.call: init @Class.F.%U.loc21_9.1 (%U) to %.loc21_37.1 = call %bound_method(%self.ref) +// CHECK:STDOUT: return %Class.F.call to %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CallGenericMethod(%c.param: %Class.30a) -> out %return.param: %tuple.type.1e7 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.30a = name_ref c, %c -// CHECK:STDOUT: %.loc24: %Class.Get.type.9a5 = specific_constant @Class.%Class.Get.decl, @Class(constants.%A) [concrete = constants.%Class.Get.e47] -// CHECK:STDOUT: %Get.ref: %Class.Get.type.9a5 = name_ref Get, %.loc24 [concrete = constants.%Class.Get.e47] -// CHECK:STDOUT: %B.ref.loc24: type = name_ref B, file.%B.decl [concrete = constants.%B] +// CHECK:STDOUT: %.loc25: %Class.Get.type.9a5 = specific_constant @Class.%Class.Get.decl, @Class(constants.%A) [concrete = constants.%Class.Get.e47] +// CHECK:STDOUT: %Get.ref: %Class.Get.type.9a5 = name_ref Get, %.loc25 [concrete = constants.%Class.Get.e47] +// CHECK:STDOUT: %B.ref.loc25: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %Class.Get.specific_fn: = specific_function %Get.ref, @Class.Get(constants.%A, constants.%B) [concrete = constants.%Class.Get.specific_fn.0ec] -// CHECK:STDOUT: %.loc23_43.1: ref %tuple.type.1e7 = splice_block %return.param {} -// CHECK:STDOUT: %Class.Get.call: init %tuple.type.1e7 to %.loc23_43.1 = call %Class.Get.specific_fn() +// CHECK:STDOUT: %.loc24_43.1: ref %tuple.type.1e7 = splice_block %return.param {} +// CHECK:STDOUT: %Class.Get.call: init %tuple.type.1e7 to %.loc24_43.1 = call %Class.Get.specific_fn() // CHECK:STDOUT: return %Class.Get.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallGenericMethodWithNonDeducedParam(%c.param: %Class.30a) -> out %return.param: %tuple.type.1e7 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.30a = name_ref c, %c -// CHECK:STDOUT: %.loc28_11: %Class.GetNoDeduce.type.7e9 = specific_constant @Class.%Class.GetNoDeduce.decl, @Class(constants.%A) [concrete = constants.%Class.GetNoDeduce.c1e] -// CHECK:STDOUT: %GetNoDeduce.ref: %Class.GetNoDeduce.type.7e9 = name_ref GetNoDeduce, %.loc28_11 [concrete = constants.%Class.GetNoDeduce.c1e] -// CHECK:STDOUT: %.loc28_25.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %B.ref.loc28: type = name_ref B, file.%B.decl [concrete = constants.%B] +// CHECK:STDOUT: %.loc29_11: %Class.GetNoDeduce.type.7e9 = specific_constant @Class.%Class.GetNoDeduce.decl, @Class(constants.%A) [concrete = constants.%Class.GetNoDeduce.c1e] +// CHECK:STDOUT: %GetNoDeduce.ref: %Class.GetNoDeduce.type.7e9 = name_ref GetNoDeduce, %.loc29_11 [concrete = constants.%Class.GetNoDeduce.c1e] +// CHECK:STDOUT: %.loc29_25.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %B.ref.loc29: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %Class.GetNoDeduce.specific_fn: = specific_function %GetNoDeduce.ref, @Class.GetNoDeduce(constants.%A, constants.%B) [concrete = constants.%Class.GetNoDeduce.specific_fn.931] -// CHECK:STDOUT: %.loc27_62.1: ref %tuple.type.1e7 = splice_block %return.param {} -// CHECK:STDOUT: %.loc28_25.2: ref %A = temporary_storage -// CHECK:STDOUT: %.loc28_25.3: init %A to %.loc28_25.2 = class_init () [concrete = constants.%A.val] -// CHECK:STDOUT: %.loc28_25.4: init %A = converted %.loc28_25.1, %.loc28_25.3 [concrete = constants.%A.val] -// CHECK:STDOUT: %.loc28_25.5: ref %A = temporary %.loc28_25.2, %.loc28_25.4 [concrete = constants.%.367] -// CHECK:STDOUT: %.loc28_25.6: %A = acquire_value %.loc28_25.5 [concrete = constants.%A.val] -// CHECK:STDOUT: %Class.GetNoDeduce.call: init %tuple.type.1e7 to %.loc27_62.1 = call %Class.GetNoDeduce.specific_fn(%.loc28_25.6) +// CHECK:STDOUT: %.loc28_62.1: ref %tuple.type.1e7 = splice_block %return.param {} +// CHECK:STDOUT: %.loc29_25.2: ref %A = temporary_storage +// CHECK:STDOUT: %.loc29_25.3: init %A to %.loc29_25.2 = class_init () [concrete = constants.%A.val] +// CHECK:STDOUT: %.loc29_25.4: init %A = converted %.loc29_25.1, %.loc29_25.3 [concrete = constants.%A.val] +// CHECK:STDOUT: %.loc29_25.5: ref %A = temporary %.loc29_25.2, %.loc29_25.4 [concrete = constants.%.367] +// CHECK:STDOUT: %.loc29_25.6: %A = acquire_value %.loc29_25.5 [concrete = constants.%A.val] +// CHECK:STDOUT: %Class.GetNoDeduce.call: init %tuple.type.1e7 to %.loc28_62.1 = call %Class.GetNoDeduce.specific_fn(%.loc29_25.6) // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.367) // CHECK:STDOUT: return %Class.GetNoDeduce.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc28_25.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc29_25.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc28_25.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.Op.loc29_25.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @CallMethodSelfDeduce(%c.param: %Class.30a) -> out %return.param: %A { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %c.ref: %Class.30a = name_ref c, %c +// CHECK:STDOUT: %.loc33: %Class.F.type.e68 = specific_constant @Class.%Class.F.decl, @Class(constants.%A) [concrete = constants.%Class.F.805] +// CHECK:STDOUT: %F.ref: %Class.F.type.e68 = name_ref F, %.loc33 [concrete = constants.%Class.F.805] +// CHECK:STDOUT: %Class.F.bound: = bound_method %c.ref, %F.ref +// CHECK:STDOUT: %Class.F.specific_fn: = specific_function %F.ref, @Class.F(constants.%A, constants.%A) [concrete = constants.%Class.F.specific_fn.0bd] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %Class.F.specific_fn +// CHECK:STDOUT: %.loc32_41.1: ref %A = splice_block %return.param {} +// CHECK:STDOUT: %Class.F.call: init %A to %.loc32_41.1 = call %bound_method(%c.ref) +// CHECK:STDOUT: return %Class.F.call to %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.loc18_14.1 => constants.%T // CHECK:STDOUT: @@ -337,6 +450,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %Class.Get => constants.%Class.Get.ceb // CHECK:STDOUT: %Class.GetNoDeduce.type => constants.%Class.GetNoDeduce.type.83e // CHECK:STDOUT: %Class.GetNoDeduce => constants.%Class.GetNoDeduce.a04 +// CHECK:STDOUT: %Class.F.type => constants.%Class.F.type.982 +// CHECK:STDOUT: %Class.F => constants.%Class.F.c63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class.Get(constants.%T, constants.%U) { @@ -370,6 +485,40 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %Class.GetNoDeduce.specific_fn.loc20_53.2 => constants.%Class.GetNoDeduce.specific_fn.def // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class(constants.%U) { +// CHECK:STDOUT: %T.loc18_14.1 => constants.%U +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Class.Get.type => constants.%Class.Get.type.3dc +// CHECK:STDOUT: %Class.Get => constants.%Class.Get.d1f +// CHECK:STDOUT: %Class.GetNoDeduce.type => constants.%Class.GetNoDeduce.type.2cf +// CHECK:STDOUT: %Class.GetNoDeduce => constants.%Class.GetNoDeduce.0cf +// CHECK:STDOUT: %Class.F.type => constants.%Class.F.type.6df +// CHECK:STDOUT: %Class.F => constants.%Class.F.c29 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Class.F(constants.%T, constants.%U) { +// CHECK:STDOUT: %U.loc21_9.1 => constants.%U +// CHECK:STDOUT: %Class.loc21_31.1 => constants.%Class.d74 +// CHECK:STDOUT: %pattern_type.loc21_22 => constants.%pattern_type.cc0 +// CHECK:STDOUT: %.loc21_37.2 => constants.%.822 +// CHECK:STDOUT: %pattern_type.loc21_37 => constants.%pattern_type.946 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Class.F(constants.%U, constants.%U) { +// CHECK:STDOUT: %U.loc21_9.1 => constants.%U +// CHECK:STDOUT: %Class.loc21_31.1 => constants.%Class.d74 +// CHECK:STDOUT: %pattern_type.loc21_22 => constants.%pattern_type.cc0 +// CHECK:STDOUT: %.loc21_37.2 => constants.%.822 +// CHECK:STDOUT: %pattern_type.loc21_37 => constants.%pattern_type.946 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%require_complete.716 +// CHECK:STDOUT: %Class.F.type => constants.%Class.F.type.6df +// CHECK:STDOUT: %Class.F => constants.%Class.F.c29 +// CHECK:STDOUT: %Class.F.specific_fn.loc21_52.2 => constants.%Class.F.specific_fn.844 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%A) { // CHECK:STDOUT: %T.loc18_14.1 => constants.%A // CHECK:STDOUT: @@ -378,6 +527,8 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %Class.Get => constants.%Class.Get.e47 // CHECK:STDOUT: %Class.GetNoDeduce.type => constants.%Class.GetNoDeduce.type.7e9 // CHECK:STDOUT: %Class.GetNoDeduce => constants.%Class.GetNoDeduce.c1e +// CHECK:STDOUT: %Class.F.type => constants.%Class.F.type.e68 +// CHECK:STDOUT: %Class.F => constants.%Class.F.805 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class.Get(constants.%A, constants.%B) { @@ -411,3 +562,17 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %Class.GetNoDeduce.specific_fn.loc20_53.2 => constants.%Class.GetNoDeduce.specific_fn.931 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @Class.F(constants.%A, constants.%A) { +// CHECK:STDOUT: %U.loc21_9.1 => constants.%A +// CHECK:STDOUT: %Class.loc21_31.1 => constants.%Class.30a +// CHECK:STDOUT: %pattern_type.loc21_22 => constants.%pattern_type.89e +// CHECK:STDOUT: %.loc21_37.2 => constants.%.cbf +// CHECK:STDOUT: %pattern_type.loc21_37 => constants.%pattern_type.9ef +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete => constants.%complete_type.357 +// CHECK:STDOUT: %Class.F.type => constants.%Class.F.type.e68 +// CHECK:STDOUT: %Class.F => constants.%Class.F.805 +// CHECK:STDOUT: %Class.F.specific_fn.loc21_52.2 => constants.%Class.F.specific_fn.0bd +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index 3e46c94b6221..4b6e9607be80 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -23,6 +23,7 @@ class Class(T:! type) { } } + // CHECK:STDOUT: --- self.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -182,11 +183,11 @@ class Class(T:! type) { // CHECK:STDOUT: %Class.MakeClass: @Class.F.%Class.MakeClass.type (%Class.MakeClass.type) = struct_value () [symbolic = %Class.MakeClass (constants.%Class.MakeClass)] // CHECK:STDOUT: %Class.MakeClass.specific_fn.loc22_26.2: = specific_function %Class.MakeClass, @Class.MakeClass(%T) [symbolic = %Class.MakeClass.specific_fn.loc22_26.2 (constants.%Class.MakeClass.specific_fn)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Class.loc21_26.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Class.loc21_26.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.86d)] -// 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.297)] -// CHECK:STDOUT: %.loc22_5.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc22_5.2 (constants.%.73f)] -// CHECK:STDOUT: %impl.elem0.loc22_5.2: @Class.F.%.loc22_5.2 (%.73f) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc22_5.2: = specific_impl_function %impl.elem0.loc22_5.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %Destroy.facet.loc22_5.2: %Destroy.type = facet_value %Class.loc21_26.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_5.2 (constants.%Destroy.facet.86d)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc22_5.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.297)] +// CHECK:STDOUT: %.loc22_5.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc22_5.2 [symbolic = %.loc22_5.3 (constants.%.73f)] +// CHECK:STDOUT: %impl.elem0.loc22_5.2: @Class.F.%.loc22_5.3 (%.73f) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc22_5.2: = specific_impl_function %impl.elem0.loc22_5.2, @Destroy.WithSelf.Op(%Destroy.facet.loc22_5.2) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -198,8 +199,8 @@ class Class(T:! type) { // CHECK:STDOUT: %.loc21_30: @Class.F.%Class.MakeSelf.type (%Class.MakeSelf.type) = specific_constant @Class.%Class.MakeSelf.decl, @Class(constants.%T) [symbolic = %Class.MakeSelf (constants.%Class.MakeSelf)] // CHECK:STDOUT: %MakeSelf.ref: @Class.F.%Class.MakeSelf.type (%Class.MakeSelf.type) = name_ref MakeSelf, %.loc21_30 [symbolic = %Class.MakeSelf (constants.%Class.MakeSelf)] // CHECK:STDOUT: %Class.MakeSelf.specific_fn.loc21_30.1: = specific_function %MakeSelf.ref, @Class.MakeSelf(constants.%T) [symbolic = %Class.MakeSelf.specific_fn.loc21_30.2 (constants.%Class.MakeSelf.specific_fn)] -// CHECK:STDOUT: %.loc21_5: ref @Class.F.%Class.loc21_26.2 (%Class) = splice_block %c.var {} -// CHECK:STDOUT: %Class.MakeSelf.call: init @Class.F.%Class.loc21_26.2 (%Class) to %.loc21_5 = call %Class.MakeSelf.specific_fn.loc21_30.1() +// CHECK:STDOUT: %.loc21_5.1: ref @Class.F.%Class.loc21_26.2 (%Class) = splice_block %c.var {} +// CHECK:STDOUT: %Class.MakeSelf.call: init @Class.F.%Class.loc21_26.2 (%Class) to %.loc21_5.1 = call %Class.MakeSelf.specific_fn.loc21_30.1() // CHECK:STDOUT: assign %c.var, %Class.MakeSelf.call // CHECK:STDOUT: %.loc21_26: type = splice_block %Class.loc21_26.1 [symbolic = %Class.loc21_26.2 (constants.%Class)] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] @@ -223,13 +224,17 @@ class Class(T:! type) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc22_19.2 [symbolic = %Class.loc21_26.2 (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %s: ref @Class.F.%Class.loc21_26.2 (%Class) = ref_binding s, %s.var -// CHECK:STDOUT: %impl.elem0.loc22_5.1: @Class.F.%.loc22_5.2 (%.73f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc22_5.1: @Class.F.%.loc22_5.3 (%.73f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc22_5.1: = bound_method %s.var, %impl.elem0.loc22_5.1 +// CHECK:STDOUT: %Destroy.facet.loc22_5.1: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_5.2 (constants.%Destroy.facet.86d)] +// CHECK:STDOUT: %.loc22_5.2: %Destroy.type = converted constants.%Class, %Destroy.facet.loc22_5.1 [symbolic = %Destroy.facet.loc22_5.2 (constants.%Destroy.facet.86d)] // CHECK:STDOUT: %specific_impl_fn.loc22_5.1: = specific_impl_function %impl.elem0.loc22_5.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.86d) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc22_5.2: = bound_method %s.var, %specific_impl_fn.loc22_5.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22_5.2(%s.var) -// CHECK:STDOUT: %impl.elem0.loc21: @Class.F.%.loc22_5.2 (%.73f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc21: @Class.F.%.loc22_5.3 (%.73f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc21_5.1: = bound_method %c.var, %impl.elem0.loc21 +// CHECK:STDOUT: %Destroy.facet.loc21: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_5.2 (constants.%Destroy.facet.86d)] +// CHECK:STDOUT: %.loc21_5.2: %Destroy.type = converted constants.%Class, %Destroy.facet.loc21 [symbolic = %Destroy.facet.loc22_5.2 (constants.%Destroy.facet.86d)] // CHECK:STDOUT: %specific_impl_fn.loc21: = specific_impl_function %impl.elem0.loc21, @Destroy.WithSelf.Op(constants.%Destroy.facet.86d) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc21_5.2: = bound_method %c.var, %specific_impl_fn.loc21 // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc21: init %empty_tuple.type = call %bound_method.loc21_5.2(%c.var) diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 01a4fd9dc40b..2eccb195d7d1 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -26,8 +26,8 @@ class Field { class ForwardDeclared; class ForwardDeclared { - fn F[self: Self](); - fn G[ref self: Self](); + fn F(self); + fn G(ref self); } class Incomplete; @@ -53,6 +53,7 @@ fn Run() { var unused e: Incomplete*; } + // CHECK:STDOUT: --- a.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -263,12 +264,12 @@ fn Run() { // CHECK:STDOUT: %.860: %Field.elem = field_decl x, element0 [concrete] // CHECK:STDOUT: %Main.import_ref.8f24d3.2: = import_ref Main//a, loc16_1, loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.fbb203.1 = import_ref Main//a, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.bc9: %ForwardDeclared.F.type = import_ref Main//a, loc14_21, loaded [concrete = constants.%ForwardDeclared.F] -// CHECK:STDOUT: %Main.import_ref.341: %ForwardDeclared.G.type = import_ref Main//a, loc15_25, loaded [concrete = constants.%ForwardDeclared.G] +// CHECK:STDOUT: %Main.import_ref.bc9: %ForwardDeclared.F.type = import_ref Main//a, loc14_13, loaded [concrete = constants.%ForwardDeclared.F] +// CHECK:STDOUT: %Main.import_ref.341: %ForwardDeclared.G.type = import_ref Main//a, loc15_17, loaded [concrete = constants.%ForwardDeclared.G] // CHECK:STDOUT: %Main.import_ref.8f24d3.3: = import_ref Main//a, loc16_1, loaded [concrete = constants.%complete_type.357] // CHECK:STDOUT: %Main.import_ref.fbb203.2 = import_ref Main//a, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.439 = import_ref Main//a, loc14_21, unloaded -// CHECK:STDOUT: %Main.import_ref.c46 = import_ref Main//a, loc15_25, unloaded +// CHECK:STDOUT: %Main.import_ref.439 = import_ref Main//a, loc14_13, unloaded +// CHECK:STDOUT: %Main.import_ref.c46 = import_ref Main//a, loc15_17, unloaded // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.e5f: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.ff5) = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.ce9)] // CHECK:STDOUT: %Copy.impl_witness_table.4f1 = impl_witness_table (%Core.import_ref.e5f), @ptr.as.Copy.impl [concrete] diff --git a/toolchain/check/testdata/class/incomplete_ref.carbon b/toolchain/check/testdata/class/incomplete_ref.carbon index 6d6f64e02067..7b9546de23a5 100644 --- a/toolchain/check/testdata/class/incomplete_ref.carbon +++ b/toolchain/check/testdata/class/incomplete_ref.carbon @@ -13,7 +13,7 @@ class Class; class IncompleteRefSelf { - fn F[ref self: Class](); + fn F(ref self: Class); } fn CallIncompleteRefSelf(p: Class*) { diff --git a/toolchain/check/testdata/class/inheritance/base_method.carbon b/toolchain/check/testdata/class/inheritance/base_method.carbon index 020fc457c470..1b132e784f64 100644 --- a/toolchain/check/testdata/class/inheritance/base_method.carbon +++ b/toolchain/check/testdata/class/inheritance/base_method.carbon @@ -15,10 +15,10 @@ base class Base { var a: i32; - fn F[ref self: Self](); + fn F(ref self); } -fn Base.F[ref self: Self]() { +fn Base.F(ref self) { self.a = 1; } diff --git a/toolchain/check/testdata/class/inheritance/base_method_qualified.carbon b/toolchain/check/testdata/class/inheritance/base_method_qualified.carbon index e17f061e7b7e..1ca3dfbca3ea 100644 --- a/toolchain/check/testdata/class/inheritance/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/inheritance/base_method_qualified.carbon @@ -15,15 +15,15 @@ class Derived; base class Base { - fn F[self: Self]() -> i32; - fn G[self: Derived]() -> i32; + fn F(self) -> i32; + fn G(self: Derived) -> i32; } class Derived { extend base: Base; - fn F[self: Self](); - fn G[self: Self](); + fn F(self); + fn G(self); } fn Call(a: Derived) -> i32 { diff --git a/toolchain/check/testdata/class/inheritance/base_method_shadow.carbon b/toolchain/check/testdata/class/inheritance/base_method_shadow.carbon index e68fc96bc380..037ed4bfbe88 100644 --- a/toolchain/check/testdata/class/inheritance/base_method_shadow.carbon +++ b/toolchain/check/testdata/class/inheritance/base_method_shadow.carbon @@ -13,17 +13,17 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/inheritance/base_method_shadow.carbon base class A { - fn F[ref self: Self](); + fn F(ref self); } base class B { extend base: A; - fn F[ref self: Self](); + fn F(ref self); } class C { extend base: B; - fn F[ref self: Self](); + fn F(ref self); } class D { diff --git a/toolchain/check/testdata/class/inheritance/import_base.carbon b/toolchain/check/testdata/class/inheritance/import_base.carbon index 1633f0d83815..3a4c89970ada 100644 --- a/toolchain/check/testdata/class/inheritance/import_base.carbon +++ b/toolchain/check/testdata/class/inheritance/import_base.carbon @@ -17,8 +17,8 @@ library "[[@TEST_NAME]]"; base class Base { - fn F[self: Self](); - fn Unused[self: Self](); + fn F(self); + fn Unused(self); var x: i32; var unused_y: i32; @@ -40,6 +40,7 @@ fn Run() { a.F(); } + // CHECK:STDOUT: --- a.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -197,8 +198,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.6fc: = import_ref Main//a, loc10_1, loaded [concrete = constants.%complete_type.6c3] // CHECK:STDOUT: %Main.import_ref.d68 = import_ref Main//a, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.bc9: %Base.F.type = import_ref Main//a, loc5_21, loaded [concrete = constants.%Base.F] -// CHECK:STDOUT: %Main.import_ref.077 = import_ref Main//a, loc6_26, unloaded +// CHECK:STDOUT: %Main.import_ref.bc9: %Base.F.type = import_ref Main//a, loc5_13, loaded [concrete = constants.%Base.F] +// CHECK:STDOUT: %Main.import_ref.077 = import_ref Main//a, loc6_18, unloaded // CHECK:STDOUT: %Main.import_ref.230: %Base.elem = import_ref Main//a, loc8_8, loaded [concrete = %.11f] // CHECK:STDOUT: %Main.import_ref.9f4 = import_ref Main//a, loc9_15, unloaded // CHECK:STDOUT: %Main.import_ref.60e: = import_ref Main//a, loc14_1, loaded [concrete = constants.%complete_type.c02] diff --git a/toolchain/check/testdata/class/inheritance/self_conversion.carbon b/toolchain/check/testdata/class/inheritance/self_conversion.carbon index a6ed267bc0e3..c714457c2b02 100644 --- a/toolchain/check/testdata/class/inheritance/self_conversion.carbon +++ b/toolchain/check/testdata/class/inheritance/self_conversion.carbon @@ -19,15 +19,15 @@ base class Base { class Derived { extend base: Base; - fn SelfBase[self: Base]() -> i32; - fn RefSelfBase[ref self: Base](); + fn SelfBase(self: Base) -> i32; + fn RefSelfBase(ref self: Base); } -fn Derived.SelfBase[self: Base]() -> i32 { +fn Derived.SelfBase(self: Base) -> i32 { return self.a; } -fn Derived.RefSelfBase[ref self: Base]() { +fn Derived.RefSelfBase(ref self: Base) { self.a = 1; } diff --git a/toolchain/check/testdata/class/method/call_without_method_syntax.carbon b/toolchain/check/testdata/class/method/call_without_method_syntax.carbon new file mode 100644 index 000000000000..d4abba2c70af --- /dev/null +++ b/toolchain/check/testdata/class/method/call_without_method_syntax.carbon @@ -0,0 +1,255 @@ +// 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/int.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/class/method/call_without_method_syntax.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/method/call_without_method_syntax.carbon + +// --- call_without_method_syntax.carbon +library "[[@TEST_NAME]]"; + +class Point { + fn Get(self) -> i32 { return self.x; } + fn First(self, unused other: Point) -> i32 { return self.x; } + + var x: i32; +} + +// A method is a function whose first parameter is `self`, so it can be called +// as an ordinary function by passing the receiver as the first explicit +// argument. `Point.Get(p)` is equivalent to `p.Get()`. +fn CallGet(p: Point) -> i32 { + return Point.Get(p); +} + +// The remaining explicit arguments follow the receiver. +fn CallFirst(p: Point, q: Point) -> i32 { + return Point.First(p, q); +} + +// The same works through an alias of the method. +fn CallViaAlias(p: Point) -> i32 { + alias A = Point.Get; + return A(p); +} + +// CHECK:STDOUT: --- call_without_method_syntax.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Point: type = class_type @Point [concrete] +// CHECK:STDOUT: %pattern_type.9d8: type = pattern_type %Point [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %.795: Core.Form = init_form %i32 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %Point.Get.type: type = fn_type @Point.Get [concrete] +// CHECK:STDOUT: %Point.Get: %Point.Get.type = struct_value () [concrete] +// CHECK:STDOUT: %Point.First.type: type = fn_type @Point.First [concrete] +// CHECK:STDOUT: %Point.First: %Point.First.type = struct_value () [concrete] +// CHECK:STDOUT: %Point.elem: type = unbound_element_type %Point, %i32 [concrete] +// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %i32} [concrete] +// CHECK:STDOUT: %complete_type.0c6: = complete_type_witness %struct_type.x [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.0e0: = impl_witness imports.%Copy.impl_witness_table.367, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.3f6: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.4f6: %Int.as.Copy.impl.Op.type.3f6 = struct_value () [concrete] +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.0e0) [concrete] +// CHECK:STDOUT: %Copy.WithSelf.Op.type.d09: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] +// CHECK:STDOUT: %.7a6: type = fn_type_with_self_type %Copy.WithSelf.Op.type.d09, %Copy.facet [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %CallGet.type: type = fn_type @CallGet [concrete] +// CHECK:STDOUT: %CallGet: %CallGet.type = struct_value () [concrete] +// CHECK:STDOUT: %CallFirst.type: type = fn_type @CallFirst [concrete] +// CHECK:STDOUT: %CallFirst: %CallFirst.type = struct_value () [concrete] +// CHECK:STDOUT: %CallViaAlias.type: type = fn_type @CallViaAlias [concrete] +// CHECK:STDOUT: %CallViaAlias: %CallViaAlias.type = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .Copy = %Core.Copy +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] +// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)] +// CHECK:STDOUT: %Copy.impl_witness_table.367 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Point = %Point.decl +// CHECK:STDOUT: .CallGet = %CallGet.decl +// CHECK:STDOUT: .CallFirst = %CallFirst.decl +// CHECK:STDOUT: .CallViaAlias = %CallViaAlias.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Point.decl: type = class_decl @Point [concrete = constants.%Point] {} {} +// CHECK:STDOUT: %CallGet.decl: %CallGet.type = fn_decl @CallGet [concrete = constants.%CallGet] { +// CHECK:STDOUT: %p.param_patt: %pattern_type.9d8 = value_param_pattern [concrete] +// CHECK:STDOUT: %p.patt: %pattern_type.9d8 = at_binding_pattern p, %p.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc13: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %p.param: %Point = value_param call_param0 +// CHECK:STDOUT: %Point.ref.loc13: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] +// CHECK:STDOUT: %p: %Point = value_binding p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %CallFirst.decl: %CallFirst.type = fn_decl @CallFirst [concrete = constants.%CallFirst] { +// CHECK:STDOUT: %p.param_patt: %pattern_type.9d8 = value_param_pattern [concrete] +// CHECK:STDOUT: %p.patt: %pattern_type.9d8 = at_binding_pattern p, %p.param_patt [concrete] +// CHECK:STDOUT: %q.param_patt: %pattern_type.9d8 = value_param_pattern [concrete] +// CHECK:STDOUT: %q.patt: %pattern_type.9d8 = at_binding_pattern q, %q.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc18: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %p.param: %Point = value_param call_param0 +// CHECK:STDOUT: %Point.ref.loc18_17: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] +// CHECK:STDOUT: %p: %Point = value_binding p, %p.param +// CHECK:STDOUT: %q.param: %Point = value_param call_param1 +// CHECK:STDOUT: %Point.ref.loc18_27: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] +// CHECK:STDOUT: %q: %Point = value_binding q, %q.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %CallViaAlias.decl: %CallViaAlias.type = fn_decl @CallViaAlias [concrete = constants.%CallViaAlias] { +// CHECK:STDOUT: %p.param_patt: %pattern_type.9d8 = value_param_pattern [concrete] +// CHECK:STDOUT: %p.patt: %pattern_type.9d8 = at_binding_pattern p, %p.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc23: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %p.param: %Point = value_param call_param0 +// CHECK:STDOUT: %Point.ref.loc23: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] +// CHECK:STDOUT: %p: %Point = value_binding p, %p.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @Point { +// CHECK:STDOUT: %Point.Get.decl: %Point.Get.type = fn_decl @Point.Get [concrete = constants.%Point.Get] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9d8 = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: %pattern_type.9d8 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc4_19: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %self.param: %Point = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Point [concrete = constants.%Point] +// CHECK:STDOUT: %self: %Point = value_binding self, %self.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Point.First.decl: %Point.First.type = fn_decl @Point.First [concrete = constants.%Point.First] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9d8 = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: %pattern_type.9d8 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %other.param_patt: %pattern_type.9d8 = value_param_pattern [concrete] +// CHECK:STDOUT: %other.patt: %pattern_type.9d8 = at_binding_pattern other, %other.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc5_42: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %self.param: %Point = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Point [concrete = constants.%Point] +// CHECK:STDOUT: %self: %Point = value_binding self, %self.param +// CHECK:STDOUT: %other.param: %Point = value_param call_param1 +// CHECK:STDOUT: %Point.ref: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] +// CHECK:STDOUT: %other: %Point = value_binding other, %other.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc7: %Point.elem = field_decl x, element0 [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type.0c6] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Point +// CHECK:STDOUT: .Get = %Point.Get.decl +// CHECK:STDOUT: .Point = +// CHECK:STDOUT: .First = %Point.First.decl +// CHECK:STDOUT: .x = %.loc7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Point.Get(%self.param: %Point) -> out %return.param: %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %self.ref: %Point = name_ref self, %self +// CHECK:STDOUT: %x.ref: %Point.elem = name_ref x, @Point.%.loc7 [concrete = @Point.%.loc7] +// CHECK:STDOUT: %.loc4_36.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc4_36.2: %i32 = acquire_value %.loc4_36.1 +// CHECK:STDOUT: %impl.elem0: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] +// CHECK:STDOUT: %bound_method.loc4_36.1: = bound_method %.loc4_36.2, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc4_36.2: = bound_method %.loc4_36.2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc4_36.2(%.loc4_36.2) +// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Point.First(%self.param: %Point, %other.param: %Point) -> out %return.param: %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %self.ref: %Point = name_ref self, %self +// CHECK:STDOUT: %x.ref: %Point.elem = name_ref x, @Point.%.loc7 [concrete = @Point.%.loc7] +// CHECK:STDOUT: %.loc5_59.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc5_59.2: %i32 = acquire_value %.loc5_59.1 +// CHECK:STDOUT: %impl.elem0: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] +// CHECK:STDOUT: %bound_method.loc5_59.1: = bound_method %.loc5_59.2, %impl.elem0 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc5_59.2: = bound_method %.loc5_59.2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc5_59.2(%.loc5_59.2) +// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @CallGet(%p.param: %Point) -> out %return.param: %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Point.ref.loc14: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] +// CHECK:STDOUT: %Get.ref: %Point.Get.type = name_ref Get, @Point.%Point.Get.decl [concrete = constants.%Point.Get] +// CHECK:STDOUT: %p.ref: %Point = name_ref p, %p +// CHECK:STDOUT: %Point.Get.call: init %i32 = call %Get.ref(%p.ref) +// CHECK:STDOUT: return %Point.Get.call +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @CallFirst(%p.param: %Point, %q.param: %Point) -> out %return.param: %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Point.ref.loc19: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] +// CHECK:STDOUT: %First.ref: %Point.First.type = name_ref First, @Point.%Point.First.decl [concrete = constants.%Point.First] +// CHECK:STDOUT: %p.ref: %Point = name_ref p, %p +// CHECK:STDOUT: %q.ref: %Point = name_ref q, %q +// CHECK:STDOUT: %Point.First.call: init %i32 = call %First.ref(%p.ref, %q.ref) +// CHECK:STDOUT: return %Point.First.call +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @CallViaAlias(%p.param: %Point) -> out %return.param: %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Point.ref.loc24: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] +// CHECK:STDOUT: %Get.ref: %Point.Get.type = name_ref Get, @Point.%Point.Get.decl [concrete = constants.%Point.Get] +// CHECK:STDOUT: %A: %Point.Get.type = alias_binding A, %Get.ref [concrete = constants.%Point.Get] +// CHECK:STDOUT: %A.ref: %Point.Get.type = name_ref A, %A [concrete = constants.%Point.Get] +// CHECK:STDOUT: %p.ref: %Point = name_ref p, %p +// CHECK:STDOUT: %Point.Get.call: init %i32 = call %A.ref(%p.ref) +// CHECK:STDOUT: return %Point.Get.call +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon b/toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon new file mode 100644 index 000000000000..d27297dadf88 --- /dev/null +++ b/toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon @@ -0,0 +1,60 @@ +// 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/int.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/method/fail_call_without_method_syntax.carbon + +// --- fail_call_without_method_syntax.carbon +library "[[@TEST_NAME]]"; + +class Point { + fn Get(self) -> i32 { return self.x; } + + var x: i32; +} + +class Other {} + +// When a method is called as an ordinary function, `self` is an ordinary +// argument, so the usual arity and conversion rules apply. +fn TooFew() -> i32 { + // CHECK:STDERR: fail_call_without_method_syntax.carbon:[[@LINE+7]]:10: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] + // CHECK:STDERR: return Point.Get(); + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_call_without_method_syntax.carbon:[[@LINE-13]]:3: note: calling function declared here [InCallToEntity] + // CHECK:STDERR: fn Get(self) -> i32 { return self.x; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + return Point.Get(); +} + +fn TooMany(p: Point) -> i32 { + // CHECK:STDERR: fail_call_without_method_syntax.carbon:[[@LINE+7]]:10: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] + // CHECK:STDERR: return Point.Get(p, p); + // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_call_without_method_syntax.carbon:[[@LINE-24]]:3: note: calling function declared here [InCallToEntity] + // CHECK:STDERR: fn Get(self) -> i32 { return self.x; } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + return Point.Get(p, p); +} + +fn WrongSelfType(o: Other) -> i32 { + // CHECK:STDERR: fail_call_without_method_syntax.carbon:[[@LINE+10]]:20: error: cannot implicitly convert expression of type `Other` to `Point` [ConversionFailure] + // CHECK:STDERR: return Point.Get(o); + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_call_without_method_syntax.carbon:[[@LINE+7]]:20: note: type `Other` does not implement interface `Core.ImplicitAs(Point)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: return Point.Get(o); + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_call_without_method_syntax.carbon:[[@LINE-38]]:10: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn Get(self) -> i32 { return self.x; } + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + return Point.Get(o); +} diff --git a/toolchain/check/testdata/class/method/fail_generic_method.carbon b/toolchain/check/testdata/class/method/fail_generic_method.carbon index 8b01a53db4b4..be73798092e2 100644 --- a/toolchain/check/testdata/class/method/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/method/fail_generic_method.carbon @@ -14,24 +14,24 @@ class I {} class Class(T:! type) { var a: T; - fn F[self: Self](n: T); + fn F(self, n: T); } // TODO: The follow-on errors here aren't great. Investigate whether we can // enter the scope anyway if the parameters don't match. // CHECK:STDERR: fail_generic_method.carbon:[[@LINE+15]]:17: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] -// CHECK:STDERR: fn Class(unused N:! I).F[unused self: Self](unused n: T) {} +// CHECK:STDERR: fn Class(unused N:! I).F(unused self, unused n: T) {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: class Class(T:! type) { // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+8]]:39: error: name `Self` not found [NameNotFound] -// CHECK:STDERR: fn Class(unused N:! I).F[unused self: Self](unused n: T) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+8]]:33: error: name `Self` not found [NameNotFound] +// CHECK:STDERR: fn Class(unused N:! I).F(unused self, unused n: T) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:55: error: name `T` not found [NameNotFound] -// CHECK:STDERR: fn Class(unused N:! I).F[unused self: Self](unused n: T) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:49: error: name `T` not found [NameNotFound] +// CHECK:STDERR: fn Class(unused N:! I).F(unused self, unused n: T) {} +// CHECK:STDERR: ^ // CHECK:STDERR: -fn Class(unused N:! I).F[unused self: Self](unused n: T) {} +fn Class(unused N:! I).F(unused self, unused n: T) {} diff --git a/toolchain/check/testdata/class/method/fail_method.carbon b/toolchain/check/testdata/class/method/fail_method.carbon index 2448d332ab3d..dbc69325c3ea 100644 --- a/toolchain/check/testdata/class/method/fail_method.carbon +++ b/toolchain/check/testdata/class/method/fail_method.carbon @@ -12,7 +12,7 @@ class Class { fn NoSelf(); - fn WithSelf[self: Class](); + fn WithSelf(self: Class); } alias A = Class.WithSelf; @@ -22,29 +22,22 @@ fn F(c: Class) { c.WithSelf(); Class.NoSelf(); - // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall] + // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: Class.WithSelf(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-13]]:3: note: calling function declared here [InCallToFunction] - // CHECK:STDERR: fn WithSelf[self: Class](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_method.carbon:[[@LINE-13]]:3: note: calling function declared here [InCallToEntity] + // CHECK:STDERR: fn WithSelf(self: Class); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Class.WithSelf(); - // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch] - // CHECK:STDERR: Class.WithSelf(c); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-21]]:3: note: calling function declared here [InCallToEntity] - // CHECK:STDERR: fn WithSelf[self: Class](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: Class.WithSelf(c); - // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall] + // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: A(); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-30]]:3: note: calling function declared here [InCallToFunction] - // CHECK:STDERR: fn WithSelf[self: Class](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_method.carbon:[[@LINE-23]]:3: note: calling function declared here [InCallToEntity] + // CHECK:STDERR: fn WithSelf(self: Class); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: A(); } diff --git a/toolchain/check/testdata/class/method/fail_method_modifiers.carbon b/toolchain/check/testdata/class/method/fail_method_modifiers.carbon index 402f92dd3477..4744b4e271ad 100644 --- a/toolchain/check/testdata/class/method/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/method/fail_method_modifiers.carbon @@ -13,47 +13,47 @@ class FinalClass { // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `abstract` not allowed; requires `abstract` class scope [ModifierAbstractNotAllowed] - // CHECK:STDERR: abstract fn Abstract[self: Self](); + // CHECK:STDERR: abstract fn Abstract(self); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note: containing definition here [ModifierNotInContext] // CHECK:STDERR: class FinalClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - abstract fn Abstract[self: Self](); + abstract fn Abstract(self); // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `virtual` not allowed; requires `abstract` or `base` class scope [ModifierVirtualNotAllowed] - // CHECK:STDERR: virtual fn Virtual[self: Self](); + // CHECK:STDERR: virtual fn Virtual(self); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-14]]:1: note: containing definition here [ModifierNotInContext] // CHECK:STDERR: class FinalClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - virtual fn Virtual[self: Self](); + virtual fn Virtual(self); } abstract class AbstractClass { // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed; requires interface scope [ModifierRequiresInterface] - // CHECK:STDERR: default fn Default[self: Self](); + // CHECK:STDERR: default fn Default(self); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - default fn Default[self: Self](); + default fn Default(self); // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: error: `final` not allowed; requires interface scope [ModifierRequiresInterface] - // CHECK:STDERR: final fn Final[self: Self](); + // CHECK:STDERR: final fn Final(self); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - final fn Final[self: Self](); + final fn Final(self); } base class BaseClass { // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `abstract` not allowed; requires `abstract` class scope [ModifierAbstractNotAllowed] - // CHECK:STDERR: abstract fn Abstract[self: Self](); + // CHECK:STDERR: abstract fn Abstract(self); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note: containing definition here [ModifierNotInContext] // CHECK:STDERR: base class BaseClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - abstract fn Abstract[self: Self](); + abstract fn Abstract(self); } diff --git a/toolchain/check/testdata/class/method/generic_method.carbon b/toolchain/check/testdata/class/method/generic_method.carbon index bf1570a0646e..8c200cb7c3cf 100644 --- a/toolchain/check/testdata/class/method/generic_method.carbon +++ b/toolchain/check/testdata/class/method/generic_method.carbon @@ -14,10 +14,11 @@ class Class(T:! type) { var a: T; - fn F[self: Self](n: T); + fn F(self, n: T); } -fn Class(T:! type).F[unused self: Self](unused n: T) {} +fn Class(T:! type).F(unused self, unused n: T) {} + // CHECK:STDOUT: --- generic_method.carbon // CHECK:STDOUT: @@ -63,10 +64,10 @@ fn Class(T:! type).F[unused self: Self](unused n: T) {} // CHECK:STDOUT: %T.loc15_14.2: type = symbolic_binding T, 0 [symbolic = %T.loc15_14.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.F.decl: %Class.F.type = fn_decl @Class.F [symbolic = constants.%Class.F] { -// CHECK:STDOUT: %self.param_patt: @Class.F.%pattern_type.loc17_12 (%pattern_type.36e) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Class.F.%pattern_type.loc17_12 (%pattern_type.36e) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %n.param_patt: @Class.F.%pattern_type.loc17_21 (%pattern_type.51d) = value_param_pattern [concrete] -// CHECK:STDOUT: %n.patt: @Class.F.%pattern_type.loc17_21 (%pattern_type.51d) = at_binding_pattern n, %n.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @Class.F.%pattern_type.loc17_8 (%pattern_type.36e) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Class.F.%pattern_type.loc17_8 (%pattern_type.36e) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %n.param_patt: @Class.F.%pattern_type.loc17_15 (%pattern_type.51d) = value_param_pattern [concrete] +// CHECK:STDOUT: %n.patt: @Class.F.%pattern_type.loc17_15 (%pattern_type.51d) = at_binding_pattern n, %n.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc20_14.1: type = splice_block %.loc20_14.2 [concrete = type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] @@ -74,9 +75,9 @@ fn Class(T:! type).F[unused self: Self](unused n: T) {} // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc20: type = symbolic_binding T, 0 [symbolic = @Class.%T.loc15_14.1 (constants.%T)] // CHECK:STDOUT: %self.param.loc20: @Class.F.%Class (%Class) = value_param call_param0 -// CHECK:STDOUT: %.loc20_35.1: type = splice_block %Self.ref.loc20 [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc20_35.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_35.2 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %.loc20_29.1: type = splice_block %Self.ref.loc20 [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc20_29.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_29.2 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc20: @Class.F.%Class (%Class) = value_binding self, %self.param.loc20 // CHECK:STDOUT: %n.param.loc20: @Class.F.%T.loc17 (%T) = value_param call_param1 @@ -100,15 +101,15 @@ fn Class(T:! type).F[unused self: Self](unused n: T) {} // CHECK:STDOUT: class { // CHECK:STDOUT: %.loc16: @Class.%Class.elem (%Class.elem) = field_decl a, element0 [concrete] // CHECK:STDOUT: %Class.F.decl: @Class.%Class.F.type (%Class.F.type) = fn_decl @Class.F [symbolic = @Class.%Class.F (constants.%Class.F)] { -// CHECK:STDOUT: %self.param_patt: @Class.F.%pattern_type.loc17_12 (%pattern_type.36e) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Class.F.%pattern_type.loc17_12 (%pattern_type.36e) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %n.param_patt: @Class.F.%pattern_type.loc17_21 (%pattern_type.51d) = value_param_pattern [concrete] -// CHECK:STDOUT: %n.patt: @Class.F.%pattern_type.loc17_21 (%pattern_type.51d) = at_binding_pattern n, %n.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @Class.F.%pattern_type.loc17_8 (%pattern_type.36e) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Class.F.%pattern_type.loc17_8 (%pattern_type.36e) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %n.param_patt: @Class.F.%pattern_type.loc17_15 (%pattern_type.51d) = value_param_pattern [concrete] +// CHECK:STDOUT: %n.patt: @Class.F.%pattern_type.loc17_15 (%pattern_type.51d) = at_binding_pattern n, %n.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param.loc17: @Class.F.%Class (%Class) = value_param call_param0 -// CHECK:STDOUT: %.loc17_14.1: type = splice_block %Self.ref.loc17 [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc17_14.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, %.loc17_14.2 [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %.loc17_8.1: type = splice_block %Self.ref.loc17 [symbolic = %Class (constants.%Class)] { +// CHECK:STDOUT: %.loc17_8.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] +// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, %.loc17_8.2 [symbolic = %Class (constants.%Class)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc17: @Class.F.%Class (%Class) = value_binding self, %self.param.loc17 // CHECK:STDOUT: %n.param.loc17: @Class.F.%T.loc17 (%T) = value_param call_param1 @@ -129,12 +130,12 @@ fn Class(T:! type).F[unused self: Self](unused n: T) {} // CHECK:STDOUT: generic fn @Class.F(@Class.%T.loc15_14.2: type) { // CHECK:STDOUT: %T.loc17: type = symbolic_binding T, 0 [symbolic = %T.loc17 (constants.%T)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc17) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %pattern_type.loc17_12: type = pattern_type %Class [symbolic = %pattern_type.loc17_12 (constants.%pattern_type.36e)] -// CHECK:STDOUT: %pattern_type.loc17_21: type = pattern_type %T.loc17 [symbolic = %pattern_type.loc17_21 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %pattern_type.loc17_8: type = pattern_type %Class [symbolic = %pattern_type.loc17_8 (constants.%pattern_type.36e)] +// CHECK:STDOUT: %pattern_type.loc17_15: type = pattern_type %T.loc17 [symbolic = %pattern_type.loc17_15 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc20_33: = require_complete_type %Class [symbolic = %require_complete.loc20_33 (constants.%require_complete.4d9)] -// CHECK:STDOUT: %require_complete.loc20_49: = require_complete_type %T.loc17 [symbolic = %require_complete.loc20_49 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc20_29: = require_complete_type %Class [symbolic = %require_complete.loc20_29 (constants.%require_complete.4d9)] +// CHECK:STDOUT: %require_complete.loc20_43: = require_complete_type %T.loc17 [symbolic = %require_complete.loc20_43 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param.loc20: @Class.F.%Class (%Class), %n.param.loc20: @Class.F.%T.loc17 (%T)) { // CHECK:STDOUT: !entry: @@ -158,7 +159,7 @@ fn Class(T:! type).F[unused self: Self](unused n: T) {} // CHECK:STDOUT: specific @Class.F(constants.%T) { // CHECK:STDOUT: %T.loc17 => constants.%T // CHECK:STDOUT: %Class => constants.%Class -// CHECK:STDOUT: %pattern_type.loc17_12 => constants.%pattern_type.36e -// CHECK:STDOUT: %pattern_type.loc17_21 => constants.%pattern_type.51d +// CHECK:STDOUT: %pattern_type.loc17_8 => constants.%pattern_type.36e +// CHECK:STDOUT: %pattern_type.loc17_15 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method/method.carbon b/toolchain/check/testdata/class/method/method.carbon index 18fcf499a3ca..1ea16dc42a8e 100644 --- a/toolchain/check/testdata/class/method/method.carbon +++ b/toolchain/check/testdata/class/method/method.carbon @@ -13,15 +13,15 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/method/method.carbon class Class { - fn F[self: Self]() -> i32; - fn G[ref self: Self]() -> i32; + fn F(self) -> i32; + fn G(ref self) -> i32; alias A = F; var k: i32; } -fn Class.F[self: Self]() -> i32 { +fn Class.F(self) -> i32 { return self.k; } diff --git a/toolchain/check/testdata/class/method/virtual.carbon b/toolchain/check/testdata/class/method/virtual.carbon index 09ee24d92a26..611e56d818ee 100644 --- a/toolchain/check/testdata/class/method/virtual.carbon +++ b/toolchain/check/testdata/class/method/virtual.carbon @@ -16,13 +16,13 @@ package Modifiers; //@dump-sem-ir-begin base class Base { - virtual fn H[self: Self](); + virtual fn H(self); } abstract class Abstract { - abstract fn J[self: Self](); + abstract fn J(self); - virtual fn K[self: Self](); + virtual fn K(self); } //@dump-sem-ir-end @@ -35,7 +35,7 @@ import Modifiers; //@dump-sem-ir-begin class Derived { extend base: Modifiers.Base; - override fn H[self: Self](); + override fn H(self); } //@dump-sem-ir-end @@ -52,7 +52,7 @@ library "[[@TEST_NAME]]"; import Modifiers; base class Derived { - virtual fn F[self: Self](); + virtual fn F(self); extend base: Modifiers.Base; } @@ -73,12 +73,12 @@ fn F() { library "[[@TEST_NAME]]"; abstract class A1 { - virtual fn F[self: Self](); + virtual fn F(self); } abstract class A2 { extend base: A1; - override fn F[self: Self](); + override fn F(self); } // --- impl_base.carbon @@ -86,17 +86,17 @@ abstract class A2 { library "[[@TEST_NAME]]"; base class B1 { - virtual fn F[self: Self](); + virtual fn F(self); } base class B2 { extend base: B1; - override fn F[self: Self](); + override fn F(self); } class C { extend base: B2; - override fn F[self: Self](); + override fn F(self); } fn Use() { @@ -111,10 +111,10 @@ library "[[@TEST_NAME]]"; class C { // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:3: error: override without base class [OverrideWithoutBase] - // CHECK:STDERR: override fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: override fn F(self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - override fn F[self: Self](); + override fn F(self); } // --- init_members.carbon @@ -125,7 +125,7 @@ base class Base { var m1: i32; var m2: i32; - virtual fn F[self: Self](); + virtual fn F(self); } fn F() { @@ -148,10 +148,10 @@ base class Base { class Derived { extend base: Base; // CHECK:STDERR: fail_impl_without_base_declaration.carbon:[[@LINE+4]]:3: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase] - // CHECK:STDERR: override fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: override fn F(self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - override fn F[self: Self](); + override fn F(self); } // --- abstract_impl.carbon @@ -159,7 +159,7 @@ class Derived { library "[[@TEST_NAME]]"; abstract class AbstractBase { - abstract fn F[self: Self](); + abstract fn F(self); } abstract class AbstractIntermediate { @@ -169,7 +169,7 @@ abstract class AbstractIntermediate { class Derived { extend base: AbstractIntermediate; //@dump-sem-ir-begin - override fn F[self: Self](); + override fn F(self); //@dump-sem-ir-end } @@ -178,7 +178,7 @@ class Derived { library "[[@TEST_NAME]]"; base class VirtualBase { - virtual fn F[self: Self](); + virtual fn F(self); } base class VirtualIntermediate { @@ -188,7 +188,7 @@ base class VirtualIntermediate { class Derived { extend base: VirtualIntermediate; //@dump-sem-ir-begin - override fn F[self: Self](); + override fn F(self); //@dump-sem-ir-end } @@ -197,22 +197,22 @@ class Derived { library "[[@TEST_NAME]]"; base class Base { - virtual fn F[self: Self](); + virtual fn F(self); } class Derived { extend base: Base; // CHECK:STDERR: fail_impl_mismatch.carbon:[[@LINE+10]]:3: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] - // CHECK:STDERR: override fn F[self: Self](v: i32); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: override fn F(self, v: i32); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_mismatch.carbon:[[@LINE+7]]:3: note: calling function declared here [InCallToEntity] - // CHECK:STDERR: override fn F[self: Self](v: i32); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: override fn F(self, v: i32); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_mismatch.carbon:[[@LINE-11]]:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: virtual fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: virtual fn F(self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - override fn F[self: Self](v: i32); + override fn F(self, v: i32); } // --- impl_conversion.carbon @@ -226,23 +226,23 @@ class T2 { } impl T2 as Core.ImplicitAs(T1) { - fn Convert[unused self: Self]() -> T1 { + fn Convert(unused self) -> T1 { return {}; } } base class Base { - virtual fn F[self: Self]() -> T1; + virtual fn F(self) -> T1; } class Derived { extend base: Base; //@dump-sem-ir-begin - override fn F[self: Self]() -> T2; + override fn F(self) -> T2; //@dump-sem-ir-end } -fn Derived.F[unused self: Self]() -> T2 { +fn Derived.F(unused self) -> T2 { return {}; } @@ -255,10 +255,10 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ base class Base(T:! type) { // CHECK:STDERR: fail_generic_virtual_decl.carbon:[[@LINE+4]]:3: note: generic function declared here [MissingGenericFunctionDefinitionHere] - // CHECK:STDERR: virtual fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: virtual fn F(self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - virtual fn F[self: Self](); + virtual fn F(self); } @@ -270,12 +270,12 @@ class T1 { } base class Base(T:! type) { - virtual fn F[unused self: Self](unused t: T) { } + virtual fn F(unused self, unused t: T) { } } class Derived { extend base: Base(T1); - override fn F[unused self: Self](unused t: T1) { } + override fn F(unused self, unused t: T1) { } } // --- fail_virtual_without_self.carbon @@ -309,22 +309,22 @@ class T2 { library "[[@TEST_NAME]]"; base class T1 { - virtual fn F1[self: Self](); + virtual fn F1(self); } class T2 { extend base: T1; // CHECK:STDERR: fail_ref_self_mismatch.carbon:[[@LINE+10]]:3: error: value expression passed to reference parameter [ValueForRefParam] - // CHECK:STDERR: override fn F1[ref self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: override fn F1(ref self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_ref_self_mismatch.carbon:[[@LINE+7]]:18: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: override fn F1[ref self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: override fn F1(ref self); + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_ref_self_mismatch.carbon:[[@LINE-11]]:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: virtual fn F1[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: virtual fn F1(self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - override fn F1[ref self: Self](); + override fn F1(ref self); } // --- fail_generic_virtual.carbon @@ -333,10 +333,10 @@ library "[[@TEST_NAME]]"; base class T1 { // CHECK:STDERR: fail_generic_virtual.carbon:[[@LINE+4]]:3: error: generic virtual function [GenericVirtual] - // CHECK:STDERR: virtual fn F[self: Self, T:! type](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: virtual fn F[T:! type](self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - virtual fn F[self: Self, T:! type](); + virtual fn F[T:! type](self); } // --- fail_generic_virtual_in_generic_class.carbon @@ -345,10 +345,10 @@ library "[[@TEST_NAME]]"; base class T1(T:! type) { // CHECK:STDERR: fail_generic_virtual_in_generic_class.carbon:[[@LINE+4]]:3: error: generic virtual function [GenericVirtual] - // CHECK:STDERR: virtual fn F[self: Self, T:! type](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: virtual fn F[T:! type](self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - virtual fn F[self: Self, T:! type](); + virtual fn F[T:! type](self); } // --- generic_with_virtual.carbon @@ -357,7 +357,7 @@ library "[[@TEST_NAME]]"; base class T1(T:! type) { //@dump-sem-ir-begin - virtual fn F[unused self: Self]() { } + virtual fn F(unused self) { } //@dump-sem-ir-end } @@ -367,7 +367,7 @@ library "[[@TEST_NAME]]"; base class T1(T:! type) { //@dump-sem-ir-begin - virtual fn F[unused self: Self](unused t: T) { } + virtual fn F(unused self, unused t: T) { } //@dump-sem-ir-end } @@ -384,14 +384,14 @@ fn F(b: Modifiers.Base); library "[[@TEST_NAME]]"; base class NonGenericBase { - virtual fn F1[unused self: Self]() { } - virtual fn F2[unused self: Self]() { } + virtual fn F1(unused self) { } + virtual fn F2(unused self) { } } base class GenericDerived(T:! type) { extend base: NonGenericBase; - override fn F2[unused self: Self]() { } - virtual fn F3[unused self: Self]() { } + override fn F2(unused self) { } + virtual fn F3(unused self) { } } // --- nongeneric_derived_from_generic.carbon @@ -399,16 +399,16 @@ base class GenericDerived(T:! type) { library "[[@TEST_NAME]]"; base class GenericBase(T:! type) { - virtual fn F1[unused self: Self]() { } - virtual fn F2[unused self: Self]() { } + virtual fn F1(unused self) { } + virtual fn F2(unused self) { } } class T1; base class NonGenericDerived { extend base: GenericBase(T1); - override fn F2[unused self: Self]() { } - virtual fn F3[unused self: Self]() { } + override fn F2(unused self) { } + virtual fn F3(unused self) { } } // --- impl_generic_specifically.carbon @@ -416,13 +416,13 @@ base class NonGenericDerived { library "[[@TEST_NAME]]"; base class Base(T:! type) { - virtual fn F[unused self: Self](unused t: Base(T)*) { } + virtual fn F(unused self, unused t: Base(T)*) { } } class T1; class D1 { extend base: Base(T1); //@dump-sem-ir-begin - override fn F[unused self: Self](unused t: Base(T1)*) { } + override fn F(unused self, unused t: Base(T1)*) { } //@dump-sem-ir-end } @@ -434,25 +434,25 @@ class T1; class T2; base class Base(T:! type) { - // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+6]]:42: error: cannot implicitly convert expression of type `T1*` to `T2*` [ConversionFailure] - // CHECK:STDERR: virtual fn F[unused self: Self](unused t: T1*) { } - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+3]]:42: note: type `T1*` does not implement interface `Core.ImplicitAs(T2*)` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: virtual fn F[unused self: Self](unused t: T1*) { } - // CHECK:STDERR: ^~~~~~ - virtual fn F[unused self: Self](unused t: T1*) { } + // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+6]]:36: error: cannot implicitly convert expression of type `T1*` to `T2*` [ConversionFailure] + // CHECK:STDERR: virtual fn F(unused self, unused t: T1*) { } + // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+3]]:36: note: type `T1*` does not implement interface `Core.ImplicitAs(T2*)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: virtual fn F(unused self, unused t: T1*) { } + // CHECK:STDERR: ^~~~~~ + virtual fn F(unused self, unused t: T1*) { } } class D1 { extend base: Base(T1); - // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+7]]:43: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: override fn F[unused self: Self](unused t: T2*) { } - // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE+7]]:37: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: override fn F(unused self, unused t: T2*) { } + // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_impl_generic_specifically_mismatch.carbon:[[@LINE-8]]:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: virtual fn F[unused self: Self](unused t: T1*) { } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: virtual fn F(unused self, unused t: T1*) { } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - override fn F[unused self: Self](unused t: T2*) { } + override fn F(unused self, unused t: T2*) { } } // --- fail_impl_generic_generic_mismatch.carbon @@ -460,24 +460,24 @@ class D1 { library "[[@TEST_NAME]]"; abstract class Base(T:! type) { - // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+6]]:42: error: cannot implicitly convert expression of type `T*` to `T` [ConversionFailure] - // CHECK:STDERR: virtual fn F[unused self: Self](unused t: T*) { } - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+3]]:42: note: type `T*` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: virtual fn F[unused self: Self](unused t: T*) { } - // CHECK:STDERR: ^~~~~ - virtual fn F[unused self: Self](unused t: T*) { } + // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+6]]:36: error: cannot implicitly convert expression of type `T*` to `T` [ConversionFailure] + // CHECK:STDERR: virtual fn F(unused self, unused t: T*) { } + // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+3]]:36: note: type `T*` does not implement interface `Core.ImplicitAs(T)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: virtual fn F(unused self, unused t: T*) { } + // CHECK:STDERR: ^~~~~ + virtual fn F(unused self, unused t: T*) { } } class Derived(T:! type) { extend base: Base(T); - // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+7]]:43: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: override fn F[unused self: Self](unused t: T) { } - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE+7]]:37: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: override fn F(unused self, unused t: T) { } + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_impl_generic_generic_mismatch.carbon:[[@LINE-7]]:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: virtual fn F[unused self: Self](unused t: T*) { } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: virtual fn F(unused self, unused t: T*) { } + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - override fn F[unused self: Self](unused t: T) { } + override fn F(unused self, unused t: T) { } } // --- impl_generic_generic.carbon @@ -485,12 +485,12 @@ class Derived(T:! type) { library "[[@TEST_NAME]]"; abstract class Base(T:! type) { - virtual fn F[unused self: Self](unused t: T) { } + virtual fn F(unused self, unused t: T) { } } class Derived(T:! type) { extend base: Base(T*); //@dump-sem-ir-begin - override fn F[unused self: Self](unused t: T*) { } + override fn F(unused self, unused t: T*) { } //@dump-sem-ir-end } @@ -499,14 +499,14 @@ class Derived(T:! type) { library "[[@TEST_NAME]]"; abstract class Base(T:! type) { - abstract fn F[self: Self](); + abstract fn F(self); } class T1; class Derived { extend base: Base(T1); - override fn F[unused self: Self]() { } + override fn F(unused self) { } } // --- generic_lib.carbon @@ -514,7 +514,7 @@ class Derived { library "[[@TEST_NAME]]"; base class Base(T:! type) { - virtual fn F[unused self: Self]() { } + virtual fn F(unused self) { } } // --- generic_import.carbon @@ -531,7 +531,7 @@ var v: Base(T1) = {}; library "[[@TEST_NAME]]"; base class T1(G1:! type) { - virtual fn F[unused self: Self]() { } + virtual fn F(unused self) { } } class T2(G2:! type) { @@ -543,7 +543,7 @@ class T2(G2:! type) { library "[[@TEST_NAME]]"; base class T1(G1:! type) { - virtual fn F[unused self: Self]() { } + virtual fn F(unused self) { } } class T2(G2:! type) { @@ -552,6 +552,7 @@ class T2(G2:! type) { } } + // CHECK:STDOUT: --- modifiers.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -648,12 +649,12 @@ class T2(G2:! type) { // CHECK:STDOUT: %struct_type.vptr: type = struct_type {.: %ptr.454} [concrete] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [concrete] // CHECK:STDOUT: %pattern_type.746: type = pattern_type %Derived [concrete] -// CHECK:STDOUT: %Derived.H.type.1f42d4.1: type = fn_type @Derived.H.loc9_30.1 [concrete] +// CHECK:STDOUT: %Derived.H.type.1f42d4.1: type = fn_type @Derived.H.loc9_22.1 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Derived.H.a6796b.1: %Derived.H.type.1f42d4.1 = struct_value () [concrete] // CHECK:STDOUT: %Base.H.type: type = fn_type @Base.H [concrete] // CHECK:STDOUT: %Base.H: %Base.H.type = struct_value () [concrete] -// CHECK:STDOUT: %Derived.H.type.1f42d4.2: type = fn_type @Derived.H.loc9_30.2 [concrete] +// CHECK:STDOUT: %Derived.H.type.1f42d4.2: type = fn_type @Derived.H.loc9_22.2 [concrete] // CHECK:STDOUT: %Derived.H.a6796b.2: %Derived.H.type.1f42d4.2 = struct_value () [concrete] // CHECK:STDOUT: %Derived.vtable_decl: ref %ptr.454 = vtable_decl @Derived.vtable [concrete] // CHECK:STDOUT: %struct_type.base.507: type = struct_type {.base: %Base} [concrete] @@ -689,7 +690,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Modifiers.ref: = name_ref Modifiers, imports.%Modifiers [concrete = imports.%Modifiers] // CHECK:STDOUT: %Base.ref: type = name_ref Base, imports.%Modifiers.Base [concrete = constants.%Base] // CHECK:STDOUT: %.loc8: %Derived.elem = base_decl %Base.ref, element0 [concrete] -// CHECK:STDOUT: %Derived.H.decl.loc9_30.1: %Derived.H.type.1f42d4.1 = fn_decl @Derived.H.loc9_30.1 [concrete = constants.%Derived.H.a6796b.1] { +// CHECK:STDOUT: %Derived.H.decl.loc9_22.1: %Derived.H.type.1f42d4.1 = fn_decl @Derived.H.loc9_22.1 [concrete = constants.%Derived.H.a6796b.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.746 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.746 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { @@ -697,7 +698,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [concrete = constants.%Derived] // CHECK:STDOUT: %self: %Derived = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Derived.H.decl.loc9_30.2: %Derived.H.type.1f42d4.2 = fn_decl @Derived.H.loc9_30.2 [concrete = constants.%Derived.H.a6796b.2] { +// CHECK:STDOUT: %Derived.H.decl.loc9_22.2: %Derived.H.type.1f42d4.2 = fn_decl @Derived.H.loc9_22.2 [concrete = constants.%Derived.H.a6796b.2] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -711,7 +712,7 @@ class T2(G2:! type) { // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .Modifiers = // CHECK:STDOUT: .base = %.loc8 -// CHECK:STDOUT: .H [hidden] = %Derived.H.decl.loc9_30.1 +// CHECK:STDOUT: .H [hidden] = %Derived.H.decl.loc9_22.1 // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: } // CHECK:STDOUT: @@ -720,19 +721,19 @@ class T2(G2:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: vtable @Derived.vtable { -// CHECK:STDOUT: @Derived.%Derived.H.decl.loc9_30.2 +// CHECK:STDOUT: @Derived.%Derived.H.decl.loc9_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: override fn @Derived.H.loc9_30.1(%self.param: %Derived); +// CHECK:STDOUT: override fn @Derived.H.loc9_22.1(%self.param: %Derived); // CHECK:STDOUT: -// CHECK:STDOUT: override fn @Derived.H.loc9_30.2(%self.param: %Base) [thunk @Derived.%Derived.H.decl.loc9_30.1 for imports.%Base.H.decl] { +// CHECK:STDOUT: override fn @Derived.H.loc9_22.2(%self.param: %Base) [thunk @Derived.%Derived.H.decl.loc9_22.1 for imports.%Base.H.decl] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %H.ref: %Derived.H.type.1f42d4.1 = name_ref H, @Derived.%Derived.H.decl.loc9_30.1 [concrete = constants.%Derived.H.a6796b.1] +// CHECK:STDOUT: %H.ref: %Derived.H.type.1f42d4.1 = name_ref H, @Derived.%Derived.H.decl.loc9_22.1 [concrete = constants.%Derived.H.a6796b.1] // CHECK:STDOUT: -// CHECK:STDOUT: %.loc9_30.1: ref %Derived = enclosing_class_access %.1, element0 -// CHECK:STDOUT: %.loc9_30.2: %Derived = acquire_value %.loc9_30.1 -// CHECK:STDOUT: %Derived.H.bound: = bound_method %.loc9_30.2, %H.ref -// CHECK:STDOUT: %Derived.H.call: init %empty_tuple.type = call %Derived.H.bound(%.loc9_30.2) +// CHECK:STDOUT: %.loc9_22.1: ref %Derived = enclosing_class_access %.1, element0 +// CHECK:STDOUT: %.loc9_22.2: %Derived = acquire_value %.loc9_22.1 +// CHECK:STDOUT: %Derived.H.bound: = bound_method %.loc9_22.2, %H.ref +// CHECK:STDOUT: %Derived.H.call: init %empty_tuple.type = call %Derived.H.bound(%.loc9_22.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1020,15 +1021,15 @@ class T2(G2:! type) { // CHECK:STDOUT: %AbstractIntermediate: type = class_type @AbstractIntermediate [concrete] // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] // CHECK:STDOUT: %pattern_type.746: type = pattern_type %Derived [concrete] -// CHECK:STDOUT: %Derived.F.type.48cdab.1: type = fn_type @Derived.F.loc15_30.1 [concrete] +// CHECK:STDOUT: %Derived.F.type.48cdab.1: type = fn_type @Derived.F.loc15_22.1 [concrete] // CHECK:STDOUT: %Derived.F.bd5be1.1: %Derived.F.type.48cdab.1 = struct_value () [concrete] -// CHECK:STDOUT: %Derived.F.type.48cdab.2: type = fn_type @Derived.F.loc15_30.2 [concrete] +// CHECK:STDOUT: %Derived.F.type.48cdab.2: type = fn_type @Derived.F.loc15_22.2 [concrete] // CHECK:STDOUT: %Derived.F.bd5be1.2: %Derived.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: -// CHECK:STDOUT: %Derived.F.decl.loc15_30.1: %Derived.F.type.48cdab.1 = fn_decl @Derived.F.loc15_30.1 [concrete = constants.%Derived.F.bd5be1.1] { +// CHECK:STDOUT: %Derived.F.decl.loc15_22.1: %Derived.F.type.48cdab.1 = fn_decl @Derived.F.loc15_22.1 [concrete = constants.%Derived.F.bd5be1.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.746 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.746 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { @@ -1036,7 +1037,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [concrete = constants.%Derived] // CHECK:STDOUT: %self: %Derived = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Derived.F.decl.loc15_30.2: %Derived.F.type.48cdab.2 = fn_decl @Derived.F.loc15_30.2 [concrete = constants.%Derived.F.bd5be1.2] { +// CHECK:STDOUT: %Derived.F.decl.loc15_22.2: %Derived.F.type.48cdab.2 = fn_decl @Derived.F.loc15_22.2 [concrete = constants.%Derived.F.bd5be1.2] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -1049,7 +1050,7 @@ class T2(G2:! type) { // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .AbstractIntermediate = // CHECK:STDOUT: .base = %.loc13 -// CHECK:STDOUT: .F [hidden] = %Derived.F.decl.loc15_30.1 +// CHECK:STDOUT: .F [hidden] = %Derived.F.decl.loc15_22.1 // CHECK:STDOUT: extend %AbstractIntermediate.ref // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1062,20 +1063,20 @@ class T2(G2:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: vtable @Derived.vtable { -// CHECK:STDOUT: @Derived.%Derived.F.decl.loc15_30.2 +// CHECK:STDOUT: @Derived.%Derived.F.decl.loc15_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: override fn @Derived.F.loc15_30.1(%self.param: %Derived); +// CHECK:STDOUT: override fn @Derived.F.loc15_22.1(%self.param: %Derived); // CHECK:STDOUT: -// CHECK:STDOUT: override fn @Derived.F.loc15_30.2(%self.param: %AbstractBase) [thunk @Derived.%Derived.F.decl.loc15_30.1 for @AbstractBase.%AbstractBase.F.decl] { +// CHECK:STDOUT: override fn @Derived.F.loc15_22.2(%self.param: %AbstractBase) [thunk @Derived.%Derived.F.decl.loc15_22.1 for @AbstractBase.%AbstractBase.F.decl] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc15_30.1 [concrete = constants.%Derived.F.bd5be1.1] +// CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc15_22.1 [concrete = constants.%Derived.F.bd5be1.1] // CHECK:STDOUT: -// CHECK:STDOUT: %.loc15_30.1: ref %AbstractIntermediate = enclosing_class_access %.loc5, element0 -// CHECK:STDOUT: %.loc15_30.2: ref %Derived = enclosing_class_access %.loc15_30.1, element0 -// CHECK:STDOUT: %.loc15_30.3: %Derived = acquire_value %.loc15_30.2 -// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc15_30.3, %F.ref -// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %Derived.F.bound(%.loc15_30.3) +// CHECK:STDOUT: %.loc15_22.1: ref %AbstractIntermediate = enclosing_class_access %.loc5, element0 +// CHECK:STDOUT: %.loc15_22.2: ref %Derived = enclosing_class_access %.loc15_22.1, element0 +// CHECK:STDOUT: %.loc15_22.3: %Derived = acquire_value %.loc15_22.2 +// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc15_22.3, %F.ref +// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %Derived.F.bound(%.loc15_22.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1089,15 +1090,15 @@ class T2(G2:! type) { // CHECK:STDOUT: %VirtualIntermediate: type = class_type @VirtualIntermediate [concrete] // CHECK:STDOUT: %Derived: type = class_type @Derived [concrete] // CHECK:STDOUT: %pattern_type.746: type = pattern_type %Derived [concrete] -// CHECK:STDOUT: %Derived.F.type.48cdab.1: type = fn_type @Derived.F.loc15_30.1 [concrete] +// CHECK:STDOUT: %Derived.F.type.48cdab.1: type = fn_type @Derived.F.loc15_22.1 [concrete] // CHECK:STDOUT: %Derived.F.bd5be1.1: %Derived.F.type.48cdab.1 = struct_value () [concrete] -// CHECK:STDOUT: %Derived.F.type.48cdab.2: type = fn_type @Derived.F.loc15_30.2 [concrete] +// CHECK:STDOUT: %Derived.F.type.48cdab.2: type = fn_type @Derived.F.loc15_22.2 [concrete] // CHECK:STDOUT: %Derived.F.bd5be1.2: %Derived.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: -// CHECK:STDOUT: %Derived.F.decl.loc15_30.1: %Derived.F.type.48cdab.1 = fn_decl @Derived.F.loc15_30.1 [concrete = constants.%Derived.F.bd5be1.1] { +// CHECK:STDOUT: %Derived.F.decl.loc15_22.1: %Derived.F.type.48cdab.1 = fn_decl @Derived.F.loc15_22.1 [concrete = constants.%Derived.F.bd5be1.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.746 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.746 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { @@ -1105,7 +1106,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Derived [concrete = constants.%Derived] // CHECK:STDOUT: %self: %Derived = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Derived.F.decl.loc15_30.2: %Derived.F.type.48cdab.2 = fn_decl @Derived.F.loc15_30.2 [concrete = constants.%Derived.F.bd5be1.2] { +// CHECK:STDOUT: %Derived.F.decl.loc15_22.2: %Derived.F.type.48cdab.2 = fn_decl @Derived.F.loc15_22.2 [concrete = constants.%Derived.F.bd5be1.2] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -1118,7 +1119,7 @@ class T2(G2:! type) { // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .VirtualIntermediate = // CHECK:STDOUT: .base = %.loc13 -// CHECK:STDOUT: .F [hidden] = %Derived.F.decl.loc15_30.1 +// CHECK:STDOUT: .F [hidden] = %Derived.F.decl.loc15_22.1 // CHECK:STDOUT: extend %VirtualIntermediate.ref // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1131,20 +1132,20 @@ class T2(G2:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: vtable @Derived.vtable { -// CHECK:STDOUT: @Derived.%Derived.F.decl.loc15_30.2 +// CHECK:STDOUT: @Derived.%Derived.F.decl.loc15_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: override fn @Derived.F.loc15_30.1(%self.param: %Derived); +// CHECK:STDOUT: override fn @Derived.F.loc15_22.1(%self.param: %Derived); // CHECK:STDOUT: -// CHECK:STDOUT: override fn @Derived.F.loc15_30.2(%self.param: %VirtualBase) [thunk @Derived.%Derived.F.decl.loc15_30.1 for @VirtualBase.%VirtualBase.F.decl] { +// CHECK:STDOUT: override fn @Derived.F.loc15_22.2(%self.param: %VirtualBase) [thunk @Derived.%Derived.F.decl.loc15_22.1 for @VirtualBase.%VirtualBase.F.decl] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc15_30.1 [concrete = constants.%Derived.F.bd5be1.1] +// CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc15_22.1 [concrete = constants.%Derived.F.bd5be1.1] // CHECK:STDOUT: -// CHECK:STDOUT: %.loc15_30.1: ref %VirtualIntermediate = enclosing_class_access %.loc5, element0 -// CHECK:STDOUT: %.loc15_30.2: ref %Derived = enclosing_class_access %.loc15_30.1, element0 -// CHECK:STDOUT: %.loc15_30.3: %Derived = acquire_value %.loc15_30.2 -// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc15_30.3, %F.ref -// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %Derived.F.bound(%.loc15_30.3) +// CHECK:STDOUT: %.loc15_22.1: ref %VirtualIntermediate = enclosing_class_access %.loc5, element0 +// CHECK:STDOUT: %.loc15_22.2: ref %Derived = enclosing_class_access %.loc15_22.1, element0 +// CHECK:STDOUT: %.loc15_22.3: %Derived = acquire_value %.loc15_22.2 +// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc15_22.3, %F.ref +// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %Derived.F.bound(%.loc15_22.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1169,13 +1170,13 @@ class T2(G2:! type) { // CHECK:STDOUT: %Derived.F.type.48cdab.2: type = fn_type @Derived.F.loc23 [concrete] // CHECK:STDOUT: %Derived.F.bd5be1.2: %Derived.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: %.fd2: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.00a, %ImplicitAs.facet [concrete] -// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc23_36.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc23_28.2 [concrete] // CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: -// CHECK:STDOUT: %Derived.F.decl.loc23_36.1: %Derived.F.type.48cdab.1 = fn_decl @Derived.F.loc27 [concrete = constants.%Derived.F.bd5be1.1] { +// CHECK:STDOUT: %Derived.F.decl.loc23_28.1: %Derived.F.type.48cdab.1 = fn_decl @Derived.F.loc27 [concrete = constants.%Derived.F.bd5be1.1] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: %T2.ref.loc23: type = name_ref T2, file.%T2.decl [concrete = constants.%T2] @@ -1187,7 +1188,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %return.loc23: ref %T2 = return_slot %return.param.loc23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %Derived.F.decl.loc23_36.2: %Derived.F.type.48cdab.2 = fn_decl @Derived.F.loc23 [concrete = constants.%Derived.F.bd5be1.2] { +// CHECK:STDOUT: %Derived.F.decl.loc23_28.2: %Derived.F.type.48cdab.2 = fn_decl @Derived.F.loc23 [concrete = constants.%Derived.F.bd5be1.2] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -1201,7 +1202,7 @@ class T2(G2:! type) { // CHECK:STDOUT: .Base = // CHECK:STDOUT: .base = %.loc21 // CHECK:STDOUT: .T2 = -// CHECK:STDOUT: .F [hidden] = %Derived.F.decl.loc23_36.1 +// CHECK:STDOUT: .F [hidden] = %Derived.F.decl.loc23_28.1 // CHECK:STDOUT: extend %Base.ref // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1210,33 +1211,33 @@ class T2(G2:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: vtable @Derived.vtable { -// CHECK:STDOUT: @Derived.%Derived.F.decl.loc23_36.2 +// CHECK:STDOUT: @Derived.%Derived.F.decl.loc23_28.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: override fn @Derived.F.loc23(%self.param: %Base) -> out %return.param: %T1 [thunk @Derived.%Derived.F.decl.loc23_36.1 for @Base.%Base.F.decl] { +// CHECK:STDOUT: override fn @Derived.F.loc23(%self.param: %Base) -> out %return.param: %T1 [thunk @Derived.%Derived.F.decl.loc23_28.1 for @Base.%Base.F.decl] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc23_36.1 [concrete = constants.%Derived.F.bd5be1.1] +// CHECK:STDOUT: %F.ref: %Derived.F.type.48cdab.1 = name_ref F, @Derived.%Derived.F.decl.loc23_28.1 [concrete = constants.%Derived.F.bd5be1.1] // CHECK:STDOUT: -// CHECK:STDOUT: %.loc23_36.1: ref %Derived = enclosing_class_access %.loc17_20, element0 -// CHECK:STDOUT: %.loc23_36.2: %Derived = acquire_value %.loc23_36.1 -// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc23_36.2, %F.ref -// CHECK:STDOUT: %.loc23_36.3: ref %T2 = temporary_storage -// CHECK:STDOUT: %Derived.F.call: init %T2 to %.loc23_36.3 = call %Derived.F.bound(%.loc23_36.2) +// CHECK:STDOUT: %.loc23_28.1: ref %Derived = enclosing_class_access %.loc17_16, element0 +// CHECK:STDOUT: %.loc23_28.2: %Derived = acquire_value %.loc23_28.1 +// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc23_28.2, %F.ref +// CHECK:STDOUT: %.loc23_28.3: ref %T2 = temporary_storage +// CHECK:STDOUT: %Derived.F.call: init %T2 to %.loc23_28.3 = call %Derived.F.bound(%.loc23_28.2) // CHECK:STDOUT: %impl.elem0: %.fd2 = impl_witness_access constants.%ImplicitAs.impl_witness, element0 [concrete = constants.%T2.as.ImplicitAs.impl.Convert] // CHECK:STDOUT: %bound_method: = bound_method %Derived.F.call, %impl.elem0 // CHECK:STDOUT: -// CHECK:STDOUT: %.loc23_36.4: ref %T2 = temporary %.loc23_36.3, %Derived.F.call -// CHECK:STDOUT: %.loc23_36.5: %T2 = acquire_value %.loc23_36.4 -// CHECK:STDOUT: %T2.as.ImplicitAs.impl.Convert.call: init %T1 to %.loc17_33 = call %bound_method(%.loc23_36.5) -// CHECK:STDOUT: %.loc23_36.6: init %T1 = converted %Derived.F.call, %T2.as.ImplicitAs.impl.Convert.call -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc23_36.4, constants.%Destroy.Op.1a2547.2 -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc23_36.4) -// CHECK:STDOUT: return %.loc23_36.6 to %return.param +// CHECK:STDOUT: %.loc23_28.4: ref %T2 = temporary %.loc23_28.3, %Derived.F.call +// CHECK:STDOUT: %.loc23_28.5: %T2 = acquire_value %.loc23_28.4 +// CHECK:STDOUT: %T2.as.ImplicitAs.impl.Convert.call: init %T1 to %.loc17_25 = call %bound_method(%.loc23_28.5) +// CHECK:STDOUT: %.loc23_28.6: init %T1 = converted %Derived.F.call, %T2.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc23_28.4, constants.%Destroy.Op.1a2547.2 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc23_28.4) +// CHECK:STDOUT: return %.loc23_28.6 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc23_36.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: fn @Destroy.Op.loc23_28.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.Op.loc23_36.2(%self.param: ref %T2) { +// CHECK:STDOUT: fn @Destroy.Op.loc23_28.2(%self.param: ref %T2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1267,9 +1268,9 @@ class T2(G2:! type) { // CHECK:STDOUT: %self.patt: @T1.F.%pattern_type (%pattern_type.c79) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T1.F.%T1 (%T1) = value_param call_param0 -// CHECK:STDOUT: %.loc6_29.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1)] { -// CHECK:STDOUT: %.loc6_29.2: type = specific_constant constants.%T1, @T1(constants.%T) [symbolic = %T1 (constants.%T1)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_29.2 [symbolic = %T1 (constants.%T1)] +// CHECK:STDOUT: %.loc6_23.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1)] { +// CHECK:STDOUT: %.loc6_23.2: type = specific_constant constants.%T1, @T1(constants.%T) [symbolic = %T1 (constants.%T1)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_23.2 [symbolic = %T1 (constants.%T1)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @T1.F.%T1 (%T1) = value_binding self, %self.param // CHECK:STDOUT: } @@ -1343,15 +1344,15 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T1.F.decl: @T1.%T1.F.type (%T1.F.type) = fn_decl @T1.F [symbolic = @T1.%T1.F (constants.%T1.F)] { -// CHECK:STDOUT: %self.param_patt: @T1.F.%pattern_type.loc6_27 (%pattern_type.c79) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @T1.F.%pattern_type.loc6_27 (%pattern_type.c79) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %t.param_patt: @T1.F.%pattern_type.loc6_43 (%pattern_type.51d) = value_param_pattern [concrete] -// CHECK:STDOUT: %t.patt: @T1.F.%pattern_type.loc6_43 (%pattern_type.51d) = at_binding_pattern t, %t.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @T1.F.%pattern_type.loc6_23 (%pattern_type.c79) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @T1.F.%pattern_type.loc6_23 (%pattern_type.c79) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %t.param_patt: @T1.F.%pattern_type.loc6_37 (%pattern_type.51d) = value_param_pattern [concrete] +// CHECK:STDOUT: %t.patt: @T1.F.%pattern_type.loc6_37 (%pattern_type.51d) = at_binding_pattern t, %t.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @T1.F.%T1 (%T1) = value_param call_param0 -// CHECK:STDOUT: %.loc6_29.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1)] { -// CHECK:STDOUT: %.loc6_29.2: type = specific_constant constants.%T1, @T1(constants.%T) [symbolic = %T1 (constants.%T1)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_29.2 [symbolic = %T1 (constants.%T1)] +// CHECK:STDOUT: %.loc6_23.1: type = splice_block %Self.ref [symbolic = %T1 (constants.%T1)] { +// CHECK:STDOUT: %.loc6_23.2: type = specific_constant constants.%T1, @T1(constants.%T) [symbolic = %T1 (constants.%T1)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc6_23.2 [symbolic = %T1 (constants.%T1)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @T1.F.%T1 (%T1) = value_binding self, %self.param // CHECK:STDOUT: %t.param: @T1.F.%T (%T) = value_param call_param1 @@ -1376,12 +1377,12 @@ class T2(G2:! type) { // CHECK:STDOUT: generic virtual fn @T1.F(@T1.%T.loc4_16.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T1: type = class_type @T1, @T1(%T) [symbolic = %T1 (constants.%T1)] -// CHECK:STDOUT: %pattern_type.loc6_27: type = pattern_type %T1 [symbolic = %pattern_type.loc6_27 (constants.%pattern_type.c79)] -// CHECK:STDOUT: %pattern_type.loc6_43: type = pattern_type %T [symbolic = %pattern_type.loc6_43 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %pattern_type.loc6_23: type = pattern_type %T1 [symbolic = %pattern_type.loc6_23 (constants.%pattern_type.c79)] +// CHECK:STDOUT: %pattern_type.loc6_37: type = pattern_type %T [symbolic = %pattern_type.loc6_37 (constants.%pattern_type.51d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc6_27: = require_complete_type %T1 [symbolic = %require_complete.loc6_27 (constants.%require_complete.ce3)] -// CHECK:STDOUT: %require_complete.loc6_43: = require_complete_type %T [symbolic = %require_complete.loc6_43 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc6_23: = require_complete_type %T1 [symbolic = %require_complete.loc6_23 (constants.%require_complete.ce3)] +// CHECK:STDOUT: %require_complete.loc6_37: = require_complete_type %T [symbolic = %require_complete.loc6_37 (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: virtual fn(%self.param: @T1.F.%T1 (%T1), %t.param: @T1.F.%T (%T)) { // CHECK:STDOUT: !entry: @@ -1401,12 +1402,12 @@ class T2(G2:! type) { // CHECK:STDOUT: specific @T1.F(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %T1 => constants.%T1 -// CHECK:STDOUT: %pattern_type.loc6_27 => constants.%pattern_type.c79 -// CHECK:STDOUT: %pattern_type.loc6_43 => constants.%pattern_type.51d +// CHECK:STDOUT: %pattern_type.loc6_23 => constants.%pattern_type.c79 +// CHECK:STDOUT: %pattern_type.loc6_37 => constants.%pattern_type.51d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc6_27 => constants.%require_complete.ce3 -// CHECK:STDOUT: %require_complete.loc6_43 => constants.%require_complete.944 +// CHECK:STDOUT: %require_complete.loc6_23 => constants.%require_complete.ce3 +// CHECK:STDOUT: %require_complete.loc6_37 => constants.%require_complete.944 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- impl_generic_specifically.carbon @@ -1421,15 +1422,15 @@ class T2(G2:! type) { // CHECK:STDOUT: %ptr.2ee: type = ptr_type %Base.5b2 [concrete] // CHECK:STDOUT: %pattern_type.e0f: type = pattern_type %ptr.2ee [concrete] // CHECK:STDOUT: %pattern_type.c35: type = pattern_type %D1 [concrete] -// CHECK:STDOUT: %D1.F.type.48cdab.1: type = fn_type @D1.F.loc11_57.1 [concrete] +// CHECK:STDOUT: %D1.F.type.48cdab.1: type = fn_type @D1.F.loc11_51.1 [concrete] // CHECK:STDOUT: %D1.F.bd5be1.1: %D1.F.type.48cdab.1 = struct_value () [concrete] -// CHECK:STDOUT: %D1.F.type.48cdab.2: type = fn_type @D1.F.loc11_57.2 [concrete] +// CHECK:STDOUT: %D1.F.type.48cdab.2: type = fn_type @D1.F.loc11_51.2 [concrete] // CHECK:STDOUT: %D1.F.bd5be1.2: %D1.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D1 { // CHECK:STDOUT: -// CHECK:STDOUT: %D1.F.decl.loc11_57.1: %D1.F.type.48cdab.1 = fn_decl @D1.F.loc11_57.1 [concrete = constants.%D1.F.bd5be1.1] { +// CHECK:STDOUT: %D1.F.decl.loc11_51.1: %D1.F.type.48cdab.1 = fn_decl @D1.F.loc11_51.1 [concrete = constants.%D1.F.bd5be1.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.c35 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.c35 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %t.param_patt: %pattern_type.e0f = value_param_pattern [concrete] @@ -1447,7 +1448,7 @@ class T2(G2:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %t: %ptr.2ee = value_binding t, %t.param // CHECK:STDOUT: } -// CHECK:STDOUT: %D1.F.decl.loc11_57.2: %D1.F.type.48cdab.2 = fn_decl @D1.F.loc11_57.2 [concrete = constants.%D1.F.bd5be1.2] { +// CHECK:STDOUT: %D1.F.decl.loc11_51.2: %D1.F.type.48cdab.2 = fn_decl @D1.F.loc11_51.2 [concrete = constants.%D1.F.bd5be1.2] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -1461,7 +1462,7 @@ class T2(G2:! type) { // CHECK:STDOUT: .Base = // CHECK:STDOUT: .T1 = // CHECK:STDOUT: .base = %.loc9 -// CHECK:STDOUT: .F [hidden] = %D1.F.decl.loc11_57.1 +// CHECK:STDOUT: .F [hidden] = %D1.F.decl.loc11_51.1 // CHECK:STDOUT: extend %Base // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1470,22 +1471,22 @@ class T2(G2:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: vtable @D1.vtable { -// CHECK:STDOUT: @D1.%D1.F.decl.loc11_57.2 +// CHECK:STDOUT: @D1.%D1.F.decl.loc11_51.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: override fn @D1.F.loc11_57.1(%self.param: %D1, %t.param: %ptr.2ee) { +// CHECK:STDOUT: override fn @D1.F.loc11_51.1(%self.param: %D1, %t.param: %ptr.2ee) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: override fn @D1.F.loc11_57.2(%self.param: %Base.5b2, %t.param: %ptr.2ee) [thunk @D1.%D1.F.decl.loc11_57.1 for @Base.%Base.F.decl, @Base.F(constants.%T1)] { +// CHECK:STDOUT: override fn @D1.F.loc11_51.2(%self.param: %Base.5b2, %t.param: %ptr.2ee) [thunk @D1.%D1.F.decl.loc11_51.1 for @Base.%Base.F.decl, @Base.F(constants.%T1)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %D1.F.type.48cdab.1 = name_ref F, @D1.%D1.F.decl.loc11_57.1 [concrete = constants.%D1.F.bd5be1.1] +// CHECK:STDOUT: %F.ref: %D1.F.type.48cdab.1 = name_ref F, @D1.%D1.F.decl.loc11_51.1 [concrete = constants.%D1.F.bd5be1.1] // CHECK:STDOUT: -// CHECK:STDOUT: %.loc11_57.1: ref %D1 = enclosing_class_access %.loc5, element0 -// CHECK:STDOUT: %.loc11_57.2: %D1 = acquire_value %.loc11_57.1 -// CHECK:STDOUT: %D1.F.bound: = bound_method %.loc11_57.2, %F.ref -// CHECK:STDOUT: %D1.F.call: init %empty_tuple.type = call %D1.F.bound(%.loc11_57.2, %t.param) +// CHECK:STDOUT: %.loc11_51.1: ref %D1 = enclosing_class_access %.loc5, element0 +// CHECK:STDOUT: %.loc11_51.2: %D1 = acquire_value %.loc11_51.1 +// CHECK:STDOUT: %D1.F.bound: = bound_method %.loc11_51.2, %F.ref +// CHECK:STDOUT: %D1.F.call: init %empty_tuple.type = call %D1.F.bound(%.loc11_51.2, %t.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1502,16 +1503,16 @@ class T2(G2:! type) { // CHECK:STDOUT: %require_complete.29f: = require_complete_type %Base.99a [symbolic] // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base.99a [symbolic] // CHECK:STDOUT: %pattern_type.839: type = pattern_type %Derived [symbolic] -// CHECK:STDOUT: %Derived.F.type.77405e.1: type = fn_type @Derived.F.loc10_50.1, @Derived(%T) [symbolic] +// CHECK:STDOUT: %Derived.F.type.77405e.1: type = fn_type @Derived.F.loc10_44.1, @Derived(%T) [symbolic] // CHECK:STDOUT: %Derived.F.d85493.1: %Derived.F.type.77405e.1 = struct_value () [symbolic] -// CHECK:STDOUT: %Derived.F.type.77405e.2: type = fn_type @Derived.F.loc10_50.2, @Derived(%T) [symbolic] +// CHECK:STDOUT: %Derived.F.type.77405e.2: type = fn_type @Derived.F.loc10_44.2, @Derived(%T) [symbolic] // CHECK:STDOUT: %Derived.F.d85493.2: %Derived.F.type.77405e.2 = struct_value () [symbolic] -// CHECK:STDOUT: %Derived.F.specific_fn.822c1a.1: = specific_function %Derived.F.d85493.2, @Derived.F.loc10_50.2(%T) [symbolic] +// CHECK:STDOUT: %Derived.F.specific_fn.822c1a.1: = specific_function %Derived.F.d85493.2, @Derived.F.loc10_44.2(%T) [symbolic] // CHECK:STDOUT: %struct_type.base.619: type = struct_type {.base: %Base.99a} [symbolic] // CHECK:STDOUT: %complete_type.db5: = complete_type_witness %struct_type.base.619 [symbolic] // CHECK:STDOUT: %require_complete.1e7: = require_complete_type %Derived [symbolic] // CHECK:STDOUT: %require_complete.ef1: = require_complete_type %ptr.e8f [symbolic] -// CHECK:STDOUT: %Derived.F.specific_fn.822c1a.2: = specific_function %Derived.F.d85493.1, @Derived.F.loc10_50.1(%T) [symbolic] +// CHECK:STDOUT: %Derived.F.specific_fn.822c1a.2: = specific_function %Derived.F.d85493.1, @Derived.F.loc10_44.1(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Derived(%T.loc7_16.2: type) { @@ -1519,34 +1520,34 @@ class T2(G2:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Derived.F.type.loc10_50.1: type = fn_type @Derived.F.loc10_50.1, @Derived(%T.loc7_16.1) [symbolic = %Derived.F.type.loc10_50.1 (constants.%Derived.F.type.77405e.1)] -// CHECK:STDOUT: %Derived.F.loc10_50.1: @Derived.%Derived.F.type.loc10_50.1 (%Derived.F.type.77405e.1) = struct_value () [symbolic = %Derived.F.loc10_50.1 (constants.%Derived.F.d85493.1)] -// CHECK:STDOUT: %Derived.F.type.loc10_50.2: type = fn_type @Derived.F.loc10_50.2, @Derived(%T.loc7_16.1) [symbolic = %Derived.F.type.loc10_50.2 (constants.%Derived.F.type.77405e.2)] -// CHECK:STDOUT: %Derived.F.loc10_50.2: @Derived.%Derived.F.type.loc10_50.2 (%Derived.F.type.77405e.2) = struct_value () [symbolic = %Derived.F.loc10_50.2 (constants.%Derived.F.d85493.2)] +// CHECK:STDOUT: %Derived.F.type.loc10_44.1: type = fn_type @Derived.F.loc10_44.1, @Derived(%T.loc7_16.1) [symbolic = %Derived.F.type.loc10_44.1 (constants.%Derived.F.type.77405e.1)] +// CHECK:STDOUT: %Derived.F.loc10_44.1: @Derived.%Derived.F.type.loc10_44.1 (%Derived.F.type.77405e.1) = struct_value () [symbolic = %Derived.F.loc10_44.1 (constants.%Derived.F.d85493.1)] +// CHECK:STDOUT: %Derived.F.type.loc10_44.2: type = fn_type @Derived.F.loc10_44.2, @Derived(%T.loc7_16.1) [symbolic = %Derived.F.type.loc10_44.2 (constants.%Derived.F.type.77405e.2)] +// CHECK:STDOUT: %Derived.F.loc10_44.2: @Derived.%Derived.F.type.loc10_44.2 (%Derived.F.type.77405e.2) = struct_value () [symbolic = %Derived.F.loc10_44.2 (constants.%Derived.F.d85493.2)] // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: -// CHECK:STDOUT: %Derived.F.decl.loc10_50.1: @Derived.%Derived.F.type.loc10_50.1 (%Derived.F.type.77405e.1) = fn_decl @Derived.F.loc10_50.1 [symbolic = @Derived.%Derived.F.loc10_50.1 (constants.%Derived.F.d85493.1)] { -// CHECK:STDOUT: %self.param_patt: @Derived.F.loc10_50.1.%pattern_type.loc10_28 (%pattern_type.839) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Derived.F.loc10_50.1.%pattern_type.loc10_28 (%pattern_type.839) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %t.param_patt: @Derived.F.loc10_50.1.%pattern_type.loc10_44 (%pattern_type.4f4) = value_param_pattern [concrete] -// CHECK:STDOUT: %t.patt: @Derived.F.loc10_50.1.%pattern_type.loc10_44 (%pattern_type.4f4) = at_binding_pattern t, %t.param_patt [concrete] +// CHECK:STDOUT: %Derived.F.decl.loc10_44.1: @Derived.%Derived.F.type.loc10_44.1 (%Derived.F.type.77405e.1) = fn_decl @Derived.F.loc10_44.1 [symbolic = @Derived.%Derived.F.loc10_44.1 (constants.%Derived.F.d85493.1)] { +// CHECK:STDOUT: %self.param_patt: @Derived.F.loc10_44.1.%pattern_type.loc10_24 (%pattern_type.839) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Derived.F.loc10_44.1.%pattern_type.loc10_24 (%pattern_type.839) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %t.param_patt: @Derived.F.loc10_44.1.%pattern_type.loc10_38 (%pattern_type.4f4) = value_param_pattern [concrete] +// CHECK:STDOUT: %t.patt: @Derived.F.loc10_44.1.%pattern_type.loc10_38 (%pattern_type.4f4) = at_binding_pattern t, %t.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Derived.F.loc10_50.1.%Derived (%Derived) = value_param call_param0 -// CHECK:STDOUT: %.loc10_30.1: type = splice_block %Self.ref [symbolic = %Derived (constants.%Derived)] { -// CHECK:STDOUT: %.loc10_30.2: type = specific_constant constants.%Derived, @Derived(constants.%T) [symbolic = %Derived (constants.%Derived)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_30.2 [symbolic = %Derived (constants.%Derived)] +// CHECK:STDOUT: %self.param: @Derived.F.loc10_44.1.%Derived (%Derived) = value_param call_param0 +// CHECK:STDOUT: %.loc10_24.1: type = splice_block %Self.ref [symbolic = %Derived (constants.%Derived)] { +// CHECK:STDOUT: %.loc10_24.2: type = specific_constant constants.%Derived, @Derived(constants.%T) [symbolic = %Derived (constants.%Derived)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_24.2 [symbolic = %Derived (constants.%Derived)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Derived.F.loc10_50.1.%Derived (%Derived) = value_binding self, %self.param -// CHECK:STDOUT: %t.param: @Derived.F.loc10_50.1.%ptr.loc10_47.1 (%ptr.e8f) = value_param call_param1 -// CHECK:STDOUT: %.loc10_47: type = splice_block %ptr.loc10_47.2 [symbolic = %ptr.loc10_47.1 (constants.%ptr.e8f)] { +// CHECK:STDOUT: %self: @Derived.F.loc10_44.1.%Derived (%Derived) = value_binding self, %self.param +// CHECK:STDOUT: %t.param: @Derived.F.loc10_44.1.%ptr.loc10_41.1 (%ptr.e8f) = value_param call_param1 +// CHECK:STDOUT: %.loc10_41: type = splice_block %ptr.loc10_41.2 [symbolic = %ptr.loc10_41.1 (constants.%ptr.e8f)] { // CHECK:STDOUT: %T.ref: type = name_ref T, @Derived.%T.loc7_16.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %ptr.loc10_47.2: type = ptr_type %T.ref [symbolic = %ptr.loc10_47.1 (constants.%ptr.e8f)] +// CHECK:STDOUT: %ptr.loc10_41.2: type = ptr_type %T.ref [symbolic = %ptr.loc10_41.1 (constants.%ptr.e8f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %t: @Derived.F.loc10_50.1.%ptr.loc10_47.1 (%ptr.e8f) = value_binding t, %t.param +// CHECK:STDOUT: %t: @Derived.F.loc10_44.1.%ptr.loc10_41.1 (%ptr.e8f) = value_binding t, %t.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Derived.F.decl.loc10_50.2: @Derived.%Derived.F.type.loc10_50.2 (%Derived.F.type.77405e.2) = fn_decl @Derived.F.loc10_50.2 [symbolic = @Derived.%Derived.F.loc10_50.2 (constants.%Derived.F.d85493.2)] { +// CHECK:STDOUT: %Derived.F.decl.loc10_44.2: @Derived.%Derived.F.type.loc10_44.2 (%Derived.F.type.77405e.2) = fn_decl @Derived.F.loc10_44.2 [symbolic = @Derived.%Derived.F.loc10_44.2 (constants.%Derived.F.d85493.2)] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: @@ -1560,7 +1561,7 @@ class T2(G2:! type) { // CHECK:STDOUT: .Base = // CHECK:STDOUT: .T = // CHECK:STDOUT: .base = %.loc8 -// CHECK:STDOUT: .F [hidden] = %Derived.F.decl.loc10_50.1 +// CHECK:STDOUT: .F [hidden] = %Derived.F.decl.loc10_44.1 // CHECK:STDOUT: extend %Base.loc8_23.1 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1573,44 +1574,44 @@ class T2(G2:! type) { // CHECK:STDOUT: @Derived.%Derived.F.specific_fn.loc12_1.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic override fn @Derived.F.loc10_50.1(@Derived.%T.loc7_16.2: type) { +// CHECK:STDOUT: generic override fn @Derived.F.loc10_44.1(@Derived.%T.loc7_16.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(%T) [symbolic = %Derived (constants.%Derived)] -// CHECK:STDOUT: %pattern_type.loc10_28: type = pattern_type %Derived [symbolic = %pattern_type.loc10_28 (constants.%pattern_type.839)] -// CHECK:STDOUT: %ptr.loc10_47.1: type = ptr_type %T [symbolic = %ptr.loc10_47.1 (constants.%ptr.e8f)] -// CHECK:STDOUT: %pattern_type.loc10_44: type = pattern_type %ptr.loc10_47.1 [symbolic = %pattern_type.loc10_44 (constants.%pattern_type.4f4)] +// CHECK:STDOUT: %pattern_type.loc10_24: type = pattern_type %Derived [symbolic = %pattern_type.loc10_24 (constants.%pattern_type.839)] +// CHECK:STDOUT: %ptr.loc10_41.1: type = ptr_type %T [symbolic = %ptr.loc10_41.1 (constants.%ptr.e8f)] +// CHECK:STDOUT: %pattern_type.loc10_38: type = pattern_type %ptr.loc10_41.1 [symbolic = %pattern_type.loc10_38 (constants.%pattern_type.4f4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc10_28: = require_complete_type %Derived [symbolic = %require_complete.loc10_28 (constants.%require_complete.1e7)] -// CHECK:STDOUT: %require_complete.loc10_44: = require_complete_type %ptr.loc10_47.1 [symbolic = %require_complete.loc10_44 (constants.%require_complete.ef1)] +// CHECK:STDOUT: %require_complete.loc10_24: = require_complete_type %Derived [symbolic = %require_complete.loc10_24 (constants.%require_complete.1e7)] +// CHECK:STDOUT: %require_complete.loc10_38: = require_complete_type %ptr.loc10_41.1 [symbolic = %require_complete.loc10_38 (constants.%require_complete.ef1)] // CHECK:STDOUT: -// CHECK:STDOUT: override fn(%self.param: @Derived.F.loc10_50.1.%Derived (%Derived), %t.param: @Derived.F.loc10_50.1.%ptr.loc10_47.1 (%ptr.e8f)) { +// CHECK:STDOUT: override fn(%self.param: @Derived.F.loc10_44.1.%Derived (%Derived), %t.param: @Derived.F.loc10_44.1.%ptr.loc10_41.1 (%ptr.e8f)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic override fn @Derived.F.loc10_50.2(@Derived.%T.loc7_16.2: type) { +// CHECK:STDOUT: generic override fn @Derived.F.loc10_44.2(@Derived.%T.loc7_16.2: type) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Derived.F.type: type = fn_type @Derived.F.loc10_50.1, @Derived(%T) [symbolic = %Derived.F.type (constants.%Derived.F.type.77405e.1)] -// CHECK:STDOUT: %Derived.F: @Derived.F.loc10_50.2.%Derived.F.type (%Derived.F.type.77405e.1) = struct_value () [symbolic = %Derived.F (constants.%Derived.F.d85493.1)] +// CHECK:STDOUT: %Derived.F.type: type = fn_type @Derived.F.loc10_44.1, @Derived(%T) [symbolic = %Derived.F.type (constants.%Derived.F.type.77405e.1)] +// CHECK:STDOUT: %Derived.F: @Derived.F.loc10_44.2.%Derived.F.type (%Derived.F.type.77405e.1) = struct_value () [symbolic = %Derived.F (constants.%Derived.F.d85493.1)] // CHECK:STDOUT: %Derived: type = class_type @Derived, @Derived(%T) [symbolic = %Derived (constants.%Derived)] -// CHECK:STDOUT: %Derived.F.specific_fn.loc10_50.2: = specific_function %Derived.F, @Derived.F.loc10_50.1(%T) [symbolic = %Derived.F.specific_fn.loc10_50.2 (constants.%Derived.F.specific_fn.822c1a.2)] +// CHECK:STDOUT: %Derived.F.specific_fn.loc10_44.2: = specific_function %Derived.F, @Derived.F.loc10_44.1(%T) [symbolic = %Derived.F.specific_fn.loc10_44.2 (constants.%Derived.F.specific_fn.822c1a.2)] // CHECK:STDOUT: -// CHECK:STDOUT: override fn(%self.param: @Derived.F.loc10_50.2.%Base (%Base.99a), %t.param: @Derived.F.loc10_50.2.%ptr (%ptr.e8f)) [thunk @Derived.%Derived.F.decl.loc10_50.1 for @Base.%Base.F.decl, @Base.F(constants.%ptr.e8f)] { +// CHECK:STDOUT: override fn(%self.param: @Derived.F.loc10_44.2.%Base (%Base.99a), %t.param: @Derived.F.loc10_44.2.%ptr (%ptr.e8f)) [thunk @Derived.%Derived.F.decl.loc10_44.1 for @Base.%Base.F.decl, @Base.F(constants.%ptr.e8f)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_50.1: @Derived.F.loc10_50.2.%Derived.F.type (%Derived.F.type.77405e.1) = specific_constant @Derived.%Derived.F.decl.loc10_50.1, @Derived(constants.%T) [symbolic = %Derived.F (constants.%Derived.F.d85493.1)] -// CHECK:STDOUT: %F.ref: @Derived.F.loc10_50.2.%Derived.F.type (%Derived.F.type.77405e.1) = name_ref F, %.loc10_50.1 [symbolic = %Derived.F (constants.%Derived.F.d85493.1)] +// CHECK:STDOUT: %.loc10_44.1: @Derived.F.loc10_44.2.%Derived.F.type (%Derived.F.type.77405e.1) = specific_constant @Derived.%Derived.F.decl.loc10_44.1, @Derived(constants.%T) [symbolic = %Derived.F (constants.%Derived.F.d85493.1)] +// CHECK:STDOUT: %F.ref: @Derived.F.loc10_44.2.%Derived.F.type (%Derived.F.type.77405e.1) = name_ref F, %.loc10_44.1 [symbolic = %Derived.F (constants.%Derived.F.d85493.1)] // CHECK:STDOUT: -// CHECK:STDOUT: %.loc10_50.2: ref @Derived.F.loc10_50.2.%Derived (%Derived) = enclosing_class_access %.loc5, element0 -// CHECK:STDOUT: %.loc10_50.3: @Derived.F.loc10_50.2.%Derived (%Derived) = acquire_value %.loc10_50.2 -// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc10_50.3, %F.ref -// CHECK:STDOUT: %Derived.F.specific_fn.loc10_50.1: = specific_function %F.ref, @Derived.F.loc10_50.1(constants.%T) [symbolic = %Derived.F.specific_fn.loc10_50.2 (constants.%Derived.F.specific_fn.822c1a.2)] -// CHECK:STDOUT: %bound_method: = bound_method %.loc10_50.3, %Derived.F.specific_fn.loc10_50.1 -// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %bound_method(%.loc10_50.3, %t.param) +// CHECK:STDOUT: %.loc10_44.2: ref @Derived.F.loc10_44.2.%Derived (%Derived) = enclosing_class_access %.loc5, element0 +// CHECK:STDOUT: %.loc10_44.3: @Derived.F.loc10_44.2.%Derived (%Derived) = acquire_value %.loc10_44.2 +// CHECK:STDOUT: %Derived.F.bound: = bound_method %.loc10_44.3, %F.ref +// CHECK:STDOUT: %Derived.F.specific_fn.loc10_44.1: = specific_function %F.ref, @Derived.F.loc10_44.1(constants.%T) [symbolic = %Derived.F.specific_fn.loc10_44.2 (constants.%Derived.F.specific_fn.822c1a.2)] +// CHECK:STDOUT: %bound_method: = bound_method %.loc10_44.3, %Derived.F.specific_fn.loc10_44.1 +// CHECK:STDOUT: %Derived.F.call: init %empty_tuple.type = call %bound_method(%.loc10_44.3, %t.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1624,40 +1625,40 @@ class T2(G2:! type) { // CHECK:STDOUT: %require_complete => constants.%require_complete.29f // CHECK:STDOUT: %Derived => constants.%Derived // CHECK:STDOUT: %Derived.elem => constants.%Derived.elem -// CHECK:STDOUT: %Derived.F.type.loc10_50.1 => constants.%Derived.F.type.77405e.1 -// CHECK:STDOUT: %Derived.F.loc10_50.1 => constants.%Derived.F.d85493.1 -// CHECK:STDOUT: %Derived.F.type.loc10_50.2 => constants.%Derived.F.type.77405e.2 -// CHECK:STDOUT: %Derived.F.loc10_50.2 => constants.%Derived.F.d85493.2 +// CHECK:STDOUT: %Derived.F.type.loc10_44.1 => constants.%Derived.F.type.77405e.1 +// CHECK:STDOUT: %Derived.F.loc10_44.1 => constants.%Derived.F.d85493.1 +// CHECK:STDOUT: %Derived.F.type.loc10_44.2 => constants.%Derived.F.type.77405e.2 +// CHECK:STDOUT: %Derived.F.loc10_44.2 => constants.%Derived.F.d85493.2 // CHECK:STDOUT: %Derived.F.specific_fn.loc12_1.2 => constants.%Derived.F.specific_fn.822c1a.1 // CHECK:STDOUT: %struct_type.base => constants.%struct_type.base.619 // CHECK:STDOUT: %complete_type.loc12_1.2 => constants.%complete_type.db5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived.F.loc10_50.1(constants.%T) { +// CHECK:STDOUT: specific @Derived.F.loc10_44.1(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Derived => constants.%Derived -// CHECK:STDOUT: %pattern_type.loc10_28 => constants.%pattern_type.839 -// CHECK:STDOUT: %ptr.loc10_47.1 => constants.%ptr.e8f -// CHECK:STDOUT: %pattern_type.loc10_44 => constants.%pattern_type.4f4 +// CHECK:STDOUT: %pattern_type.loc10_24 => constants.%pattern_type.839 +// CHECK:STDOUT: %ptr.loc10_41.1 => constants.%ptr.e8f +// CHECK:STDOUT: %pattern_type.loc10_38 => constants.%pattern_type.4f4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc10_28 => constants.%require_complete.1e7 -// CHECK:STDOUT: %require_complete.loc10_44 => constants.%require_complete.ef1 +// CHECK:STDOUT: %require_complete.loc10_24 => constants.%require_complete.1e7 +// CHECK:STDOUT: %require_complete.loc10_38 => constants.%require_complete.ef1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Derived.F.loc10_50.2(constants.%T) { +// CHECK:STDOUT: specific @Derived.F.loc10_44.2(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %ptr => constants.%ptr.e8f // CHECK:STDOUT: %Base => constants.%Base.99a -// CHECK:STDOUT: %pattern_type.loc5_27 => constants.%pattern_type.bdc -// CHECK:STDOUT: %pattern_type.loc5_43 => constants.%pattern_type.4f4 +// CHECK:STDOUT: %pattern_type.loc5_23 => constants.%pattern_type.bdc +// CHECK:STDOUT: %pattern_type.loc5_37 => constants.%pattern_type.4f4 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc5_27 => constants.%require_complete.29f -// CHECK:STDOUT: %require_complete.loc5_43 => constants.%require_complete.ef1 +// CHECK:STDOUT: %require_complete.loc5_23 => constants.%require_complete.29f +// CHECK:STDOUT: %require_complete.loc5_37 => constants.%require_complete.ef1 // CHECK:STDOUT: %Derived.F.type => constants.%Derived.F.type.77405e.1 // CHECK:STDOUT: %Derived.F => constants.%Derived.F.d85493.1 // CHECK:STDOUT: %Derived => constants.%Derived -// CHECK:STDOUT: %Derived.F.specific_fn.loc10_50.2 => constants.%Derived.F.specific_fn.822c1a.2 +// CHECK:STDOUT: %Derived.F.specific_fn.loc10_44.2 => constants.%Derived.F.specific_fn.822c1a.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index 69ed94130593..03429545413e 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -15,10 +15,10 @@ class Class; class Class { - fn F[self: Self](b: ()); + fn F(self, b: ()); } -fn Class.F[unused self: Self](unused b: ()) {} +fn Class.F(unused self, unused b: ()) {} // CHECK:STDOUT: --- redeclaration.carbon // CHECK:STDOUT: @@ -59,9 +59,9 @@ fn Class.F[unused self: Self](unused b: ()) {} // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [concrete = constants.%Class] // CHECK:STDOUT: %self.loc21: %Class = value_binding self, %self.param.loc21 // CHECK:STDOUT: %b.param.loc21: %empty_tuple.type = value_param call_param1 -// CHECK:STDOUT: %.loc21_42.1: type = splice_block %.loc21_42.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc21_42.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc21_42.3: type = converted %.loc21_42.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc21_36.1: type = splice_block %.loc21_36.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc21_36.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc21_36.3: type = converted %.loc21_36.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %b.loc21: %empty_tuple.type = value_binding b, %b.param.loc21 // CHECK:STDOUT: } @@ -78,9 +78,9 @@ fn Class.F[unused self: Self](unused b: ()) {} // CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [concrete = constants.%Class] // CHECK:STDOUT: %self.loc18: %Class = value_binding self, %self.param.loc18 // CHECK:STDOUT: %b.param.loc18: %empty_tuple.type = value_param call_param1 -// CHECK:STDOUT: %.loc18_24.1: type = splice_block %.loc18_24.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc18_24.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc18_24.3: type = converted %.loc18_24.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc18_18.1: type = splice_block %.loc18_18.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc18_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc18_18.3: type = converted %.loc18_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %b.loc18: %empty_tuple.type = value_binding b, %b.param.loc18 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/self/fail_ref_self.carbon b/toolchain/check/testdata/class/self/fail_ref_self.carbon index 29ed97c6e033..b1b4cd8455f3 100644 --- a/toolchain/check/testdata/class/self/fail_ref_self.carbon +++ b/toolchain/check/testdata/class/self/fail_ref_self.carbon @@ -13,7 +13,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/self/fail_ref_self.carbon class Class { - fn F[ref self: Self](); + fn F(ref self); } fn Make() -> Class; @@ -23,8 +23,8 @@ fn F(c: Class, p: Class*) { // CHECK:STDERR: c.F(); // CHECK:STDERR: ^ // CHECK:STDERR: fail_ref_self.carbon:[[@LINE-9]]:8: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[ref self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fn F(ref self); + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: c.F(); diff --git a/toolchain/check/testdata/class/self/fail_self.carbon b/toolchain/check/testdata/class/self/fail_self.carbon index 6ec93beedf1e..69f77c7b472f 100644 --- a/toolchain/check/testdata/class/self/fail_self.carbon +++ b/toolchain/check/testdata/class/self/fail_self.carbon @@ -10,53 +10,229 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/self/fail_self.carbon +// --- fail_self_implicit_list.carbon +library "[[@TEST_NAME]]"; + +// `self` is not permitted in the implicit parameter list, regardless of how +// its type is spelled (explicit `Self`, an arbitrary type, or omitted). class Class { - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:8: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList] - // CHECK:STDERR: fn F(self: Self); + // CHECK:STDERR: fail_self_implicit_list.carbon:[[@LINE+4]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn F[self: Self](); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - fn F(self: Self); - - fn G() -> Self; + fn F[self: Self](); + // CHECK:STDERR: fail_self_implicit_list.carbon:[[@LINE+4]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn G[self: Class](); + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: + fn G[self: Class](); + // CHECK:STDERR: fail_self_implicit_list.carbon:[[@LINE+4]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn H[self](); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + fn H[self](); + // CHECK:STDERR: fail_self_implicit_list.carbon:[[@LINE+4]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn I[ref self: Self](); + // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: + fn I[ref self: Self](); + // CHECK:STDERR: fail_self_implicit_list.carbon:[[@LINE+4]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn J[ref self](); + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: + fn J[ref self](); } -// CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:19: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList] -// CHECK:STDERR: fn Class.F(unused self: Self) { -// CHECK:STDERR: ^~~~~~~~~~ +// --- fail_self_outside_class.carbon +library "[[@TEST_NAME]]"; + +// `self` outside any class scope has no `Self` to default to. +// CHECK:STDERR: fail_self_outside_class.carbon:[[@LINE+4]]:6: error: name `Self` not found [NameNotFound] +// CHECK:STDERR: fn F(self); +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -fn Class.F(unused self: Self) { +fn F(self); + +// `ref self` is similarly invalid at file scope. +// CHECK:STDERR: fail_self_outside_class.carbon:[[@LINE+4]]:6: error: name `Self` not found [NameNotFound] +// CHECK:STDERR: fn G(ref self); +// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: +fn G(ref self); + +// --- fail_self_repeated.carbon +library "[[@TEST_NAME]]"; + +class Class { + // Repeating `self` within a single parameter list is rejected. + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:14: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn F(self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn F(self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + fn F(self, self); + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:20: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn G(self: Self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn G(self: Self, self); + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + fn G(self: Self, self); + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:14: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn H(self, self: Self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn H(self, self: Self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + fn H(self, self: Self); + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:18: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn I(ref self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn I(ref self, self); + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: + fn I(ref self, self); + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:24: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn J(ref self: Self, self: Self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn J(ref self: Self, self: Self); + // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: + fn J(ref self: Self, self: Self); + + // `self` in both lists, even just once each, is rejected: the implicit + // occurrence is wrong, and the explicit one becomes a duplicate. + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+11]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn K[self](self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:14: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn K[self](self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn K[self](self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + fn K[self](self); + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+11]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn L[self: Self](self); + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:20: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn L[self: Self](self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn L[self: Self](self); + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + fn L[self: Self](self); + + // Duplicates within the implicit list and across both lists. + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+15]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn M[self, self](); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+11]]:14: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn M[self, self](); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:14: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn M[self, self](); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn M[self, self](); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + fn M[self, self](); + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+29]]:8: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn N[self, self](self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+25]]:14: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn N[self, self](self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+21]]:14: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn N[self, self](self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+18]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn N[self, self](self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+14]]:20: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn N[self, self](self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+11]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn N[self, self](self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+7]]:26: error: duplicate name `self` being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fn N[self, self](self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_self_repeated.carbon:[[@LINE+4]]:8: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fn N[self, self](self, self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + fn N[self, self](self, self); } -fn Class.G() -> Self { - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:7: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList] - // CHECK:STDERR: var self: Self; - // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: - var self: Self; - // CHECK:STDERR: fail_self.carbon:[[@LINE+7]]:10: error: cannot copy value of type `Class` [CopyOfUncopyableType] - // CHECK:STDERR: return self; - // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:10: note: type `Class` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: return self; - // CHECK:STDERR: ^~~~ - // CHECK:STDERR: - return self; +// --- fail_var_self.carbon +library "[[@TEST_NAME]]"; + +class Class { + fn F(); } +fn Class.F() { + // `var self` is only valid as the receiver of a method, not as a local + // variable. + // CHECK:STDERR: fail_var_self.carbon:[[@LINE+4]]:14: error: `self` can only be declared in a parameter list [SelfOutsideParamList] + // CHECK:STDERR: var unused self: Self; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + var unused self: Self; +} + +// --- fail_self_wrong_type.carbon +library "[[@TEST_NAME]]"; + +// The receiver's type can be any type, not just the enclosing class. Here `self` +// has a type that differs from the class the method is declared in, which is +// diagnosed when the method is called with a receiver of the class's type. +class Class {} + class WrongSelf { - fn F[self: Class](); + fn F(self: Class); } fn CallWrongSelf(ws: WrongSelf) { - // CHECK:STDERR: fail_self.carbon:[[@LINE+10]]:3: error: cannot implicitly convert expression of type `WrongSelf` to `Class` [ConversionFailure] + // CHECK:STDERR: fail_self_wrong_type.carbon:[[@LINE+10]]:3: error: cannot implicitly convert expression of type `WrongSelf` to `Class` [ConversionFailure] // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_self.carbon:[[@LINE+7]]:3: note: type `WrongSelf` does not implement interface `Core.ImplicitAs(Class)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fail_self_wrong_type.carbon:[[@LINE+7]]:3: note: type `WrongSelf` does not implement interface `Core.ImplicitAs(Class)` [MissingImplInMemberAccessInContext] // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[self: Class](); + // CHECK:STDERR: fail_self_wrong_type.carbon:[[@LINE-10]]:8: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn F(self: Class); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: ws.F(); } + +// --- fail_self_not_first.carbon +library "[[@TEST_NAME]]"; + +class Class { + // `self` must be the first explicit parameter. + // CHECK:STDERR: fail_self_not_first.carbon:[[@LINE+4]]:22: error: `self` must be the first explicit parameter [SelfNotFirstParam] + // CHECK:STDERR: fn F(other: Class, self: Self); + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: + fn F(other: Class, self: Self); +} diff --git a/toolchain/check/testdata/class/self/fail_self_param.carbon b/toolchain/check/testdata/class/self/fail_self_param.carbon index 702bcb9ffa13..683f7975230a 100644 --- a/toolchain/check/testdata/class/self/fail_self_param.carbon +++ b/toolchain/check/testdata/class/self/fail_self_param.carbon @@ -10,7 +10,35 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/self/fail_self_param.carbon +// --- fail_self_param.carbon +library "[[@TEST_NAME]]"; + +// `self` is not a valid parameter of a class declaration even when placed in +// the explicit parameter list. // CHECK:STDERR: fail_self_param.carbon:[[@LINE+4]]:9: error: `self` parameter only allowed on functions [SelfParameterNotAllowed] +// CHECK:STDERR: class C(self:! type, x:! self) {} +// CHECK:STDERR: ^~~~~~~~~~~ +// CHECK:STDERR: +class C(self:! type, x:! self) {} +// CHECK:STDERR: fail_self_param.carbon:[[@LINE+7]]:8: error: 1 argument passed to generic class expecting 2 arguments [CallArgCountMismatch] +// CHECK:STDERR: var v: C(()); +// CHECK:STDERR: ^~~~~ +// CHECK:STDERR: fail_self_param.carbon:[[@LINE-4]]:1: note: calling generic class declared here [InCallToEntity] +// CHECK:STDERR: class C(self:! type, x:! self) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +var v: C(()); + +// --- fail_self_param_implicit.carbon +library "[[@TEST_NAME]]"; + +// `self` in the implicit parameter list of a class declaration is reported as +// both being in the wrong list and not allowed on a class at all. +// CHECK:STDERR: fail_self_param_implicit.carbon:[[@LINE+8]]:9: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] +// CHECK:STDERR: class C[self:! type](x:! self) {} +// CHECK:STDERR: ^~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_self_param_implicit.carbon:[[@LINE+4]]:9: error: `self` parameter only allowed on functions [SelfParameterNotAllowed] // CHECK:STDERR: class C[self:! type](x:! self) {} // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/self/raw_self.carbon b/toolchain/check/testdata/class/self/raw_self.carbon index 51de47ad5039..17a4d626d01d 100644 --- a/toolchain/check/testdata/class/self/raw_self.carbon +++ b/toolchain/check/testdata/class/self/raw_self.carbon @@ -13,19 +13,20 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/self/raw_self.carbon class Class { - fn F[ref self: Self](r#self: i32); - fn G[self: Self](r#self: i32) -> (i32, i32); + fn F(ref self, r#self: i32); + fn G(self, r#self: i32) -> (i32, i32); var n: i32; } -fn Class.F[ref self: Self](r#self: i32) { +fn Class.F(ref self, r#self: i32) { self.n = r#self; } -fn Class.G[self: Self](r#self: i32) -> (i32, i32) { +fn Class.G(self, r#self: i32) -> (i32, i32) { return (self.n, r#self); } + // CHECK:STDOUT: --- raw_self.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -82,37 +83,37 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {} // CHECK:STDOUT: %Class.F.decl: %Class.F.type = fn_decl @Class.F [concrete = constants.%Class.F] { -// CHECK:STDOUT: %self.param_patt.loc21_20: %pattern_type.f15 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt.loc21_20: %pattern_type.f15 = at_binding_pattern self, %self.param_patt.loc21_20 [concrete] -// CHECK:STDOUT: %self.param_patt.loc21_34: %pattern_type.6b6 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt.loc21_34: %pattern_type.6b6 = at_binding_pattern r#self, %self.param_patt.loc21_34 [concrete] +// CHECK:STDOUT: %self.param_patt.loc21_16: %pattern_type.f15 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.loc21_16: %pattern_type.f15 = at_binding_pattern self, %self.param_patt.loc21_16 [concrete] +// CHECK:STDOUT: %self.param_patt.loc21_28: %pattern_type.6b6 = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.loc21_28: %pattern_type.6b6 = at_binding_pattern r#self, %self.param_patt.loc21_28 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param.loc21_20: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self.param.loc21_16: ref %Class = ref_param call_param0 // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [concrete = constants.%Class] -// CHECK:STDOUT: %self.loc21_20: ref %Class = ref_binding self, %self.param.loc21_20 -// CHECK:STDOUT: %self.param.loc21_34: %i32 = value_param call_param1 +// CHECK:STDOUT: %self.loc21_16: ref %Class = ref_binding self, %self.param.loc21_16 +// CHECK:STDOUT: %self.param.loc21_28: %i32 = value_param call_param1 // CHECK:STDOUT: %i32.loc21: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %self.loc21_34: %i32 = value_binding r#self, %self.param.loc21_34 +// CHECK:STDOUT: %self.loc21_28: %i32 = value_binding r#self, %self.param.loc21_28 // CHECK:STDOUT: } // CHECK:STDOUT: %Class.G.decl: %Class.G.type = fn_decl @Class.G [concrete = constants.%Class.G] { -// CHECK:STDOUT: %self.param_patt.loc25_16: %pattern_type.f15 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt.loc25_16: %pattern_type.f15 = at_binding_pattern self, %self.param_patt.loc25_16 [concrete] -// CHECK:STDOUT: %self.param_patt.loc25_30: %pattern_type.6b6 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt.loc25_30: %pattern_type.6b6 = at_binding_pattern r#self, %self.param_patt.loc25_30 [concrete] +// CHECK:STDOUT: %self.param_patt.loc25_12: %pattern_type.f15 = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.loc25_12: %pattern_type.f15 = at_binding_pattern self, %self.param_patt.loc25_12 [concrete] +// CHECK:STDOUT: %self.param_patt.loc25_24: %pattern_type.6b6 = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.loc25_24: %pattern_type.6b6 = at_binding_pattern r#self, %self.param_patt.loc25_24 [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.394 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.394 = return_slot_pattern %return.param_patt, %.loc25_49.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.394 = return_slot_pattern %return.param_patt, %.loc25_43.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %i32.loc25_41: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %i32.loc25_46: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc25_49.1: %tuple.type.24b = tuple_literal (%i32.loc25_41, %i32.loc25_46) [concrete = constants.%tuple.b59] -// CHECK:STDOUT: %.loc25_49.2: type = converted %.loc25_49.1, constants.%tuple.type.e55 [concrete = constants.%tuple.type.e55] -// CHECK:STDOUT: %.loc25_49.3: Core.Form = init_form %.loc25_49.2 [concrete = constants.%.c11] -// CHECK:STDOUT: %self.param.loc25_16: %Class = value_param call_param0 +// CHECK:STDOUT: %i32.loc25_35: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %i32.loc25_40: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc25_43.1: %tuple.type.24b = tuple_literal (%i32.loc25_35, %i32.loc25_40) [concrete = constants.%tuple.b59] +// CHECK:STDOUT: %.loc25_43.2: type = converted %.loc25_43.1, constants.%tuple.type.e55 [concrete = constants.%tuple.type.e55] +// CHECK:STDOUT: %.loc25_43.3: Core.Form = init_form %.loc25_43.2 [concrete = constants.%.c11] +// CHECK:STDOUT: %self.param.loc25_12: %Class = value_param call_param0 // CHECK:STDOUT: %Self.ref.loc25: type = name_ref Self, constants.%Class [concrete = constants.%Class] -// CHECK:STDOUT: %self.loc25_16: %Class = value_binding self, %self.param.loc25_16 -// CHECK:STDOUT: %self.param.loc25_30: %i32 = value_param call_param1 -// CHECK:STDOUT: %i32.loc25_32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %self.loc25_30: %i32 = value_binding r#self, %self.param.loc25_30 +// CHECK:STDOUT: %self.loc25_12: %Class = value_binding self, %self.param.loc25_12 +// CHECK:STDOUT: %self.param.loc25_24: %i32 = value_param call_param1 +// CHECK:STDOUT: %i32.loc25_26: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %self.loc25_24: %i32 = value_binding r#self, %self.param.loc25_24 // CHECK:STDOUT: %return.param.loc25: ref %tuple.type.e55 = out_param call_param2 // CHECK:STDOUT: %return.loc25: ref %tuple.type.e55 = return_slot %return.param.loc25 // CHECK:STDOUT: } @@ -120,37 +121,37 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %Class.F.decl: %Class.F.type = fn_decl @Class.F [concrete = constants.%Class.F] { -// CHECK:STDOUT: %self.param_patt.loc21_20: %pattern_type.f15 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt.loc21_20: %pattern_type.f15 = at_binding_pattern self, %self.param_patt.loc21_20 [concrete] -// CHECK:STDOUT: %self.param_patt.loc21_34: %pattern_type.6b6 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt.loc21_34: %pattern_type.6b6 = at_binding_pattern r#self, %self.param_patt.loc21_34 [concrete] +// CHECK:STDOUT: %self.param_patt.loc21_16: %pattern_type.f15 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.loc21_16: %pattern_type.f15 = at_binding_pattern self, %self.param_patt.loc21_16 [concrete] +// CHECK:STDOUT: %self.param_patt.loc21_28: %pattern_type.6b6 = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.loc21_28: %pattern_type.6b6 = at_binding_pattern r#self, %self.param_patt.loc21_28 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param.loc16_16: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self.param.loc16_12: ref %Class = ref_param call_param0 // CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%Class [concrete = constants.%Class] -// CHECK:STDOUT: %self.loc16_16: ref %Class = ref_binding self, %self.param.loc16_16 -// CHECK:STDOUT: %self.param.loc16_30: %i32 = value_param call_param1 +// CHECK:STDOUT: %self.loc16_12: ref %Class = ref_binding self, %self.param.loc16_12 +// CHECK:STDOUT: %self.param.loc16_24: %i32 = value_param call_param1 // CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %self.loc16_30: %i32 = value_binding r#self, %self.param.loc16_30 +// CHECK:STDOUT: %self.loc16_24: %i32 = value_binding r#self, %self.param.loc16_24 // CHECK:STDOUT: } // CHECK:STDOUT: %Class.G.decl: %Class.G.type = fn_decl @Class.G [concrete = constants.%Class.G] { -// CHECK:STDOUT: %self.param_patt.loc25_16: %pattern_type.f15 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt.loc25_16: %pattern_type.f15 = at_binding_pattern self, %self.param_patt.loc25_16 [concrete] -// CHECK:STDOUT: %self.param_patt.loc25_30: %pattern_type.6b6 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt.loc25_30: %pattern_type.6b6 = at_binding_pattern r#self, %self.param_patt.loc25_30 [concrete] +// CHECK:STDOUT: %self.param_patt.loc25_12: %pattern_type.f15 = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.loc25_12: %pattern_type.f15 = at_binding_pattern self, %self.param_patt.loc25_12 [concrete] +// CHECK:STDOUT: %self.param_patt.loc25_24: %pattern_type.6b6 = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.loc25_24: %pattern_type.6b6 = at_binding_pattern r#self, %self.param_patt.loc25_24 [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.394 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.394 = return_slot_pattern %return.param_patt, %.loc25_49.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.394 = return_slot_pattern %return.param_patt, %.loc25_43.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %i32.loc17_37: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %i32.loc17_42: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc17_45.1: %tuple.type.24b = tuple_literal (%i32.loc17_37, %i32.loc17_42) [concrete = constants.%tuple.b59] -// CHECK:STDOUT: %.loc17_45.2: type = converted %.loc17_45.1, constants.%tuple.type.e55 [concrete = constants.%tuple.type.e55] -// CHECK:STDOUT: %.loc17_45.3: Core.Form = init_form %.loc17_45.2 [concrete = constants.%.c11] -// CHECK:STDOUT: %self.param.loc17_12: %Class = value_param call_param0 +// CHECK:STDOUT: %i32.loc17_31: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %i32.loc17_36: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc17_39.1: %tuple.type.24b = tuple_literal (%i32.loc17_31, %i32.loc17_36) [concrete = constants.%tuple.b59] +// CHECK:STDOUT: %.loc17_39.2: type = converted %.loc17_39.1, constants.%tuple.type.e55 [concrete = constants.%tuple.type.e55] +// CHECK:STDOUT: %.loc17_39.3: Core.Form = init_form %.loc17_39.2 [concrete = constants.%.c11] +// CHECK:STDOUT: %self.param.loc17_8: %Class = value_param call_param0 // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [concrete = constants.%Class] -// CHECK:STDOUT: %self.loc17_12: %Class = value_binding self, %self.param.loc17_12 -// CHECK:STDOUT: %self.param.loc17_26: %i32 = value_param call_param1 -// CHECK:STDOUT: %i32.loc17_28: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %self.loc17_26: %i32 = value_binding r#self, %self.param.loc17_26 +// CHECK:STDOUT: %self.loc17_8: %Class = value_binding self, %self.param.loc17_8 +// CHECK:STDOUT: %self.param.loc17_20: %i32 = value_param call_param1 +// CHECK:STDOUT: %i32.loc17_22: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %self.loc17_20: %i32 = value_binding r#self, %self.param.loc17_20 // CHECK:STDOUT: %return.param.loc17: ref %tuple.type.e55 = out_param call_param2 // CHECK:STDOUT: %return.loc17: ref %tuple.type.e55 = return_slot %return.param.loc17 // CHECK:STDOUT: } @@ -165,12 +166,12 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: .n = %.loc18 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Class.F(%self.param.loc21_20: ref %Class, %self.param.loc21_34: %i32) { +// CHECK:STDOUT: fn @Class.F(%self.param.loc21_16: ref %Class, %self.param.loc21_28: %i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref.loc22_3: ref %Class = name_ref self, %self.loc21_20 +// CHECK:STDOUT: %self.ref.loc22_3: ref %Class = name_ref self, %self.loc21_16 // CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc18 [concrete = @Class.%.loc18] // CHECK:STDOUT: %.loc22: ref %i32 = class_element_access %self.ref.loc22_3, element0 -// CHECK:STDOUT: %self.ref.loc22_12: %i32 = name_ref r#self, %self.loc21_34 +// CHECK:STDOUT: %self.ref.loc22_12: %i32 = name_ref r#self, %self.loc21_28 // CHECK:STDOUT: %impl.elem0: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] // CHECK:STDOUT: %bound_method.loc22_12.1: = bound_method %self.ref.loc22_12, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] @@ -180,13 +181,13 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Class.G(%self.param.loc25_16: %Class, %self.param.loc25_30: %i32) -> out %return.param.loc25: %tuple.type.e55 { +// CHECK:STDOUT: fn @Class.G(%self.param.loc25_12: %Class, %self.param.loc25_24: %i32) -> out %return.param.loc25: %tuple.type.e55 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref.loc26_11: %Class = name_ref self, %self.loc25_16 +// CHECK:STDOUT: %self.ref.loc26_11: %Class = name_ref self, %self.loc25_12 // CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc18 [concrete = @Class.%.loc18] // CHECK:STDOUT: %.loc26_15.1: ref %i32 = class_element_access %self.ref.loc26_11, element0 // CHECK:STDOUT: %.loc26_15.2: %i32 = acquire_value %.loc26_15.1 -// CHECK:STDOUT: %self.ref.loc26_19: %i32 = name_ref r#self, %self.loc25_30 +// CHECK:STDOUT: %self.ref.loc26_19: %i32 = name_ref r#self, %self.loc25_24 // CHECK:STDOUT: %.loc26_25.1: %tuple.type.e55 = tuple_literal (%.loc26_15.2, %self.ref.loc26_19) // CHECK:STDOUT: %impl.elem0.loc26_15: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] // CHECK:STDOUT: %bound_method.loc26_15.1: = bound_method %.loc26_15.2, %impl.elem0.loc26_15 diff --git a/toolchain/check/testdata/class/self/self.carbon b/toolchain/check/testdata/class/self/self.carbon index a1c8f8f6a52b..20fba05326f0 100644 --- a/toolchain/check/testdata/class/self/self.carbon +++ b/toolchain/check/testdata/class/self/self.carbon @@ -13,39 +13,86 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/self/self.carbon // --- self.carbon - library "[[@TEST_NAME]]"; class Class { - fn F[self: Self]() -> i32; - fn G[ref self: Self]() -> i32; + // The type of `self` may be written explicitly... + fn F(self: Self) -> i32; + // ...or omitted, in which case it defaults to `Self`. + fn G(ref self) -> i32; var n: i32; } -fn Class.F[self: Self]() -> i32 { +// A redeclaration must spell `self` the same way as the original. +fn Class.F(self: Self) -> i32 { return self.n; } -fn Class.G[ref self: Self]() -> i32 { +fn Class.G(ref self) -> i32 { return self.n; } -// --- fail_return_self_value.carbon - +// --- fail_self_syntax_mismatch.carbon library "[[@TEST_NAME]]"; class Class { - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+7]]:25: error: cannot implicitly convert non-type value of type `Class` to `type` [ConversionFailureNonTypeToFacet] - // CHECK:STDERR: fn F[self: Self]() -> self; - // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+4]]:25: note: type `Class` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: fn F[self: Self]() -> self; - // CHECK:STDERR: ^~~~ - // CHECK:STDERR: - fn F[self: Self]() -> self; + fn F(self: Self); + fn G(self); } +// A redeclaration must spell `self` the same way as the original. +// CHECK:STDERR: fail_self_syntax_mismatch.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fn Class.F(unused self) {} +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_self_syntax_mismatch.carbon:[[@LINE-8]]:14: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] +// CHECK:STDERR: fn F(self: Self); +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +fn Class.F(unused self) {} + +// CHECK:STDERR: fail_self_syntax_mismatch.carbon:[[@LINE+7]]:25: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fn Class.G(unused self: Self) {} +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_self_syntax_mismatch.carbon:[[@LINE-16]]:8: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] +// CHECK:STDERR: fn G(self); +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +fn Class.G(unused self: Self) {} + +// --- fail_self_type_mismatch.carbon +library "[[@TEST_NAME]]"; + +class Class { + fn F(self: Self); +} + +// Two explicit `self` types that differ syntactically (here `Class` instead of +// `Self`, even though they refer to the same type). +// CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE+7]]:25: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fn Class.F(unused self: Class) {} +// CHECK:STDERR: ^~~~~ +// CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE-8]]:14: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] +// CHECK:STDERR: fn F(self: Self); +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +fn Class.F(unused self: Class) {} + +// --- fail_return_self_value.carbon +library "[[@TEST_NAME]]"; + +class Class { + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+7]]:17: error: cannot implicitly convert non-type value of type `Class` to `type` [ConversionFailureNonTypeToFacet] + // CHECK:STDERR: fn F(self) -> self; + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+4]]:17: note: type `Class` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: fn F(self) -> self; + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + fn F(self) -> self; +} + + // CHECK:STDOUT: --- self.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -101,29 +148,29 @@ class Class { // CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.f15 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc11 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc13 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %i32.loc11: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc11: Core.Form = init_form %i32.loc11 [concrete = constants.%.795] -// CHECK:STDOUT: %self.param.loc11: %Class = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc11: type = name_ref Self, constants.%Class [concrete = constants.%Class] -// CHECK:STDOUT: %self.loc11: %Class = value_binding self, %self.param.loc11 -// CHECK:STDOUT: %return.param.loc11: ref %i32 = out_param call_param1 -// CHECK:STDOUT: %return.loc11: ref %i32 = return_slot %return.param.loc11 +// CHECK:STDOUT: %i32.loc13: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc13: Core.Form = init_form %i32.loc13 [concrete = constants.%.795] +// CHECK:STDOUT: %self.param.loc13: %Class = value_param call_param0 +// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %self.loc13: %Class = value_binding self, %self.param.loc13 +// CHECK:STDOUT: %return.param.loc13: ref %i32 = out_param call_param1 +// CHECK:STDOUT: %return.loc13: ref %i32 = return_slot %return.param.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: %Class.G.decl: %Class.G.type = fn_decl @Class.G [concrete = constants.%Class.G] { // CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.f15 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc15 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc17 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %i32.loc15: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc15: Core.Form = init_form %i32.loc15 [concrete = constants.%.795] -// CHECK:STDOUT: %self.param.loc15: ref %Class = ref_param call_param0 -// CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, constants.%Class [concrete = constants.%Class] -// CHECK:STDOUT: %self.loc15: ref %Class = ref_binding self, %self.param.loc15 -// CHECK:STDOUT: %return.param.loc15: ref %i32 = out_param call_param1 -// CHECK:STDOUT: %return.loc15: ref %i32 = return_slot %return.param.loc15 +// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc17: Core.Form = init_form %i32.loc17 [concrete = constants.%.795] +// CHECK:STDOUT: %self.param.loc17: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %self.loc17: ref %Class = ref_binding self, %self.param.loc17 +// CHECK:STDOUT: %return.param.loc17: ref %i32 = out_param call_param1 +// CHECK:STDOUT: %return.loc17: ref %i32 = return_slot %return.param.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -132,7 +179,7 @@ class Class { // CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.f15 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc11 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc13 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %.loc5: Core.Form = init_form %i32.loc5 [concrete = constants.%.795] @@ -146,17 +193,17 @@ class Class { // CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.f15 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc15 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc17 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc6: Core.Form = init_form %i32.loc6 [concrete = constants.%.795] -// CHECK:STDOUT: %self.param.loc6: ref %Class = ref_param call_param0 -// CHECK:STDOUT: %Self.ref.loc6: type = name_ref Self, constants.%Class [concrete = constants.%Class] -// CHECK:STDOUT: %self.loc6: ref %Class = ref_binding self, %self.param.loc6 -// CHECK:STDOUT: %return.param.loc6: ref %i32 = out_param call_param1 -// CHECK:STDOUT: %return.loc6: ref %i32 = return_slot %return.param.loc6 +// CHECK:STDOUT: %i32.loc7: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc7: Core.Form = init_form %i32.loc7 [concrete = constants.%.795] +// CHECK:STDOUT: %self.param.loc7: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %self.loc7: ref %Class = ref_binding self, %self.param.loc7 +// CHECK:STDOUT: %return.param.loc7: ref %i32 = out_param call_param1 +// CHECK:STDOUT: %return.loc7: ref %i32 = return_slot %return.param.loc7 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8: %Class.elem = field_decl n, element0 [concrete] +// CHECK:STDOUT: %.loc9: %Class.elem = field_decl n, element0 [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.cdf] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -164,37 +211,188 @@ class Class { // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: .F = %Class.F.decl // CHECK:STDOUT: .G = %Class.G.decl -// CHECK:STDOUT: .n = %.loc8 +// CHECK:STDOUT: .n = %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Class.F(%self.param.loc11: %Class) -> out %return.param.loc11: %i32 { +// CHECK:STDOUT: fn @Class.F(%self.param.loc13: %Class) -> out %return.param.loc13: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc11 -// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc8 [concrete = @Class.%.loc8] -// CHECK:STDOUT: %.loc12_14.1: ref %i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc12_14.2: %i32 = acquire_value %.loc12_14.1 +// CHECK:STDOUT: %self.ref: %Class = name_ref self, %self.loc13 +// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc9 [concrete = @Class.%.loc9] +// CHECK:STDOUT: %.loc14_14.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc14_14.2: %i32 = acquire_value %.loc14_14.1 // CHECK:STDOUT: %impl.elem0: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] -// CHECK:STDOUT: %bound_method.loc12_14.1: = bound_method %.loc12_14.2, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc14_14.1: = bound_method %.loc14_14.2, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_14.2: = bound_method %.loc12_14.2, %specific_fn -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc12_14.2(%.loc12_14.2) +// CHECK:STDOUT: %bound_method.loc14_14.2: = bound_method %.loc14_14.2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc14_14.2(%.loc14_14.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Class.G(%self.param.loc15: ref %Class) -> out %return.param.loc15: %i32 { +// CHECK:STDOUT: fn @Class.G(%self.param.loc17: ref %Class) -> out %return.param.loc17: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: ref %Class = name_ref self, %self.loc15 -// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc8 [concrete = @Class.%.loc8] -// CHECK:STDOUT: %.loc16_14.1: ref %i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc16_14.2: %i32 = acquire_value %.loc16_14.1 +// CHECK:STDOUT: %self.ref: ref %Class = name_ref self, %self.loc17 +// CHECK:STDOUT: %n.ref: %Class.elem = name_ref n, @Class.%.loc9 [concrete = @Class.%.loc9] +// CHECK:STDOUT: %.loc18_14.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc18_14.2: %i32 = acquire_value %.loc18_14.1 // CHECK:STDOUT: %impl.elem0: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] -// CHECK:STDOUT: %bound_method.loc16_14.1: = bound_method %.loc16_14.2, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc18_14.1: = bound_method %.loc18_14.2, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_14.2: = bound_method %.loc16_14.2, %specific_fn -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc16_14.2(%.loc16_14.2) +// CHECK:STDOUT: %bound_method.loc18_14.2: = bound_method %.loc18_14.2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc18_14.2(%.loc18_14.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- fail_self_syntax_mismatch.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Class: type = class_type @Class [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Class [concrete] +// CHECK:STDOUT: %Class.F.type.48cdab.1: type = fn_type @Class.F.loc4 [concrete] +// CHECK:STDOUT: %Class.F.bd5be1.1: %Class.F.type.48cdab.1 = struct_value () [concrete] +// CHECK:STDOUT: %Class.G.type.321a2c.1: type = fn_type @Class.G.loc5 [concrete] +// CHECK:STDOUT: %Class.G.d407b2.1: %Class.G.type.321a2c.1 = struct_value () [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %Class.F.type.48cdab.2: type = fn_type @Class.F.loc16 [concrete] +// CHECK:STDOUT: %Class.F.bd5be1.2: %Class.F.type.48cdab.2 = struct_value () [concrete] +// CHECK:STDOUT: %Class.G.type.321a2c.2: type = fn_type @Class.G.loc25 [concrete] +// CHECK:STDOUT: %Class.G.d407b2.2: %Class.G.type.321a2c.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {} +// CHECK:STDOUT: %Class.F.decl: %Class.F.type.48cdab.2 = fn_decl @Class.F.loc16 [concrete = constants.%Class.F.bd5be1.2] { +// 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: %Class = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %self: %Class = value_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Class.G.decl: %Class.G.type.321a2c.2 = fn_decl @Class.G.loc25 [concrete = constants.%Class.G.d407b2.2] { +// 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: %Class = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %self: %Class = value_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @Class { +// CHECK:STDOUT: %Class.F.decl: %Class.F.type.48cdab.1 = fn_decl @Class.F.loc4 [concrete = constants.%Class.F.bd5be1.1] { +// 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: %Class = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %self: %Class = value_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Class.G.decl: %Class.G.type.321a2c.1 = fn_decl @Class.G.loc5 [concrete = constants.%Class.G.d407b2.1] { +// 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: %Class = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %self: %Class = value_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Class +// CHECK:STDOUT: .F = %Class.F.decl +// CHECK:STDOUT: .G = %Class.G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Class.F.loc4(%self.param: %Class); +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Class.G.loc5(%self.param: %Class); +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Class.F.loc16(%self.param: %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Class.G.loc25(%self.param: %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_self_type_mismatch.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Class: type = class_type @Class [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Class [concrete] +// CHECK:STDOUT: %Class.F.type.48cdab.1: type = fn_type @Class.F.loc4 [concrete] +// CHECK:STDOUT: %Class.F.bd5be1.1: %Class.F.type.48cdab.1 = struct_value () [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %Class.F.type.48cdab.2: type = fn_type @Class.F.loc16 [concrete] +// CHECK:STDOUT: %Class.F.bd5be1.2: %Class.F.type.48cdab.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {} +// CHECK:STDOUT: %Class.F.decl: %Class.F.type.48cdab.2 = fn_decl @Class.F.loc16 [concrete = constants.%Class.F.bd5be1.2] { +// 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: %Class = value_param call_param0 +// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] +// CHECK:STDOUT: %self: %Class = value_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @Class { +// CHECK:STDOUT: %Class.F.decl: %Class.F.type.48cdab.1 = fn_decl @Class.F.loc4 [concrete = constants.%Class.F.bd5be1.1] { +// 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: %Class = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [concrete = constants.%Class] +// CHECK:STDOUT: %self: %Class = value_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Class +// CHECK:STDOUT: .F = %Class.F.decl +// CHECK:STDOUT: .Class = +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Class.F.loc4(%self.param: %Class); +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Class.F.loc16(%self.param: %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_return_self_value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -233,7 +431,7 @@ class Class { // CHECK:STDOUT: %return.patt: = return_slot_pattern , [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self -// CHECK:STDOUT: %.loc12: type = converted %self.ref, [concrete = ] +// CHECK:STDOUT: %.loc11: type = converted %self.ref, [concrete = ] // CHECK:STDOUT: %self.param: %Class = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [concrete = constants.%Class] // CHECK:STDOUT: %self: %Class = value_binding self, %self.param diff --git a/toolchain/check/testdata/class/self/self_type.carbon b/toolchain/check/testdata/class/self/self_type.carbon index 3ded57394000..d1aaf2b2e780 100644 --- a/toolchain/check/testdata/class/self/self_type.carbon +++ b/toolchain/check/testdata/class/self/self_type.carbon @@ -13,7 +13,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/self/self_type.carbon class Class { - fn F[self: Self]() -> i32; + fn F(self) -> i32; fn Make() -> Self { returned var s: Self; s = {.p = &s}; @@ -22,7 +22,7 @@ class Class { var p: Self*; } -fn Class.F[self: Self]() -> i32 { +fn Class.F(self) -> i32 { return (*self.p).F(); } diff --git a/toolchain/check/testdata/class/syntactic_merge.carbon b/toolchain/check/testdata/class/syntactic_merge.carbon index c29db1822fd9..8318aec522c9 100644 --- a/toolchain/check/testdata/class/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/syntactic_merge.carbon @@ -177,17 +177,17 @@ library "[[@TEST_NAME]]"; base class Base { var a: (); - fn F[ref self: Self](); + fn F(ref self); } // CHECK:STDERR: fail_self_type.carbon:[[@LINE+7]]:21: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] -// CHECK:STDERR: fn Base.F[ref self: Base]() { +// CHECK:STDERR: fn Base.F(ref self: Base) { // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:18: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] -// CHECK:STDERR: fn F[ref self: Self](); -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:8: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] +// CHECK:STDERR: fn F(ref self); +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -fn Base.F[ref self: Base]() { +fn Base.F(ref self: Base) { self.a = (); } diff --git a/toolchain/check/testdata/const/basics.carbon b/toolchain/check/testdata/const/basics.carbon index 49014fe4bf85..fec80d6ef218 100644 --- a/toolchain/check/testdata/const/basics.carbon +++ b/toolchain/check/testdata/const/basics.carbon @@ -99,7 +99,7 @@ var init_const_from_const: const X = ({} as X) as const X; library "[[@TEST_NAME]]"; class X { - fn TakeConstSelf[ref self: const Self](); + fn TakeConstSelf(ref self: const Self); } fn PassReferenceToConstReference(p: X*) { @@ -110,7 +110,7 @@ fn PassReferenceToConstReference(p: X*) { library "[[@TEST_NAME]]"; class X { - fn TakeSelf[ref self: Self](); + fn TakeSelf(ref self); } fn PassConstReferenceToReference(p: const X*) { @@ -121,12 +121,13 @@ fn PassConstReferenceToReference(p: const X*) { // CHECK:STDERR: p->(X.TakeSelf)(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_remove_while_forming_reference.carbon:[[@LINE-10]]:15: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn TakeSelf[ref self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fn TakeSelf(ref self); + // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: p->(X.TakeSelf)(); } + // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -237,6 +238,8 @@ fn PassConstReferenceToReference(p: const X*) { // CHECK:STDOUT: %p.ref: %const.0f8 = name_ref p, %p // CHECK:STDOUT: %impl.elem0: %.8c4 = impl_witness_access constants.%Copy.impl_witness.8b4, element0 [concrete = constants.%const.as.Copy.impl.Op.714] // CHECK:STDOUT: %bound_method.loc11_10.1: = bound_method %p.ref, %impl.elem0 +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value constants.%ptr.6b6, (constants.%Copy.impl_witness.65f) [concrete = constants.%Copy.facet.3f0] +// CHECK:STDOUT: %.loc11: %Copy.type = converted constants.%ptr.6b6, %Copy.facet [concrete = constants.%Copy.facet.3f0] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @const.as.Copy.impl.Op(constants.%Copy.facet.3f0) [concrete = constants.%const.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc11_10.2: = bound_method %p.ref, %specific_fn // CHECK:STDOUT: %const.as.Copy.impl.Op.call: init %const.0f8 = call %bound_method.loc11_10.2(%p.ref) diff --git a/toolchain/check/testdata/deduce/binding_pattern.carbon b/toolchain/check/testdata/deduce/binding_pattern.carbon index 1f952a6de8ac..4cae6ad67a09 100644 --- a/toolchain/check/testdata/deduce/binding_pattern.carbon +++ b/toolchain/check/testdata/deduce/binding_pattern.carbon @@ -47,6 +47,7 @@ fn F(unused U:! type, V:! Core.Destroy where {} impls Core.ImplicitAs(.Self)) { C(V).Create({}); } + // CHECK:STDOUT: --- fail_incompatible_deduce.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -427,17 +428,17 @@ fn F(unused U:! type, V:! Core.Destroy where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: %ImplicitAs.lookup_impl_witness: = lookup_impl_witness constants.%empty_struct_type, @ImplicitAs, @ImplicitAs(%V.as_type.loc10_6.2) [symbolic = %ImplicitAs.lookup_impl_witness (constants.%ImplicitAs.lookup_impl_witness)] // CHECK:STDOUT: %ImplicitAs.facet: @F.%ImplicitAs.type.loc10_16.2 (%ImplicitAs.type.801) = facet_value constants.%empty_struct_type, (%ImplicitAs.lookup_impl_witness) [symbolic = %ImplicitAs.facet (constants.%ImplicitAs.facet)] // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%V.as_type.loc10_6.2, %ImplicitAs.facet) [symbolic = %ImplicitAs.WithSelf.Convert.type (constants.%ImplicitAs.WithSelf.Convert.type.8ff)] -// CHECK:STDOUT: %.loc10_16.8: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type, %ImplicitAs.facet [symbolic = %.loc10_16.8 (constants.%.114)] -// CHECK:STDOUT: %impl.elem0.loc10_16.3: @F.%.loc10_16.8 (%.114) = impl_witness_access %ImplicitAs.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_16.3 (constants.%impl.elem0.0f0)] +// CHECK:STDOUT: %.loc10_16.9: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type, %ImplicitAs.facet [symbolic = %.loc10_16.9 (constants.%.114)] +// CHECK:STDOUT: %impl.elem0.loc10_16.3: @F.%.loc10_16.9 (%.114) = impl_witness_access %ImplicitAs.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_16.3 (constants.%impl.elem0.0f0)] // CHECK:STDOUT: %bound_method.loc10_16.5: = bound_method constants.%empty_struct, %impl.elem0.loc10_16.3 [symbolic = %bound_method.loc10_16.5 (constants.%bound_method.e59)] // CHECK:STDOUT: %specific_impl_fn.loc10_16.3: = specific_impl_function %impl.elem0.loc10_16.3, @ImplicitAs.WithSelf.Convert(%V.as_type.loc10_6.2, %ImplicitAs.facet) [symbolic = %specific_impl_fn.loc10_16.3 (constants.%specific_impl_fn.a2c)] // CHECK:STDOUT: %bound_method.loc10_16.6: = bound_method constants.%empty_struct, %specific_impl_fn.loc10_16.3 [symbolic = %bound_method.loc10_16.6 (constants.%bound_method.fc7)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %V.loc9_24.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %V.as_type.loc10_6.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.c91)] -// CHECK:STDOUT: %.loc10_16.9: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc10_16.9 (constants.%.8f3)] -// CHECK:STDOUT: %impl.elem0.loc10_16.4: @F.%.loc10_16.9 (%.8f3) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_16.4 (constants.%impl.elem0.f91)] -// CHECK:STDOUT: %specific_impl_fn.loc10_16.4: = specific_impl_function %impl.elem0.loc10_16.4, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc10_16.4 (constants.%specific_impl_fn.b7b)] +// CHECK:STDOUT: %Destroy.facet.loc10_16.2: %Destroy.type = facet_value %V.as_type.loc10_6.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc10_16.2 (constants.%Destroy.facet)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc10_16.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.c91)] +// CHECK:STDOUT: %.loc10_16.10: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc10_16.2 [symbolic = %.loc10_16.10 (constants.%.8f3)] +// CHECK:STDOUT: %impl.elem0.loc10_16.4: @F.%.loc10_16.10 (%.8f3) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_16.4 (constants.%impl.elem0.f91)] +// CHECK:STDOUT: %specific_impl_fn.loc10_16.4: = specific_impl_function %impl.elem0.loc10_16.4, @Destroy.WithSelf.Op(%Destroy.facet.loc10_16.2) [symbolic = %specific_impl_fn.loc10_16.4 (constants.%specific_impl_fn.b7b)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -453,7 +454,7 @@ fn F(unused U:! type, V:! Core.Destroy where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: %ImplicitAs.type.loc10_16.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%V.as_type)> [symbolic = %ImplicitAs.type.loc10_16.2 (constants.%ImplicitAs.type.801)] // CHECK:STDOUT: %.loc10_16.2: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.9d8) = specific_constant imports.%Core.import_ref.484, @ImplicitAs.WithSelf(constants.%V.as_type, constants.%Self.294) [symbolic = %assoc0 (constants.%assoc0.cef)] // CHECK:STDOUT: %Convert.ref: @F.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.9d8) = name_ref Convert, %.loc10_16.2 [symbolic = %assoc0 (constants.%assoc0.cef)] -// CHECK:STDOUT: %impl.elem0.loc10_16.1: @F.%.loc10_16.8 (%.114) = impl_witness_access constants.%ImplicitAs.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_16.3 (constants.%impl.elem0.0f0)] +// CHECK:STDOUT: %impl.elem0.loc10_16.1: @F.%.loc10_16.9 (%.114) = impl_witness_access constants.%ImplicitAs.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_16.3 (constants.%impl.elem0.0f0)] // CHECK:STDOUT: %bound_method.loc10_16.1: = bound_method %.loc10_16.1, %impl.elem0.loc10_16.1 [symbolic = %bound_method.loc10_16.5 (constants.%bound_method.e59)] // CHECK:STDOUT: %specific_impl_fn.loc10_16.1: = specific_impl_function %impl.elem0.loc10_16.1, @ImplicitAs.WithSelf.Convert(constants.%V.as_type, constants.%ImplicitAs.facet) [symbolic = %specific_impl_fn.loc10_16.3 (constants.%specific_impl_fn.a2c)] // CHECK:STDOUT: %bound_method.loc10_16.2: = bound_method %.loc10_16.1, %specific_impl_fn.loc10_16.1 [symbolic = %bound_method.loc10_16.6 (constants.%bound_method.fc7)] @@ -465,8 +466,10 @@ fn F(unused U:! type, V:! Core.Destroy where {} impls Core.ImplicitAs(.Self)) { // CHECK:STDOUT: %.loc10_16.6: ref @F.%V.as_type.loc10_6.2 (%V.as_type) = temporary %.loc10_16.3, %.loc10_16.5 // CHECK:STDOUT: %.loc10_16.7: @F.%V.as_type.loc10_6.2 (%V.as_type) = acquire_value %.loc10_16.6 // CHECK:STDOUT: %C.Create.call: init %empty_tuple.type = call %C.Create.specific_fn.loc10_7.1(%.loc10_16.7) -// CHECK:STDOUT: %impl.elem0.loc10_16.2: @F.%.loc10_16.9 (%.8f3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_16.4 (constants.%impl.elem0.f91)] +// CHECK:STDOUT: %impl.elem0.loc10_16.2: @F.%.loc10_16.10 (%.8f3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_16.4 (constants.%impl.elem0.f91)] // CHECK:STDOUT: %bound_method.loc10_16.3: = bound_method %.loc10_16.6, %impl.elem0.loc10_16.2 +// CHECK:STDOUT: %Destroy.facet.loc10_16.1: %Destroy.type = facet_value constants.%V.as_type, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc10_16.2 (constants.%Destroy.facet)] +// CHECK:STDOUT: %.loc10_16.8: %Destroy.type = converted constants.%V.as_type, %Destroy.facet.loc10_16.1 [symbolic = %Destroy.facet.loc10_16.2 (constants.%Destroy.facet)] // CHECK:STDOUT: %specific_impl_fn.loc10_16.2: = specific_impl_function %impl.elem0.loc10_16.2, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc10_16.4 (constants.%specific_impl_fn.b7b)] // CHECK:STDOUT: %bound_method.loc10_16.4: = bound_method %.loc10_16.6, %specific_impl_fn.loc10_16.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc10_16.4(%.loc10_16.6) diff --git a/toolchain/check/testdata/deduce/conversion.carbon b/toolchain/check/testdata/deduce/conversion.carbon index 996a94a46a21..050a6f0340fc 100644 --- a/toolchain/check/testdata/deduce/conversion.carbon +++ b/toolchain/check/testdata/deduce/conversion.carbon @@ -33,7 +33,7 @@ library "[[@TEST_NAME]]"; class A {} class B {} impl A as Core.ImplicitAs(type) { - eval fn Convert[unused self: A]() -> type { return B; } + eval fn Convert(unused self) -> type { return B; } } fn F(unused T:! type) {} @@ -53,7 +53,7 @@ library "[[@TEST_NAME]]"; class A {} class B {} impl A as Core.ImplicitAs(B) { - fn Convert[self: A]() -> B; + fn Convert(self) -> B; } fn F(unused T:! type, unused b: B) {} @@ -66,6 +66,7 @@ fn G(a: A) { //@dump-sem-ir-end } + // CHECK:STDOUT: --- need_conversion.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -101,11 +102,11 @@ fn G(a: A) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ImplicitAs.type.5f1: type = facet_type <@ImplicitAs, @ImplicitAs(type)> [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @A.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] -// CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.type.572c06.1: type = fn_type @A.as.ImplicitAs.impl.Convert.loc7_45.1 [concrete] +// CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.type.572c06.1: type = fn_type @A.as.ImplicitAs.impl.Convert.loc7_40.1 [concrete] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.dbe75c.1: %A.as.ImplicitAs.impl.Convert.type.572c06.1 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.5f1 = facet_value %A, (%ImplicitAs.impl_witness) [concrete] // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.51c: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(type, %ImplicitAs.facet) [concrete] -// CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.type.572c06.2: type = fn_type @A.as.ImplicitAs.impl.Convert.loc7_45.2 [concrete] +// CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.type.572c06.2: type = fn_type @A.as.ImplicitAs.impl.Convert.loc7_40.2 [concrete] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.dbe75c.2: %A.as.ImplicitAs.impl.Convert.type.572c06.2 = struct_value () [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -133,7 +134,7 @@ fn G(a: A) { // CHECK:STDOUT: %bound_method: = bound_method %.loc16_8.1, %impl.elem0 [concrete = constants.%A.as.ImplicitAs.impl.Convert.bound.5ecf75.1] // CHECK:STDOUT: %.loc16_8.2: ref %A = temporary %.loc16_6.2, %.loc16_8.1 [concrete = constants.%.367] // CHECK:STDOUT: %.loc16_8.3: %A = acquire_value %.loc16_8.2 [concrete = constants.%A.val] -// CHECK:STDOUT: %Convert.ref: %A.as.ImplicitAs.impl.Convert.type.572c06.1 = name_ref Convert, @A.as.ImplicitAs.impl.%A.as.ImplicitAs.impl.Convert.decl.loc7_45.1 [concrete = constants.%A.as.ImplicitAs.impl.Convert.dbe75c.1] +// CHECK:STDOUT: %Convert.ref: %A.as.ImplicitAs.impl.Convert.type.572c06.1 = name_ref Convert, @A.as.ImplicitAs.impl.%A.as.ImplicitAs.impl.Convert.decl.loc7_40.1 [concrete = constants.%A.as.ImplicitAs.impl.Convert.dbe75c.1] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.bound: = bound_method %.loc16_8.3, %Convert.ref [concrete = constants.%A.as.ImplicitAs.impl.Convert.bound.5ecf75.2] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.call: init type = call %A.as.ImplicitAs.impl.Convert.bound(%.loc16_8.3) [concrete = constants.%B] // CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %A.as.ImplicitAs.impl.Convert.call [concrete = constants.%B] diff --git a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon index 4639ffcd63ad..0e141ddc3941 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -98,6 +98,7 @@ fn G() { } + // CHECK:STDOUT: --- tuple_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -733,15 +734,15 @@ fn G() { // CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc26_22.2 [symbolic = %require_complete (constants.%require_complete.6f4d7d.2)] // CHECK:STDOUT: %HoldsType.val: @G.%HoldsType.loc26_22.2 (%HoldsType.3500da.2) = struct_value () [symbolic = %HoldsType.val (constants.%HoldsType.val.7f1)] // CHECK:STDOUT: %F.specific_fn.loc26_3.2: = specific_function constants.%F, @F(%c.loc25_7.1) [symbolic = %F.specific_fn.loc26_3.2 (constants.%F.specific_fn.7ee)] -// CHECK:STDOUT: %.loc26_8.4: ref @G.%HoldsType.loc26_22.2 (%HoldsType.3500da.2) = temporary invalid, %HoldsType.val [symbolic = %.loc26_8.4 (constants.%.e1a)] +// CHECK:STDOUT: %.loc26_8.5: ref @G.%HoldsType.loc26_22.2 (%HoldsType.3500da.2) = temporary invalid, %HoldsType.val [symbolic = %.loc26_8.5 (constants.%.e1a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %HoldsType.loc26_22.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %HoldsType.loc26_22.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.833)] -// 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.646)] -// CHECK:STDOUT: %.loc26_8.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc26_8.5 (constants.%.ff0)] -// CHECK:STDOUT: %impl.elem0.loc26_8.2: @G.%.loc26_8.5 (%.ff0) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_8.2 (constants.%impl.elem0.c88)] -// CHECK:STDOUT: %bound_method.loc26_8.3: = bound_method %.loc26_8.4, %impl.elem0.loc26_8.2 [symbolic = %bound_method.loc26_8.3 (constants.%bound_method.c32)] -// CHECK:STDOUT: %specific_impl_fn.loc26_8.2: = specific_impl_function %impl.elem0.loc26_8.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc26_8.2 (constants.%specific_impl_fn.b17)] -// CHECK:STDOUT: %bound_method.loc26_8.4: = bound_method %.loc26_8.4, %specific_impl_fn.loc26_8.2 [symbolic = %bound_method.loc26_8.4 (constants.%bound_method.8d3)] +// CHECK:STDOUT: %Destroy.facet.loc26_8.2: %Destroy.type = facet_value %HoldsType.loc26_22.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc26_8.2 (constants.%Destroy.facet.833)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc26_8.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.646)] +// CHECK:STDOUT: %.loc26_8.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc26_8.2 [symbolic = %.loc26_8.6 (constants.%.ff0)] +// CHECK:STDOUT: %impl.elem0.loc26_8.2: @G.%.loc26_8.6 (%.ff0) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_8.2 (constants.%impl.elem0.c88)] +// CHECK:STDOUT: %bound_method.loc26_8.3: = bound_method %.loc26_8.5, %impl.elem0.loc26_8.2 [symbolic = %bound_method.loc26_8.3 (constants.%bound_method.c32)] +// CHECK:STDOUT: %specific_impl_fn.loc26_8.2: = specific_impl_function %impl.elem0.loc26_8.2, @Destroy.WithSelf.Op(%Destroy.facet.loc26_8.2) [symbolic = %specific_impl_fn.loc26_8.2 (constants.%specific_impl_fn.b17)] +// CHECK:STDOUT: %bound_method.loc26_8.4: = bound_method %.loc26_8.5, %specific_impl_fn.loc26_8.2 [symbolic = %bound_method.loc26_8.4 (constants.%bound_method.8d3)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -755,11 +756,13 @@ fn G() { // CHECK:STDOUT: %.loc26_8.1: init @G.%HoldsType.loc26_22.2 (%HoldsType.3500da.2) = converted %.loc26_6.1, %.loc26_6.3 [symbolic = %HoldsType.val (constants.%HoldsType.val.7f1)] // CHECK:STDOUT: %.loc26_26: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %F.specific_fn.loc26_3.1: = specific_function %F.ref, @F(constants.%c) [symbolic = %F.specific_fn.loc26_3.2 (constants.%F.specific_fn.7ee)] -// CHECK:STDOUT: %.loc26_8.2: ref @G.%HoldsType.loc26_22.2 (%HoldsType.3500da.2) = temporary %.loc26_6.2, %.loc26_8.1 [symbolic = %.loc26_8.4 (constants.%.e1a)] +// CHECK:STDOUT: %.loc26_8.2: ref @G.%HoldsType.loc26_22.2 (%HoldsType.3500da.2) = temporary %.loc26_6.2, %.loc26_8.1 [symbolic = %.loc26_8.5 (constants.%.e1a)] // CHECK:STDOUT: %.loc26_8.3: @G.%HoldsType.loc26_22.2 (%HoldsType.3500da.2) = acquire_value %.loc26_8.2 [symbolic = %HoldsType.val (constants.%HoldsType.val.7f1)] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc26_3.1(%.loc26_8.3, ) -// CHECK:STDOUT: %impl.elem0.loc26_8.1: @G.%.loc26_8.5 (%.ff0) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_8.2 (constants.%impl.elem0.c88)] +// CHECK:STDOUT: %impl.elem0.loc26_8.1: @G.%.loc26_8.6 (%.ff0) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_8.2 (constants.%impl.elem0.c88)] // CHECK:STDOUT: %bound_method.loc26_8.1: = bound_method %.loc26_8.2, %impl.elem0.loc26_8.1 [symbolic = %bound_method.loc26_8.3 (constants.%bound_method.c32)] +// CHECK:STDOUT: %Destroy.facet.loc26_8.1: %Destroy.type = facet_value constants.%HoldsType.3500da.2, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc26_8.2 (constants.%Destroy.facet.833)] +// CHECK:STDOUT: %.loc26_8.4: %Destroy.type = converted constants.%HoldsType.3500da.2, %Destroy.facet.loc26_8.1 [symbolic = %Destroy.facet.loc26_8.2 (constants.%Destroy.facet.833)] // CHECK:STDOUT: %specific_impl_fn.loc26_8.1: = specific_impl_function %impl.elem0.loc26_8.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.833) [symbolic = %specific_impl_fn.loc26_8.2 (constants.%specific_impl_fn.b17)] // CHECK:STDOUT: %bound_method.loc26_8.2: = bound_method %.loc26_8.2, %specific_impl_fn.loc26_8.1 [symbolic = %bound_method.loc26_8.4 (constants.%bound_method.8d3)] // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc26_8.2(%.loc26_8.2) @@ -848,11 +851,11 @@ fn G() { // CHECK:STDOUT: %require_complete => constants.%complete_type.357 // CHECK:STDOUT: %HoldsType.val => constants.%HoldsType.val.8bc // CHECK:STDOUT: %F.specific_fn.loc26_3.2 => constants.%F.specific_fn.463 -// CHECK:STDOUT: %.loc26_8.4 => constants.%.3f5 +// CHECK:STDOUT: %.loc26_8.5 => constants.%.3f5 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.5 -// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.b45 +// CHECK:STDOUT: %Destroy.facet.loc26_8.2 => constants.%Destroy.facet.b45 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.06d -// CHECK:STDOUT: %.loc26_8.5 => constants.%.db7 +// CHECK:STDOUT: %.loc26_8.6 => constants.%.db7 // CHECK:STDOUT: %impl.elem0.loc26_8.2 => constants.%Destroy.Op.1a2547.5 // CHECK:STDOUT: %bound_method.loc26_8.3 => constants.%Destroy.Op.bound.d49 // CHECK:STDOUT: %specific_impl_fn.loc26_8.2 => constants.%Destroy.Op.1a2547.5 diff --git a/toolchain/check/testdata/eval/aggregates.carbon b/toolchain/check/testdata/eval/aggregates.carbon index 3ee475b58c2c..40cce62d2113 100644 --- a/toolchain/check/testdata/eval/aggregates.carbon +++ b/toolchain/check/testdata/eval/aggregates.carbon @@ -53,6 +53,7 @@ fn G(N:! i32) { //@dump-sem-ir-end } + // CHECK:STDOUT: --- basics.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -621,23 +622,23 @@ fn G(N:! i32) { // CHECK:STDOUT: %impl.elem0.loc8_28.2: @F.%.loc8_28.4 (%.478) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_28.2 (constants.%impl.elem0.276)] // CHECK:STDOUT: %specific_impl_fn.loc8_28.2: = specific_impl_function %impl.elem0.loc8_28.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc8_28.2) [symbolic = %specific_impl_fn.loc8_28.2 (constants.%specific_impl_fn.6bf)] // CHECK:STDOUT: %Destroy.lookup_impl_witness.loc8: = lookup_impl_witness %array_type.loc8_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc8 (constants.%Destroy.lookup_impl_witness.1f5)] -// CHECK:STDOUT: %Destroy.facet.loc8: %Destroy.type = facet_value %array_type.loc8_27.2, (%Destroy.lookup_impl_witness.loc8) [symbolic = %Destroy.facet.loc8 (constants.%Destroy.facet.664)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc8: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc8) [symbolic = %Destroy.WithSelf.Op.type.loc8 (constants.%Destroy.WithSelf.Op.type.373)] -// CHECK:STDOUT: %.loc8_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc8, %Destroy.facet.loc8 [symbolic = %.loc8_3.2 (constants.%.260)] -// CHECK:STDOUT: %impl.elem0.loc8_3.2: @F.%.loc8_3.2 (%.260) = impl_witness_access %Destroy.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.375)] -// CHECK:STDOUT: %specific_impl_fn.loc8_3.2: = specific_impl_function %impl.elem0.loc8_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc8) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.f05)] +// CHECK:STDOUT: %Destroy.facet.loc8_3.2: %Destroy.type = facet_value %array_type.loc8_27.2, (%Destroy.lookup_impl_witness.loc8) [symbolic = %Destroy.facet.loc8_3.2 (constants.%Destroy.facet.664)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc8: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc8_3.2) [symbolic = %Destroy.WithSelf.Op.type.loc8 (constants.%Destroy.WithSelf.Op.type.373)] +// CHECK:STDOUT: %.loc8_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc8, %Destroy.facet.loc8_3.2 [symbolic = %.loc8_3.3 (constants.%.260)] +// CHECK:STDOUT: %impl.elem0.loc8_3.2: @F.%.loc8_3.3 (%.260) = impl_witness_access %Destroy.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.375)] +// CHECK:STDOUT: %specific_impl_fn.loc8_3.2: = specific_impl_function %impl.elem0.loc8_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc8_3.2) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.f05)] // CHECK:STDOUT: %Destroy.lookup_impl_witness.loc7: = lookup_impl_witness %struct_type.a.loc7_23.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc7 (constants.%Destroy.lookup_impl_witness.7f9)] -// CHECK:STDOUT: %Destroy.facet.loc7: %Destroy.type = facet_value %struct_type.a.loc7_23.2, (%Destroy.lookup_impl_witness.loc7) [symbolic = %Destroy.facet.loc7 (constants.%Destroy.facet.aa3)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc7: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7) [symbolic = %Destroy.WithSelf.Op.type.loc7 (constants.%Destroy.WithSelf.Op.type.ae9)] -// CHECK:STDOUT: %.loc7_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc7, %Destroy.facet.loc7 [symbolic = %.loc7_3 (constants.%.3c7)] -// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3 (%.3c7) = impl_witness_access %Destroy.lookup_impl_witness.loc7, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.bb8)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.799)] +// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value %struct_type.a.loc7_23.2, (%Destroy.lookup_impl_witness.loc7) [symbolic = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.aa3)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc7: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7_3.2) [symbolic = %Destroy.WithSelf.Op.type.loc7 (constants.%Destroy.WithSelf.Op.type.ae9)] +// CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc7, %Destroy.facet.loc7_3.2 [symbolic = %.loc7_3.2 (constants.%.3c7)] +// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3.2 (%.3c7) = impl_witness_access %Destroy.lookup_impl_witness.loc7, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.bb8)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7_3.2) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.799)] // CHECK:STDOUT: %Destroy.lookup_impl_witness.loc6: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc6 (constants.%Destroy.lookup_impl_witness.d26)] -// CHECK:STDOUT: %Destroy.facet.loc6: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness.loc6) [symbolic = %Destroy.facet.loc6 (constants.%Destroy.facet.7ba)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc6: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc6) [symbolic = %Destroy.WithSelf.Op.type.loc6 (constants.%Destroy.WithSelf.Op.type.a30)] -// CHECK:STDOUT: %.loc6_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc6, %Destroy.facet.loc6 [symbolic = %.loc6_3.2 (constants.%.a0a)] -// CHECK:STDOUT: %impl.elem0.loc6_3.2: @F.%.loc6_3.2 (%.a0a) = impl_witness_access %Destroy.lookup_impl_witness.loc6, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.667)] -// CHECK:STDOUT: %specific_impl_fn.loc6_3.2: = specific_impl_function %impl.elem0.loc6_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc6) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.96b)] +// CHECK:STDOUT: %Destroy.facet.loc6_3.2: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness.loc6) [symbolic = %Destroy.facet.loc6_3.2 (constants.%Destroy.facet.7ba)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc6: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc6_3.2) [symbolic = %Destroy.WithSelf.Op.type.loc6 (constants.%Destroy.WithSelf.Op.type.a30)] +// CHECK:STDOUT: %.loc6_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc6, %Destroy.facet.loc6_3.2 [symbolic = %.loc6_3.3 (constants.%.a0a)] +// CHECK:STDOUT: %impl.elem0.loc6_3.2: @F.%.loc6_3.3 (%.a0a) = impl_witness_access %Destroy.lookup_impl_witness.loc6, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.667)] +// CHECK:STDOUT: %specific_impl_fn.loc6_3.2: = specific_impl_function %impl.elem0.loc6_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc6_3.2) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.96b)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -710,18 +711,24 @@ fn G(N:! i32) { // CHECK:STDOUT: %array_type.loc8_27.1: type = array_type %int_5, %.loc8_23 [symbolic = %array_type.loc8_27.2 (constants.%array_type.50f)] // CHECK:STDOUT: } // CHECK:STDOUT: %w: ref @F.%array_type.loc8_27.2 (%array_type.50f) = ref_binding w, %w.var -// CHECK:STDOUT: %impl.elem0.loc8_3.1: @F.%.loc8_3.2 (%.260) = impl_witness_access constants.%Destroy.lookup_impl_witness.1f5, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.375)] +// CHECK:STDOUT: %impl.elem0.loc8_3.1: @F.%.loc8_3.3 (%.260) = impl_witness_access constants.%Destroy.lookup_impl_witness.1f5, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.375)] // CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %w.var, %impl.elem0.loc8_3.1 +// CHECK:STDOUT: %Destroy.facet.loc8_3.1: %Destroy.type = facet_value constants.%array_type.50f, (constants.%Destroy.lookup_impl_witness.1f5) [symbolic = %Destroy.facet.loc8_3.2 (constants.%Destroy.facet.664)] +// CHECK:STDOUT: %.loc8_3.2: %Destroy.type = converted constants.%array_type.50f, %Destroy.facet.loc8_3.1 [symbolic = %Destroy.facet.loc8_3.2 (constants.%Destroy.facet.664)] // CHECK:STDOUT: %specific_impl_fn.loc8_3.1: = specific_impl_function %impl.elem0.loc8_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.664) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.f05)] // CHECK:STDOUT: %bound_method.loc8_3.2: = bound_method %w.var, %specific_impl_fn.loc8_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8_3.2(%w.var) -// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3 (%.3c7) = impl_witness_access constants.%Destroy.lookup_impl_witness.7f9, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.bb8)] +// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3.2 (%.3c7) = impl_witness_access constants.%Destroy.lookup_impl_witness.7f9, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.bb8)] // CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0.loc7_3.1 +// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%struct_type.a, (constants.%Destroy.lookup_impl_witness.7f9) [symbolic = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.aa3)] +// CHECK:STDOUT: %.loc7_3.1: %Destroy.type = converted constants.%struct_type.a, %Destroy.facet.loc7_3.1 [symbolic = %Destroy.facet.loc7_3.2 (constants.%Destroy.facet.aa3)] // CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.aa3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.799)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_impl_fn.loc7_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %bound_method.loc7_3.2(%v.var) -// CHECK:STDOUT: %impl.elem0.loc6_3.1: @F.%.loc6_3.2 (%.a0a) = impl_witness_access constants.%Destroy.lookup_impl_witness.d26, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.667)] +// CHECK:STDOUT: %impl.elem0.loc6_3.1: @F.%.loc6_3.3 (%.a0a) = impl_witness_access constants.%Destroy.lookup_impl_witness.d26, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.667)] // CHECK:STDOUT: %bound_method.loc6_3.1: = bound_method %u.var, %impl.elem0.loc6_3.1 +// CHECK:STDOUT: %Destroy.facet.loc6_3.1: %Destroy.type = facet_value constants.%tuple.type.cd5, (constants.%Destroy.lookup_impl_witness.d26) [symbolic = %Destroy.facet.loc6_3.2 (constants.%Destroy.facet.7ba)] +// CHECK:STDOUT: %.loc6_3.2: %Destroy.type = converted constants.%tuple.type.cd5, %Destroy.facet.loc6_3.1 [symbolic = %Destroy.facet.loc6_3.2 (constants.%Destroy.facet.7ba)] // CHECK:STDOUT: %specific_impl_fn.loc6_3.1: = specific_impl_function %impl.elem0.loc6_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.7ba) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.96b)] // CHECK:STDOUT: %bound_method.loc6_3.2: = bound_method %u.var, %specific_impl_fn.loc6_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc6: init %empty_tuple.type = call %bound_method.loc6_3.2(%u.var) @@ -747,11 +754,11 @@ fn G(N:! i32) { // CHECK:STDOUT: %impl.elem0.loc14_30.2: @G.%.loc14_30.4 (%.608) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_30.2 (constants.%impl.elem0.37d)] // CHECK:STDOUT: %specific_impl_fn.loc14_30.2: = specific_impl_function %impl.elem0.loc14_30.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc14_30.2) [symbolic = %specific_impl_fn.loc14_30.2 (constants.%specific_impl_fn.b63)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc14_29.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.822)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc14_29.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.a58)] -// 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.6c9)] -// CHECK:STDOUT: %.loc14_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc14_3.2 (constants.%.a73)] -// CHECK:STDOUT: %impl.elem0.loc14_3.2: @G.%.loc14_3.2 (%.a73) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_3.2 (constants.%impl.elem0.fa7)] -// CHECK:STDOUT: %specific_impl_fn.loc14_3.2: = specific_impl_function %impl.elem0.loc14_3.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.075)] +// CHECK:STDOUT: %Destroy.facet.loc14_3.2: %Destroy.type = facet_value %array_type.loc14_29.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc14_3.2 (constants.%Destroy.facet.a58)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc14_3.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.6c9)] +// CHECK:STDOUT: %.loc14_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc14_3.2 [symbolic = %.loc14_3.3 (constants.%.a73)] +// CHECK:STDOUT: %impl.elem0.loc14_3.2: @G.%.loc14_3.3 (%.a73) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_3.2 (constants.%impl.elem0.fa7)] +// CHECK:STDOUT: %specific_impl_fn.loc14_3.2: = specific_impl_function %impl.elem0.loc14_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc14_3.2) [symbolic = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.075)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -782,8 +789,10 @@ fn G(N:! i32) { // CHECK:STDOUT: %array_type.loc14_29.1: type = array_type %.loc14_28.2, %i32.loc14 [symbolic = %array_type.loc14_29.2 (constants.%array_type.359)] // CHECK:STDOUT: } // CHECK:STDOUT: %k: ref @G.%array_type.loc14_29.2 (%array_type.359) = ref_binding k, %k.var -// CHECK:STDOUT: %impl.elem0.loc14_3.1: @G.%.loc14_3.2 (%.a73) = impl_witness_access constants.%Destroy.lookup_impl_witness.822, element0 [symbolic = %impl.elem0.loc14_3.2 (constants.%impl.elem0.fa7)] +// CHECK:STDOUT: %impl.elem0.loc14_3.1: @G.%.loc14_3.3 (%.a73) = impl_witness_access constants.%Destroy.lookup_impl_witness.822, element0 [symbolic = %impl.elem0.loc14_3.2 (constants.%impl.elem0.fa7)] // CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %k.var, %impl.elem0.loc14_3.1 +// CHECK:STDOUT: %Destroy.facet.loc14_3.1: %Destroy.type = facet_value constants.%array_type.359, (constants.%Destroy.lookup_impl_witness.822) [symbolic = %Destroy.facet.loc14_3.2 (constants.%Destroy.facet.a58)] +// CHECK:STDOUT: %.loc14_3.2: %Destroy.type = converted constants.%array_type.359, %Destroy.facet.loc14_3.1 [symbolic = %Destroy.facet.loc14_3.2 (constants.%Destroy.facet.a58)] // CHECK:STDOUT: %specific_impl_fn.loc14_3.1: = specific_impl_function %impl.elem0.loc14_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.a58) [symbolic = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.075)] // CHECK:STDOUT: %bound_method.loc14_3.2: = bound_method %k.var, %specific_impl_fn.loc14_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc14_3.2(%k.var) diff --git a/toolchain/check/testdata/facet/access.carbon b/toolchain/check/testdata/facet/access.carbon index f33355c217a7..0b284d9f8419 100644 --- a/toolchain/check/testdata/facet/access.carbon +++ b/toolchain/check/testdata/facet/access.carbon @@ -43,7 +43,7 @@ fn Use(T:! I) -> T { library "[[@TEST_NAME]]"; interface I { - fn Copy[self: Self]() -> Self; + fn Copy(self) -> Self; } //@dump-sem-ir-begin @@ -71,7 +71,7 @@ fn Use[T:! I](x: T){ library "[[@TEST_NAME]]"; interface I { - fn Copy[self: Self]() -> Self; + fn Copy(self) -> Self; } fn UseIndirect[T:! I](x: T) -> T { @@ -196,7 +196,7 @@ library "[[@TEST_NAME]]"; interface I { let X:! type; - fn G[self: Self]() -> X*; + fn G(self) -> X*; } fn F(U:! I where .X = .Self, v: U) { @@ -416,6 +416,7 @@ fn F(U:! W, V:! Z(.Self) where .Z1 impls (Y where .Y1 impls (X where .X1 = U))) V.(Z(V).Z1).(Y.Y1).(X.X1) as W; } + // CHECK:STDOUT: --- access_assoc_fn.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -570,17 +571,18 @@ fn F(U:! W, V:! Z(.Self) where .Z1 impls (Y where .Y1 impls (X where .X1 = U))) // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc9_18.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %I.WithSelf.Copy.type: type = fn_type @I.WithSelf.Copy, @I.WithSelf(%T.loc9_9.1) [symbolic = %I.WithSelf.Copy.type (constants.%I.WithSelf.Copy.type.54f)] -// CHECK:STDOUT: %.loc10: type = fn_type_with_self_type %I.WithSelf.Copy.type, %T.loc9_9.1 [symbolic = %.loc10 (constants.%.c06)] +// CHECK:STDOUT: %.loc10_11: type = fn_type_with_self_type %I.WithSelf.Copy.type, %T.loc9_9.1 [symbolic = %.loc10_11 (constants.%.c06)] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %T.loc9_9.1, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc10_11.2: @Use.%.loc10 (%.c06) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_11.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc10_11.2: @Use.%.loc10_11 (%.c06) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_11.2 (constants.%impl.elem0)] // CHECK:STDOUT: %specific_impl_fn.loc10_11.2: = specific_impl_function %impl.elem0.loc10_11.2, @I.WithSelf.Copy(%T.loc9_9.1) [symbolic = %specific_impl_fn.loc10_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @Use.%T.as_type.loc9_18.1 (%T.as_type)) -> out %return.param: @Use.%T.as_type.loc9_18.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @Use.%T.as_type.loc9_18.1 (%T.as_type) = name_ref x, %x // CHECK:STDOUT: %Copy.ref: %I.assoc_type = name_ref Copy, @I.WithSelf.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc10_11.1: @Use.%.loc10 (%.c06) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_11.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc10_11.1: @Use.%.loc10_11 (%.c06) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_11.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc10_11: = bound_method %x.ref, %impl.elem0.loc10_11.1 +// CHECK:STDOUT: %.loc10_17: %I.type = converted constants.%T.as_type, constants.%T [symbolic = %T.loc9_9.1 (constants.%T)] // CHECK:STDOUT: %specific_impl_fn.loc10_11.1: = specific_impl_function %impl.elem0.loc10_11.1, @I.WithSelf.Copy(constants.%T) [symbolic = %specific_impl_fn.loc10_11.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc10_17: = bound_method %x.ref, %specific_impl_fn.loc10_11.1 // CHECK:STDOUT: %.loc9_24.1: ref @Use.%T.as_type.loc9_18.1 (%T.as_type) = splice_block %return.param {} @@ -678,6 +680,7 @@ fn F(U:! W, V:! Z(.Self) where .Z1 impls (Y where .Y1 impls (X where .X1 = U))) // CHECK:STDOUT: %Copy.ref: %I.assoc_type = name_ref Copy, @I.WithSelf.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0.loc10_14.1: @UseIndirect.%.loc10_14.2 (%.c06) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_14.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc10_11: = bound_method %x.ref, %impl.elem0.loc10_14.1 +// CHECK:STDOUT: %.loc10_21: %I.type = converted constants.%T.as_type, constants.%T [symbolic = %T.loc8_17.1 (constants.%T)] // CHECK:STDOUT: %specific_impl_fn.loc10_14.1: = specific_impl_function %impl.elem0.loc10_14.1, @I.WithSelf.Copy(constants.%T) [symbolic = %specific_impl_fn.loc10_14.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc10_21: = bound_method %x.ref, %specific_impl_fn.loc10_14.1 // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/combine.carbon b/toolchain/check/testdata/facet/combine.carbon index fe4f8100aea7..841ce1af8cb4 100644 --- a/toolchain/check/testdata/facet/combine.carbon +++ b/toolchain/check/testdata/facet/combine.carbon @@ -43,13 +43,13 @@ library "[[@TEST_NAME]]"; interface A {} interface B { - fn BB[self: Self](); + fn BB(self); } class C {} impl C as A {} impl C as B { - fn BB[unused self: Self]() {} + fn BB(unused self) {} } fn G[T:! A & B](unused t: T) {} diff --git a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon index 11fbe2bf0e4e..7615d126d67d 100644 --- a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon +++ b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon @@ -21,7 +21,7 @@ class RuntimeConvertTo {} impl RuntimeConvertFrom as Core.ImplicitAs(RuntimeConvertTo) { // Runtime conversion function - fn Convert[unused self: Self]() -> RuntimeConvertTo { return {}; } + fn Convert(unused self) -> RuntimeConvertTo { return {}; } } fn F[T:! (type, )](unused A:! T.0, unused x: HoldsType(T)) {} @@ -40,6 +40,7 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { F(from, holds_to); } + // CHECK:STDOUT: --- fail_deduction_uses_runtime_type_conversion.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -192,7 +193,7 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: %return.patt: %pattern_type.c10 = return_slot_pattern %return.param_patt, %RuntimeConvertTo.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %RuntimeConvertTo.ref: type = name_ref RuntimeConvertTo, file.%RuntimeConvertTo.decl [concrete = constants.%RuntimeConvertTo] -// CHECK:STDOUT: %.loc24_38: Core.Form = init_form %RuntimeConvertTo.ref [concrete = constants.%.aac] +// CHECK:STDOUT: %.loc24_30: Core.Form = init_form %RuntimeConvertTo.ref [concrete = constants.%.aac] // CHECK:STDOUT: %self.param: %RuntimeConvertFrom = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @RuntimeConvertFrom.as.ImplicitAs.impl.%RuntimeConvertFrom.ref [concrete = constants.%RuntimeConvertFrom] // CHECK:STDOUT: %self: %RuntimeConvertFrom = value_binding self, %self.param @@ -241,10 +242,10 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), from:! RuntimeConvertFrom) { // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeConvertFrom.as.ImplicitAs.impl.Convert(%self.param: %RuntimeConvertFrom) -> out %return.param: %RuntimeConvertTo { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc24_65.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc24_65.2: init %RuntimeConvertTo to %return.param = class_init () [concrete = constants.%RuntimeConvertTo.val] -// CHECK:STDOUT: %.loc24_66: init %RuntimeConvertTo = converted %.loc24_65.1, %.loc24_65.2 [concrete = constants.%RuntimeConvertTo.val] -// CHECK:STDOUT: return %.loc24_66 to %return.param +// CHECK:STDOUT: %.loc24_57.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc24_57.2: init %RuntimeConvertTo to %return.param = class_init () [concrete = constants.%RuntimeConvertTo.val] +// CHECK:STDOUT: %.loc24_58: init %RuntimeConvertTo = converted %.loc24_57.1, %.loc24_57.2 [concrete = constants.%RuntimeConvertTo.val] +// CHECK:STDOUT: return %.loc24_58 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc27_7.2: %tuple.type, %A.loc27_28.2: @F.%tuple.elem0.loc27_32.1 (%tuple.elem0)) { diff --git a/toolchain/check/testdata/facet/period_self.carbon b/toolchain/check/testdata/facet/period_self.carbon index a9ff0dff7636..f8961c71b03e 100644 --- a/toolchain/check/testdata/facet/period_self.carbon +++ b/toolchain/check/testdata/facet/period_self.carbon @@ -311,7 +311,7 @@ fn F(unused U:! Core.Destroy & I(.Self)) {} library "[[@TEST_NAME]]"; interface I(T:! Core.Destroy) { - fn G[self: Self]() -> T; + fn G(self) -> T; } fn F[U:! Core.Destroy where .Self impls I(.Self)](u: U) { diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index 065905d5c718..33bf3414bd10 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -21,8 +21,8 @@ class IntRange(N:! Core.IntLiteral) { } impl as Core.Iterate where .CursorType = Core.Int(N) and .ElementType = Core.Int(N) { - fn NewCursor[self: Self]() -> Core.Int(N) { return self.start; } - fn Next[self: Self](cursor: Core.Int(N)*) -> Core.Optional(Core.Int(N)) { + fn NewCursor(self) -> Core.Int(N) { return self.start; } + fn Next(self, cursor: Core.Int(N)*) -> Core.Optional(Core.Int(N)) { var value: Core.Int(N) = *cursor; if (value < self.end) { ++*cursor; @@ -49,6 +49,7 @@ fn Read(y:! Core.IntLiteral) { var unused x: IntRange(32) = Range(y); } + // CHECK:STDOUT: --- lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -309,60 +310,60 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: // CHECK:STDOUT: impl: %Self.ref as %.loc9_24 { // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor.decl: @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.NewCursor.type (%IntRange.as.Iterate.impl.NewCursor.type) = fn_decl @IntRange.as.Iterate.impl.NewCursor [symbolic = @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.NewCursor (constants.%IntRange.as.Iterate.impl.NewCursor)] { -// CHECK:STDOUT: %self.param_patt: @IntRange.as.Iterate.impl.NewCursor.%pattern_type.loc10_22 (%pattern_type.1ea) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @IntRange.as.Iterate.impl.NewCursor.%pattern_type.loc10_22 (%pattern_type.1ea) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @IntRange.as.Iterate.impl.NewCursor.%pattern_type.loc10_45 (%pattern_type.142cb7.1) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @IntRange.as.Iterate.impl.NewCursor.%pattern_type.loc10_45 (%pattern_type.142cb7.1) = return_slot_pattern %return.param_patt, %Int.loc10_45.2 [concrete] +// CHECK:STDOUT: %self.param_patt: @IntRange.as.Iterate.impl.NewCursor.%pattern_type.loc10_18 (%pattern_type.1ea) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @IntRange.as.Iterate.impl.NewCursor.%pattern_type.loc10_18 (%pattern_type.1ea) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @IntRange.as.Iterate.impl.NewCursor.%pattern_type.loc10_37 (%pattern_type.142cb7.1) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @IntRange.as.Iterate.impl.NewCursor.%pattern_type.loc10_37 (%pattern_type.142cb7.1) = return_slot_pattern %return.param_patt, %Int.loc10_37.2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc10_45.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc10_45.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %.loc10_45.2: Core.Form = init_form %Int.loc10_45.2 [symbolic = %.loc10_45.1 (constants.%.df5d8d.1)] +// CHECK:STDOUT: %Int.loc10_37.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc10_37.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %.loc10_37.2: Core.Form = init_form %Int.loc10_37.2 [symbolic = %.loc10_37.1 (constants.%.df5d8d.1)] // CHECK:STDOUT: %self.param: @IntRange.as.Iterate.impl.NewCursor.%IntRange (%IntRange.2c4) = value_param call_param0 -// CHECK:STDOUT: %.loc10_24.1: type = splice_block %Self.ref [symbolic = %IntRange (constants.%IntRange.2c4)] { -// CHECK:STDOUT: %.loc10_24.2: type = specific_constant constants.%IntRange.2c4, @IntRange(constants.%N) [symbolic = %IntRange (constants.%IntRange.2c4)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_24.2 [symbolic = %IntRange (constants.%IntRange.2c4)] +// CHECK:STDOUT: %.loc10_18.1: type = splice_block %Self.ref [symbolic = %IntRange (constants.%IntRange.2c4)] { +// CHECK:STDOUT: %.loc10_18.2: type = specific_constant constants.%IntRange.2c4, @IntRange(constants.%N) [symbolic = %IntRange (constants.%IntRange.2c4)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_18.2 [symbolic = %IntRange (constants.%IntRange.2c4)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @IntRange.as.Iterate.impl.NewCursor.%IntRange (%IntRange.2c4) = value_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_45.1 (%Int.67af24.1) = out_param call_param1 -// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_45.1 (%Int.67af24.1) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_37.1 (%Int.67af24.1) = out_param call_param1 +// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_37.1 (%Int.67af24.1) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %IntRange.as.Iterate.impl.Next.decl: @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.Next.type (%IntRange.as.Iterate.impl.Next.type) = fn_decl @IntRange.as.Iterate.impl.Next [symbolic = @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.Next (constants.%IntRange.as.Iterate.impl.Next)] { -// CHECK:STDOUT: %self.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_17 (%pattern_type.1ea) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_17 (%pattern_type.1ea) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %cursor.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_31 (%pattern_type.833) = value_param_pattern [concrete] -// CHECK:STDOUT: %cursor.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_31 (%pattern_type.833) = at_binding_pattern cursor, %cursor.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_75 (%pattern_type.b38) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_75 (%pattern_type.b38) = return_slot_pattern %return.param_patt, %Optional.loc11_75.2 [concrete] +// CHECK:STDOUT: %self.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_13 (%pattern_type.1ea) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_13 (%pattern_type.1ea) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %cursor.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.833) = value_param_pattern [concrete] +// CHECK:STDOUT: %cursor.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.833) = at_binding_pattern cursor, %cursor.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_69 (%pattern_type.b38) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_69 (%pattern_type.b38) = return_slot_pattern %return.param_patt, %Optional.loc11_69.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc11_50: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Core.ref.loc11_44: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Optional.ref.loc11: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic] -// CHECK:STDOUT: %Core.ref.loc11_64: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %Int.ref.loc11_68: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] -// CHECK:STDOUT: %N.ref.loc11_73: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc11_74: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %OptionalStorage.facet.loc11_75.2: %OptionalStorage.type = facet_value %Int.loc11_74, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc11_75.5: %OptionalStorage.type = converted %Int.loc11_74, %OptionalStorage.facet.loc11_75.2 [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %Optional.loc11_75.2: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_75.1 (constants.%Optional.5ec)] -// CHECK:STDOUT: %.loc11_75.6: Core.Form = init_form %Optional.loc11_75.2 [symbolic = %.loc11_75.4 (constants.%.3f3)] +// CHECK:STDOUT: %Core.ref.loc11_58: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Int.ref.loc11_62: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] +// CHECK:STDOUT: %N.ref.loc11_67: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %Int.loc11_68: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %OptionalStorage.facet.loc11_69.2: %OptionalStorage.type = facet_value %Int.loc11_68, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc11_69.5: %OptionalStorage.type = converted %Int.loc11_68, %OptionalStorage.facet.loc11_69.2 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %Optional.loc11_69.2: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_69.1 (constants.%Optional.5ec)] +// CHECK:STDOUT: %.loc11_69.6: Core.Form = init_form %Optional.loc11_69.2 [symbolic = %.loc11_69.4 (constants.%.3f3)] // CHECK:STDOUT: %self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4) = value_param call_param0 -// CHECK:STDOUT: %.loc11_19.1: type = splice_block %Self.ref [symbolic = %IntRange (constants.%IntRange.2c4)] { -// CHECK:STDOUT: %.loc11_19.2: type = specific_constant constants.%IntRange.2c4, @IntRange(constants.%N) [symbolic = %IntRange (constants.%IntRange.2c4)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc11_19.2 [symbolic = %IntRange (constants.%IntRange.2c4)] +// CHECK:STDOUT: %.loc11_13.1: type = splice_block %Self.ref [symbolic = %IntRange (constants.%IntRange.2c4)] { +// CHECK:STDOUT: %.loc11_13.2: type = specific_constant constants.%IntRange.2c4, @IntRange(constants.%N) [symbolic = %IntRange (constants.%IntRange.2c4)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc11_13.2 [symbolic = %IntRange (constants.%IntRange.2c4)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4) = value_binding self, %self.param -// CHECK:STDOUT: %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.41e) = value_param call_param1 -// CHECK:STDOUT: %.loc11_44: type = splice_block %ptr.loc11_44.2 [symbolic = %ptr.loc11_44.1 (constants.%ptr.41e)] { -// CHECK:STDOUT: %Core.ref.loc11_33: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %Int.ref.loc11_37: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] -// CHECK:STDOUT: %N.ref.loc11_42: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc11_43.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %ptr.loc11_44.2: type = ptr_type %Int.loc11_43.2 [symbolic = %ptr.loc11_44.1 (constants.%ptr.41e)] +// CHECK:STDOUT: %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e) = value_param call_param1 +// CHECK:STDOUT: %.loc11_38: type = splice_block %ptr.loc11_38.2 [symbolic = %ptr.loc11_38.1 (constants.%ptr.41e)] { +// CHECK:STDOUT: %Core.ref.loc11_27: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Int.ref.loc11_31: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] +// CHECK:STDOUT: %N.ref.loc11_36: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %Int.loc11_37.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %ptr.loc11_38.2: type = ptr_type %Int.loc11_37.2 [symbolic = %ptr.loc11_38.1 (constants.%ptr.41e)] // CHECK:STDOUT: } -// CHECK:STDOUT: %cursor: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.41e) = value_binding cursor, %cursor.param -// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.5ec) = out_param call_param2 -// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.5ec) = return_slot %return.param +// CHECK:STDOUT: %cursor: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e) = value_binding cursor, %cursor.param +// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = out_param call_param2 +// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant.loc9_87.2, %impl_witness_assoc_constant.loc9_87.1, %IntRange.as.Iterate.impl.NewCursor.decl, %IntRange.as.Iterate.impl.Next.decl), @IntRange.as.Iterate.impl [concrete] // CHECK:STDOUT: %Iterate.impl_witness.loc9_87.1: = impl_witness %Iterate.impl_witness_table, @IntRange.as.Iterate.impl(constants.%N) [symbolic = %Iterate.impl_witness.loc9_87.2 (constants.%Iterate.impl_witness)] @@ -481,28 +482,32 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: %require_complete.loc5_16: = require_complete_type %Int.loc5_28.1 [symbolic = %require_complete.loc5_16 (constants.%require_complete.4dfb92.1)] // CHECK:STDOUT: %require_complete.loc5_49: = require_complete_type %IntRange [symbolic = %require_complete.loc5_49 (constants.%require_complete.5d9)] // CHECK:STDOUT: %struct_type.start.end: type = struct_type {.start: @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1), .end: @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1)} [symbolic = %struct_type.start.end (constants.%struct_type.start.end.d4d)] -// CHECK:STDOUT: %.loc6_22.1: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc6_22.1 (constants.%.a53)] +// CHECK:STDOUT: %.loc6_22.2: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc6_22.2 (constants.%.a53)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc5_28.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.df6)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Int.loc5_28.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.f12)] -// 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.b83)] -// CHECK:STDOUT: %.loc6_22.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc6_22.2 (constants.%.c60)] -// CHECK:STDOUT: %impl.elem0.loc6_22.2: @IntRange.Make.%.loc6_22.2 (%.c60) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.284)] -// CHECK:STDOUT: %specific_impl_fn.loc6_22.2: = specific_impl_function %impl.elem0.loc6_22.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc6_22.2 (constants.%specific_impl_fn.f9f)] +// CHECK:STDOUT: %Copy.facet.loc6_22.2: %Copy.type = facet_value %Int.loc5_28.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc6_22.2 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc6_22.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.b83)] +// CHECK:STDOUT: %.loc6_22.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc6_22.2 [symbolic = %.loc6_22.3 (constants.%.c60)] +// CHECK:STDOUT: %impl.elem0.loc6_22.2: @IntRange.Make.%.loc6_22.3 (%.c60) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %specific_impl_fn.loc6_22.2: = specific_impl_function %impl.elem0.loc6_22.2, @Copy.WithSelf.Op(%Copy.facet.loc6_22.2) [symbolic = %specific_impl_fn.loc6_22.2 (constants.%specific_impl_fn.f9f)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%start.param: @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1), %end.param: @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1)) -> out %return.param: @IntRange.Make.%IntRange (%IntRange.2c4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %start.ref: @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1) = name_ref start, %start // CHECK:STDOUT: %end.ref: @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1) = name_ref end, %end // CHECK:STDOUT: %.loc6_39.1: @IntRange.Make.%struct_type.start.end (%struct_type.start.end.d4d) = struct_literal (%start.ref, %end.ref) -// CHECK:STDOUT: %impl.elem0.loc6_22.1: @IntRange.Make.%.loc6_22.2 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %impl.elem0.loc6_22.1: @IntRange.Make.%.loc6_22.3 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.284)] // CHECK:STDOUT: %bound_method.loc6_22.1: = bound_method %start.ref, %impl.elem0.loc6_22.1 +// CHECK:STDOUT: %Copy.facet.loc6_22.1: %Copy.type = facet_value constants.%Int.67af24.1, (constants.%Copy.lookup_impl_witness.df6) [symbolic = %Copy.facet.loc6_22.2 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %.loc6_22.1: %Copy.type = converted constants.%Int.67af24.1, %Copy.facet.loc6_22.1 [symbolic = %Copy.facet.loc6_22.2 (constants.%Copy.facet.f12)] // CHECK:STDOUT: %specific_impl_fn.loc6_22.1: = specific_impl_function %impl.elem0.loc6_22.1, @Copy.WithSelf.Op(constants.%Copy.facet.f12) [symbolic = %specific_impl_fn.loc6_22.2 (constants.%specific_impl_fn.f9f)] // CHECK:STDOUT: %bound_method.loc6_22.2: = bound_method %start.ref, %specific_impl_fn.loc6_22.1 // CHECK:STDOUT: %Copy.WithSelf.Op.call.loc6_22: init @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1) = call %bound_method.loc6_22.2(%start.ref) // CHECK:STDOUT: %.loc6_39.2: ref @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1) = class_element_access %return.param, element0 // CHECK:STDOUT: %.loc6_39.3: init @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1) to %.loc6_39.2 = in_place_init %Copy.WithSelf.Op.call.loc6_22 -// CHECK:STDOUT: %impl.elem0.loc6_36: @IntRange.Make.%.loc6_22.2 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %impl.elem0.loc6_36: @IntRange.Make.%.loc6_22.3 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.284)] // CHECK:STDOUT: %bound_method.loc6_36.1: = bound_method %end.ref, %impl.elem0.loc6_36 +// CHECK:STDOUT: %Copy.facet.loc6_36: %Copy.type = facet_value constants.%Int.67af24.1, (constants.%Copy.lookup_impl_witness.df6) [symbolic = %Copy.facet.loc6_22.2 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %.loc6_36: %Copy.type = converted constants.%Int.67af24.1, %Copy.facet.loc6_36 [symbolic = %Copy.facet.loc6_22.2 (constants.%Copy.facet.f12)] // CHECK:STDOUT: %specific_impl_fn.loc6_36: = specific_impl_function %impl.elem0.loc6_36, @Copy.WithSelf.Op(constants.%Copy.facet.f12) [symbolic = %specific_impl_fn.loc6_22.2 (constants.%specific_impl_fn.f9f)] // CHECK:STDOUT: %bound_method.loc6_36.2: = bound_method %end.ref, %specific_impl_fn.loc6_36 // CHECK:STDOUT: %Copy.WithSelf.Op.call.loc6_36: init @IntRange.Make.%Int.loc5_28.1 (%Int.67af24.1) = call %bound_method.loc6_36.2(%end.ref) @@ -517,34 +522,36 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: generic fn @IntRange.as.Iterate.impl.NewCursor(@IntRange.%N.loc4_17.2: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %IntRange: type = class_type @IntRange, @IntRange(%N) [symbolic = %IntRange (constants.%IntRange.2c4)] -// CHECK:STDOUT: %pattern_type.loc10_22: type = pattern_type %IntRange [symbolic = %pattern_type.loc10_22 (constants.%pattern_type.1ea)] -// CHECK:STDOUT: %Int.loc10_45.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc10_45.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %.loc10_45.1: Core.Form = init_form %Int.loc10_45.1 [symbolic = %.loc10_45.1 (constants.%.df5d8d.1)] -// CHECK:STDOUT: %pattern_type.loc10_45: type = pattern_type %Int.loc10_45.1 [symbolic = %pattern_type.loc10_45 (constants.%pattern_type.142cb7.1)] +// CHECK:STDOUT: %pattern_type.loc10_18: type = pattern_type %IntRange [symbolic = %pattern_type.loc10_18 (constants.%pattern_type.1ea)] +// CHECK:STDOUT: %Int.loc10_37.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc10_37.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %.loc10_37.1: Core.Form = init_form %Int.loc10_37.1 [symbolic = %.loc10_37.1 (constants.%.df5d8d.1)] +// CHECK:STDOUT: %pattern_type.loc10_37: type = pattern_type %Int.loc10_37.1 [symbolic = %pattern_type.loc10_37 (constants.%pattern_type.142cb7.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc10_22: = require_complete_type %IntRange [symbolic = %require_complete.loc10_22 (constants.%require_complete.5d9)] -// CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc10_45.1 [symbolic = %IntRange.elem (constants.%IntRange.elem.bed)] -// CHECK:STDOUT: %require_complete.loc10_60: = require_complete_type %Int.loc10_45.1 [symbolic = %require_complete.loc10_60 (constants.%require_complete.4dfb92.1)] -// CHECK:STDOUT: %.loc10_60.3: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc10_60.3 (constants.%.a53)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc10_45.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.df6)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Int.loc10_45.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.f12)] -// 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.b83)] -// CHECK:STDOUT: %.loc10_60.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc10_60.4 (constants.%.c60)] -// CHECK:STDOUT: %impl.elem0.loc10_60.2: @IntRange.as.Iterate.impl.NewCursor.%.loc10_60.4 (%.c60) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.284)] -// CHECK:STDOUT: %specific_impl_fn.loc10_60.2: = specific_impl_function %impl.elem0.loc10_60.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.f9f)] +// CHECK:STDOUT: %require_complete.loc10_18: = require_complete_type %IntRange [symbolic = %require_complete.loc10_18 (constants.%require_complete.5d9)] +// CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc10_37.1 [symbolic = %IntRange.elem (constants.%IntRange.elem.bed)] +// CHECK:STDOUT: %require_complete.loc10_52: = require_complete_type %Int.loc10_37.1 [symbolic = %require_complete.loc10_52 (constants.%require_complete.4dfb92.1)] +// CHECK:STDOUT: %.loc10_52.4: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc10_52.4 (constants.%.a53)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc10_37.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.df6)] +// CHECK:STDOUT: %Copy.facet.loc10_52.2: %Copy.type = facet_value %Int.loc10_37.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_52.2 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc10_52.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.b83)] +// CHECK:STDOUT: %.loc10_52.5: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc10_52.2 [symbolic = %.loc10_52.5 (constants.%.c60)] +// CHECK:STDOUT: %impl.elem0.loc10_52.2: @IntRange.as.Iterate.impl.NewCursor.%.loc10_52.5 (%.c60) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_52.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %specific_impl_fn.loc10_52.2: = specific_impl_function %impl.elem0.loc10_52.2, @Copy.WithSelf.Op(%Copy.facet.loc10_52.2) [symbolic = %specific_impl_fn.loc10_52.2 (constants.%specific_impl_fn.f9f)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.NewCursor.%IntRange (%IntRange.2c4)) -> out %return.param: @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_45.1 (%Int.67af24.1) { +// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.NewCursor.%IntRange (%IntRange.2c4)) -> out %return.param: @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_37.1 (%Int.67af24.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: @IntRange.as.Iterate.impl.NewCursor.%IntRange (%IntRange.2c4) = name_ref self, %self // CHECK:STDOUT: %start.ref: @IntRange.as.Iterate.impl.NewCursor.%IntRange.elem (%IntRange.elem.bed) = name_ref start, @IntRange.%.loc22 [concrete = @IntRange.%.loc22] -// CHECK:STDOUT: %.loc10_60.1: ref @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_45.1 (%Int.67af24.1) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc10_60.2: @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_45.1 (%Int.67af24.1) = acquire_value %.loc10_60.1 -// CHECK:STDOUT: %impl.elem0.loc10_60.1: @IntRange.as.Iterate.impl.NewCursor.%.loc10_60.4 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.284)] -// CHECK:STDOUT: %bound_method.loc10_60.1: = bound_method %.loc10_60.2, %impl.elem0.loc10_60.1 -// CHECK:STDOUT: %specific_impl_fn.loc10_60.1: = specific_impl_function %impl.elem0.loc10_60.1, @Copy.WithSelf.Op(constants.%Copy.facet.f12) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.f9f)] -// CHECK:STDOUT: %bound_method.loc10_60.2: = bound_method %.loc10_60.2, %specific_impl_fn.loc10_60.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_45.1 (%Int.67af24.1) = call %bound_method.loc10_60.2(%.loc10_60.2) +// CHECK:STDOUT: %.loc10_52.1: ref @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_37.1 (%Int.67af24.1) = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc10_52.2: @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_37.1 (%Int.67af24.1) = acquire_value %.loc10_52.1 +// CHECK:STDOUT: %impl.elem0.loc10_52.1: @IntRange.as.Iterate.impl.NewCursor.%.loc10_52.5 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc10_52.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %bound_method.loc10_52.1: = bound_method %.loc10_52.2, %impl.elem0.loc10_52.1 +// CHECK:STDOUT: %Copy.facet.loc10_52.1: %Copy.type = facet_value constants.%Int.67af24.1, (constants.%Copy.lookup_impl_witness.df6) [symbolic = %Copy.facet.loc10_52.2 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %.loc10_52.3: %Copy.type = converted constants.%Int.67af24.1, %Copy.facet.loc10_52.1 [symbolic = %Copy.facet.loc10_52.2 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %specific_impl_fn.loc10_52.1: = specific_impl_function %impl.elem0.loc10_52.1, @Copy.WithSelf.Op(constants.%Copy.facet.f12) [symbolic = %specific_impl_fn.loc10_52.2 (constants.%specific_impl_fn.f9f)] +// CHECK:STDOUT: %bound_method.loc10_52.2: = bound_method %.loc10_52.2, %specific_impl_fn.loc10_52.1 +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @IntRange.as.Iterate.impl.NewCursor.%Int.loc10_37.1 (%Int.67af24.1) = call %bound_method.loc10_52.2(%.loc10_52.2) // CHECK:STDOUT: return %Copy.WithSelf.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -552,92 +559,94 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: generic fn @IntRange.as.Iterate.impl.Next(@IntRange.%N.loc4_17.2: Core.IntLiteral) { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %IntRange: type = class_type @IntRange, @IntRange(%N) [symbolic = %IntRange (constants.%IntRange.2c4)] -// CHECK:STDOUT: %pattern_type.loc11_17: type = pattern_type %IntRange [symbolic = %pattern_type.loc11_17 (constants.%pattern_type.1ea)] -// CHECK:STDOUT: %Int.loc11_43.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc11_43.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %ptr.loc11_44.1: type = ptr_type %Int.loc11_43.1 [symbolic = %ptr.loc11_44.1 (constants.%ptr.41e)] -// CHECK:STDOUT: %pattern_type.loc11_31: type = pattern_type %ptr.loc11_44.1 [symbolic = %pattern_type.loc11_31 (constants.%pattern_type.833)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_43.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.173)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_43.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.df6)] -// CHECK:STDOUT: %facet_value: %facet_type.f48 = facet_value %Int.loc11_43.1, (%Destroy.lookup_impl_witness, %Copy.lookup_impl_witness) [symbolic = %facet_value (constants.%facet_value)] -// CHECK:STDOUT: %.loc11_75.3: require_specific_def_type = require_specific_def @T.as_type.as.OptionalStorage.impl(%facet_value) [symbolic = %.loc11_75.3 (constants.%.17c)] -// CHECK:STDOUT: %OptionalStorage.lookup_impl_witness: = lookup_impl_witness %Int.loc11_43.1, @OptionalStorage [symbolic = %OptionalStorage.lookup_impl_witness (constants.%OptionalStorage.lookup_impl_witness.a32)] -// CHECK:STDOUT: %OptionalStorage.facet.loc11_75.1: %OptionalStorage.type = facet_value %Int.loc11_43.1, (%OptionalStorage.lookup_impl_witness) [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %Optional.loc11_75.1: type = class_type @Optional, @Optional(%OptionalStorage.facet.loc11_75.1) [symbolic = %Optional.loc11_75.1 (constants.%Optional.5ec)] -// CHECK:STDOUT: %.loc11_75.4: Core.Form = init_form %Optional.loc11_75.1 [symbolic = %.loc11_75.4 (constants.%.3f3)] -// CHECK:STDOUT: %pattern_type.loc11_75: type = pattern_type %Optional.loc11_75.1 [symbolic = %pattern_type.loc11_75 (constants.%pattern_type.b38)] +// CHECK:STDOUT: %pattern_type.loc11_13: type = pattern_type %IntRange [symbolic = %pattern_type.loc11_13 (constants.%pattern_type.1ea)] +// CHECK:STDOUT: %Int.loc11_37.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %ptr.loc11_38.1: type = ptr_type %Int.loc11_37.1 [symbolic = %ptr.loc11_38.1 (constants.%ptr.41e)] +// CHECK:STDOUT: %pattern_type.loc11_25: type = pattern_type %ptr.loc11_38.1 [symbolic = %pattern_type.loc11_25 (constants.%pattern_type.833)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_37.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.173)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_37.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.df6)] +// CHECK:STDOUT: %facet_value: %facet_type.f48 = facet_value %Int.loc11_37.1, (%Destroy.lookup_impl_witness, %Copy.lookup_impl_witness) [symbolic = %facet_value (constants.%facet_value)] +// CHECK:STDOUT: %.loc11_69.3: require_specific_def_type = require_specific_def @T.as_type.as.OptionalStorage.impl(%facet_value) [symbolic = %.loc11_69.3 (constants.%.17c)] +// CHECK:STDOUT: %OptionalStorage.lookup_impl_witness: = lookup_impl_witness %Int.loc11_37.1, @OptionalStorage [symbolic = %OptionalStorage.lookup_impl_witness (constants.%OptionalStorage.lookup_impl_witness.a32)] +// CHECK:STDOUT: %OptionalStorage.facet.loc11_69.1: %OptionalStorage.type = facet_value %Int.loc11_37.1, (%OptionalStorage.lookup_impl_witness) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %Optional.loc11_69.1: type = class_type @Optional, @Optional(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.loc11_69.1 (constants.%Optional.5ec)] +// CHECK:STDOUT: %.loc11_69.4: Core.Form = init_form %Optional.loc11_69.1 [symbolic = %.loc11_69.4 (constants.%.3f3)] +// CHECK:STDOUT: %pattern_type.loc11_69: type = pattern_type %Optional.loc11_69.1 [symbolic = %pattern_type.loc11_69 (constants.%pattern_type.b38)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc11_17: = require_complete_type %IntRange [symbolic = %require_complete.loc11_17 (constants.%require_complete.5d9)] -// CHECK:STDOUT: %require_complete.loc11_31: = require_complete_type %ptr.loc11_44.1 [symbolic = %require_complete.loc11_31 (constants.%require_complete.f79)] -// CHECK:STDOUT: %require_complete.loc11_47: = require_complete_type %Optional.loc11_75.1 [symbolic = %require_complete.loc11_47 (constants.%require_complete.63c)] -// CHECK:STDOUT: %require_complete.loc12: = require_complete_type %Int.loc11_43.1 [symbolic = %require_complete.loc12 (constants.%require_complete.4dfb92.1)] -// CHECK:STDOUT: %pattern_type.loc12: type = pattern_type %Int.loc11_43.1 [symbolic = %pattern_type.loc12 (constants.%pattern_type.142cb7.1)] -// CHECK:STDOUT: %.loc12_32.3: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc12_32.3 (constants.%.a53)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Int.loc11_43.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.f12)] -// 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.b83)] -// CHECK:STDOUT: %.loc12_32.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc12_32.4 (constants.%.c60)] -// CHECK:STDOUT: %impl.elem0.loc12_32.2: @IntRange.as.Iterate.impl.Next.%.loc12_32.4 (%.c60) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.284)] -// CHECK:STDOUT: %specific_impl_fn.loc12_32.2: = specific_impl_function %impl.elem0.loc12_32.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.f9f)] -// CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc11_43.1 [symbolic = %IntRange.elem (constants.%IntRange.elem.bed)] -// CHECK:STDOUT: %OrderedWith.type.loc13_17.2: type = facet_type <@OrderedWith, @OrderedWith(%Int.loc11_43.1)> [symbolic = %OrderedWith.type.loc13_17.2 (constants.%OrderedWith.type.6f8)] +// CHECK:STDOUT: %require_complete.loc11_13: = require_complete_type %IntRange [symbolic = %require_complete.loc11_13 (constants.%require_complete.5d9)] +// CHECK:STDOUT: %require_complete.loc11_25: = require_complete_type %ptr.loc11_38.1 [symbolic = %require_complete.loc11_25 (constants.%require_complete.f79)] +// CHECK:STDOUT: %require_complete.loc11_41: = require_complete_type %Optional.loc11_69.1 [symbolic = %require_complete.loc11_41 (constants.%require_complete.63c)] +// CHECK:STDOUT: %require_complete.loc12: = require_complete_type %Int.loc11_37.1 [symbolic = %require_complete.loc12 (constants.%require_complete.4dfb92.1)] +// CHECK:STDOUT: %pattern_type.loc12: type = pattern_type %Int.loc11_37.1 [symbolic = %pattern_type.loc12 (constants.%pattern_type.142cb7.1)] +// CHECK:STDOUT: %.loc12_32.4: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc12_32.4 (constants.%.a53)] +// CHECK:STDOUT: %Copy.facet.loc12_32.2: %Copy.type = facet_value %Int.loc11_37.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc12_32.2 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc12_32.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.b83)] +// CHECK:STDOUT: %.loc12_32.5: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc12_32.2 [symbolic = %.loc12_32.5 (constants.%.c60)] +// CHECK:STDOUT: %impl.elem0.loc12_32.2: @IntRange.as.Iterate.impl.Next.%.loc12_32.5 (%.c60) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %specific_impl_fn.loc12_32.2: = specific_impl_function %impl.elem0.loc12_32.2, @Copy.WithSelf.Op(%Copy.facet.loc12_32.2) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.f9f)] +// CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc11_37.1 [symbolic = %IntRange.elem (constants.%IntRange.elem.bed)] +// CHECK:STDOUT: %OrderedWith.type.loc13_17.2: type = facet_type <@OrderedWith, @OrderedWith(%Int.loc11_37.1)> [symbolic = %OrderedWith.type.loc13_17.2 (constants.%OrderedWith.type.6f8)] // CHECK:STDOUT: %require_complete.loc13: = require_complete_type %OrderedWith.type.loc13_17.2 [symbolic = %require_complete.loc13 (constants.%require_complete.4c8)] -// CHECK:STDOUT: %OrderedWith.assoc_type: type = assoc_entity_type @OrderedWith, @OrderedWith(%Int.loc11_43.1) [symbolic = %OrderedWith.assoc_type (constants.%OrderedWith.assoc_type.e6d)] +// CHECK:STDOUT: %OrderedWith.assoc_type: type = assoc_entity_type @OrderedWith, @OrderedWith(%Int.loc11_37.1) [symbolic = %OrderedWith.assoc_type (constants.%OrderedWith.assoc_type.e6d)] // CHECK:STDOUT: %assoc0: @IntRange.as.Iterate.impl.Next.%OrderedWith.assoc_type (%OrderedWith.assoc_type.e6d) = assoc_entity element0, imports.%Core.import_ref.e7a [symbolic = %assoc0 (constants.%assoc0.ebc)] // CHECK:STDOUT: %.loc13_17.2: require_specific_def_type = require_specific_def @Int.as.OrderedWith.impl.ab3(%N, %N) [symbolic = %.loc13_17.2 (constants.%.4a8)] // CHECK:STDOUT: %OrderedWith.impl_witness: = impl_witness imports.%OrderedWith.impl_witness_table.5c1, @Int.as.OrderedWith.impl.ab3(%N, %N) [symbolic = %OrderedWith.impl_witness (constants.%OrderedWith.impl_witness.339)] -// CHECK:STDOUT: %OrderedWith.facet: @IntRange.as.Iterate.impl.Next.%OrderedWith.type.loc13_17.2 (%OrderedWith.type.6f8) = facet_value %Int.loc11_43.1, (%OrderedWith.impl_witness) [symbolic = %OrderedWith.facet (constants.%OrderedWith.facet.bf1)] -// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Int.loc11_43.1, %OrderedWith.facet) [symbolic = %OrderedWith.WithSelf.Less.type (constants.%OrderedWith.WithSelf.Less.type.c02)] +// CHECK:STDOUT: %OrderedWith.facet: @IntRange.as.Iterate.impl.Next.%OrderedWith.type.loc13_17.2 (%OrderedWith.type.6f8) = facet_value %Int.loc11_37.1, (%OrderedWith.impl_witness) [symbolic = %OrderedWith.facet (constants.%OrderedWith.facet.bf1)] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Int.loc11_37.1, %OrderedWith.facet) [symbolic = %OrderedWith.WithSelf.Less.type (constants.%OrderedWith.WithSelf.Less.type.c02)] // CHECK:STDOUT: %.loc13_17.3: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type, %OrderedWith.facet [symbolic = %.loc13_17.3 (constants.%.08f)] // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less.type: type = fn_type @Int.as.OrderedWith.impl.Less.1, @Int.as.OrderedWith.impl.ab3(%N, %N) [symbolic = %Int.as.OrderedWith.impl.Less.type (constants.%Int.as.OrderedWith.impl.Less.type.f5c)] // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less: @IntRange.as.Iterate.impl.Next.%Int.as.OrderedWith.impl.Less.type (%Int.as.OrderedWith.impl.Less.type.f5c) = struct_value () [symbolic = %Int.as.OrderedWith.impl.Less (constants.%Int.as.OrderedWith.impl.Less.13c)] // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less.specific_fn: = specific_function %Int.as.OrderedWith.impl.Less, @Int.as.OrderedWith.impl.Less.1(%N, %N) [symbolic = %Int.as.OrderedWith.impl.Less.specific_fn (constants.%Int.as.OrderedWith.impl.Less.specific_fn.6ce)] -// CHECK:STDOUT: %.loc14_9.1: require_specific_def_type = require_specific_def @Int.as.Inc.impl(%N) [symbolic = %.loc14_9.1 (constants.%.f62)] -// CHECK:STDOUT: %Inc.lookup_impl_witness: = lookup_impl_witness %Int.loc11_43.1, @Inc [symbolic = %Inc.lookup_impl_witness (constants.%Inc.lookup_impl_witness)] -// CHECK:STDOUT: %Inc.facet: %Inc.type = facet_value %Int.loc11_43.1, (%Inc.lookup_impl_witness) [symbolic = %Inc.facet (constants.%Inc.facet)] -// CHECK:STDOUT: %Inc.WithSelf.Op.type: type = fn_type @Inc.WithSelf.Op, @Inc.WithSelf(%Inc.facet) [symbolic = %Inc.WithSelf.Op.type (constants.%Inc.WithSelf.Op.type.36a)] -// CHECK:STDOUT: %.loc14_9.2: type = fn_type_with_self_type %Inc.WithSelf.Op.type, %Inc.facet [symbolic = %.loc14_9.2 (constants.%.952)] -// CHECK:STDOUT: %impl.elem0.loc14_9.2: @IntRange.as.Iterate.impl.Next.%.loc14_9.2 (%.952) = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_9.2 (constants.%impl.elem0.7b5)] -// CHECK:STDOUT: %specific_impl_fn.loc14_9.2: = specific_impl_function %impl.elem0.loc14_9.2, @Inc.WithSelf.Op(%Inc.facet) [symbolic = %specific_impl_fn.loc14_9.2 (constants.%specific_impl_fn.ed1)] -// CHECK:STDOUT: %Optional.Some.type: type = fn_type @Optional.Some, @Optional(%OptionalStorage.facet.loc11_75.1) [symbolic = %Optional.Some.type (constants.%Optional.Some.type.422)] +// CHECK:STDOUT: %.loc14_9.2: require_specific_def_type = require_specific_def @Int.as.Inc.impl(%N) [symbolic = %.loc14_9.2 (constants.%.f62)] +// CHECK:STDOUT: %Inc.lookup_impl_witness: = lookup_impl_witness %Int.loc11_37.1, @Inc [symbolic = %Inc.lookup_impl_witness (constants.%Inc.lookup_impl_witness)] +// CHECK:STDOUT: %Inc.facet.loc14_9.2: %Inc.type = facet_value %Int.loc11_37.1, (%Inc.lookup_impl_witness) [symbolic = %Inc.facet.loc14_9.2 (constants.%Inc.facet)] +// CHECK:STDOUT: %Inc.WithSelf.Op.type: type = fn_type @Inc.WithSelf.Op, @Inc.WithSelf(%Inc.facet.loc14_9.2) [symbolic = %Inc.WithSelf.Op.type (constants.%Inc.WithSelf.Op.type.36a)] +// CHECK:STDOUT: %.loc14_9.3: type = fn_type_with_self_type %Inc.WithSelf.Op.type, %Inc.facet.loc14_9.2 [symbolic = %.loc14_9.3 (constants.%.952)] +// CHECK:STDOUT: %impl.elem0.loc14_9.2: @IntRange.as.Iterate.impl.Next.%.loc14_9.3 (%.952) = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_9.2 (constants.%impl.elem0.7b5)] +// CHECK:STDOUT: %specific_impl_fn.loc14_9.2: = specific_impl_function %impl.elem0.loc14_9.2, @Inc.WithSelf.Op(%Inc.facet.loc14_9.2) [symbolic = %specific_impl_fn.loc14_9.2 (constants.%specific_impl_fn.ed1)] +// CHECK:STDOUT: %Optional.Some.type: type = fn_type @Optional.Some, @Optional(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.Some.type (constants.%Optional.Some.type.422)] // CHECK:STDOUT: %Optional.Some: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.422) = struct_value () [symbolic = %Optional.Some (constants.%Optional.Some.bcf)] -// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%OptionalStorage.facet.loc11_75.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc11_43.1, (%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: %.loc12_7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc12_7 (constants.%.2c6)] -// CHECK:STDOUT: %impl.elem0.loc12_7.3: @IntRange.as.Iterate.impl.Next.%.loc12_7 (%.2c6) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] -// CHECK:STDOUT: %specific_impl_fn.loc12_7.3: = specific_impl_function %impl.elem0.loc12_7.3, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.693)] -// CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet.loc11_75.1) [symbolic = %Optional.None.type (constants.%Optional.None.type.2aa)] +// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] +// CHECK:STDOUT: %Destroy.facet.loc12_7.3: %Destroy.type = facet_value %Int.loc11_37.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc12_7.3 (constants.%Destroy.facet.7bb)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc12_7.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.8f1)] +// CHECK:STDOUT: %.loc12_7.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc12_7.3 [symbolic = %.loc12_7.3 (constants.%.2c6)] +// CHECK:STDOUT: %impl.elem0.loc12_7.3: @IntRange.as.Iterate.impl.Next.%.loc12_7.3 (%.2c6) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] +// CHECK:STDOUT: %specific_impl_fn.loc12_7.3: = specific_impl_function %impl.elem0.loc12_7.3, @Destroy.WithSelf.Op(%Destroy.facet.loc12_7.3) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.693)] +// CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.None.type (constants.%Optional.None.type.2aa)] // CHECK:STDOUT: %Optional.None: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.2aa) = struct_value () [symbolic = %Optional.None (constants.%Optional.None.fb7)] -// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%OptionalStorage.facet.loc11_75.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] +// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4), %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.41e)) -> out %return.param: @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.5ec) { +// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4), %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e)) -> out %return.param: @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %value.patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc12 (%pattern_type.142cb7.1) = ref_binding_pattern value [concrete] // CHECK:STDOUT: %value.var_patt: @IntRange.as.Iterate.impl.Next.%pattern_type.loc12 (%pattern_type.142cb7.1) = var_pattern %value.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %value.var: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = var %value.var_patt -// CHECK:STDOUT: %cursor.ref.loc12: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.41e) = name_ref cursor, %cursor -// CHECK:STDOUT: %.loc12_32.1: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = deref %cursor.ref.loc12 -// CHECK:STDOUT: %.loc12_32.2: @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = acquire_value %.loc12_32.1 -// CHECK:STDOUT: %impl.elem0.loc12_32.1: @IntRange.as.Iterate.impl.Next.%.loc12_32.4 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %value.var: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = var %value.var_patt +// CHECK:STDOUT: %cursor.ref.loc12: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e) = name_ref cursor, %cursor +// CHECK:STDOUT: %.loc12_32.1: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = deref %cursor.ref.loc12 +// CHECK:STDOUT: %.loc12_32.2: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %.loc12_32.1 +// CHECK:STDOUT: %impl.elem0.loc12_32.1: @IntRange.as.Iterate.impl.Next.%.loc12_32.5 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.284)] // CHECK:STDOUT: %bound_method.loc12_32.1: = bound_method %.loc12_32.2, %impl.elem0.loc12_32.1 +// CHECK:STDOUT: %Copy.facet.loc12_32.1: %Copy.type = facet_value constants.%Int.67af24.1, (constants.%Copy.lookup_impl_witness.df6) [symbolic = %Copy.facet.loc12_32.2 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %.loc12_32.3: %Copy.type = converted constants.%Int.67af24.1, %Copy.facet.loc12_32.1 [symbolic = %Copy.facet.loc12_32.2 (constants.%Copy.facet.f12)] // CHECK:STDOUT: %specific_impl_fn.loc12_32.1: = specific_impl_function %impl.elem0.loc12_32.1, @Copy.WithSelf.Op(constants.%Copy.facet.f12) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.f9f)] // CHECK:STDOUT: %bound_method.loc12_32.2: = bound_method %.loc12_32.2, %specific_impl_fn.loc12_32.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = call %bound_method.loc12_32.2(%.loc12_32.2) +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = call %bound_method.loc12_32.2(%.loc12_32.2) // CHECK:STDOUT: assign %value.var, %Copy.WithSelf.Op.call -// CHECK:STDOUT: %.loc12_28: type = splice_block %Int.loc12 [symbolic = %Int.loc11_43.1 (constants.%Int.67af24.1)] { +// CHECK:STDOUT: %.loc12_28: type = splice_block %Int.loc12 [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] { // CHECK:STDOUT: %Core.ref.loc12: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc12: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc12: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc12: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %Int.loc12: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %value: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = ref_binding value, %value.var -// CHECK:STDOUT: %value.ref.loc13: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = name_ref value, %value +// CHECK:STDOUT: %value: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = ref_binding value, %value.var +// CHECK:STDOUT: %value.ref.loc13: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = name_ref value, %value // CHECK:STDOUT: %self.ref: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4) = name_ref self, %self // CHECK:STDOUT: %end.ref: @IntRange.as.Iterate.impl.Next.%IntRange.elem (%IntRange.elem.bed) = name_ref end, @IntRange.%.loc23 [concrete = @IntRange.%.loc23] -// CHECK:STDOUT: %.loc13_23.1: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = class_element_access %self.ref, element1 -// CHECK:STDOUT: %.loc13_23.2: @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = acquire_value %.loc13_23.1 +// CHECK:STDOUT: %.loc13_23.1: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = class_element_access %self.ref, element1 +// CHECK:STDOUT: %.loc13_23.2: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %.loc13_23.1 // CHECK:STDOUT: %OrderedWith.type.loc13_17.1: type = facet_type <@OrderedWith, @OrderedWith(constants.%Int.67af24.1)> [symbolic = %OrderedWith.type.loc13_17.2 (constants.%OrderedWith.type.6f8)] // CHECK:STDOUT: %.loc13_17.1: @IntRange.as.Iterate.impl.Next.%OrderedWith.assoc_type (%OrderedWith.assoc_type.e6d) = specific_constant imports.%Core.import_ref.ef7, @OrderedWith.WithSelf(constants.%Int.67af24.1, constants.%Self.7df) [symbolic = %assoc0 (constants.%assoc0.ebc)] // CHECK:STDOUT: %Less.ref: @IntRange.as.Iterate.impl.Next.%OrderedWith.assoc_type (%OrderedWith.assoc_type.e6d) = name_ref Less, %.loc13_17.1 [symbolic = %assoc0 (constants.%assoc0.ebc)] @@ -645,17 +654,19 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: %bound_method.loc13_17.1: = bound_method %value.ref.loc13, %impl.elem0.loc13 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc13, @Int.as.OrderedWith.impl.Less.1(constants.%N, constants.%N) [symbolic = %Int.as.OrderedWith.impl.Less.specific_fn (constants.%Int.as.OrderedWith.impl.Less.specific_fn.6ce)] // CHECK:STDOUT: %bound_method.loc13_17.2: = bound_method %value.ref.loc13, %specific_fn -// CHECK:STDOUT: %.loc13_11: @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = acquire_value %value.ref.loc13 +// CHECK:STDOUT: %.loc13_11: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %value.ref.loc13 // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less.call: init bool = call %bound_method.loc13_17.2(%.loc13_11, %.loc13_23.2) // CHECK:STDOUT: %.loc13_27.1: bool = value_of_initializer %Int.as.OrderedWith.impl.Less.call // CHECK:STDOUT: %.loc13_27.2: bool = converted %Int.as.OrderedWith.impl.Less.call, %.loc13_27.1 // CHECK:STDOUT: if %.loc13_27.2 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %cursor.ref.loc14: @IntRange.as.Iterate.impl.Next.%ptr.loc11_44.1 (%ptr.41e) = name_ref cursor, %cursor -// CHECK:STDOUT: %.loc14_11: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = deref %cursor.ref.loc14 -// CHECK:STDOUT: %impl.elem0.loc14_9.1: @IntRange.as.Iterate.impl.Next.%.loc14_9.2 (%.952) = impl_witness_access constants.%Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_9.2 (constants.%impl.elem0.7b5)] +// CHECK:STDOUT: %cursor.ref.loc14: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e) = name_ref cursor, %cursor +// CHECK:STDOUT: %.loc14_11: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = deref %cursor.ref.loc14 +// CHECK:STDOUT: %impl.elem0.loc14_9.1: @IntRange.as.Iterate.impl.Next.%.loc14_9.3 (%.952) = impl_witness_access constants.%Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_9.2 (constants.%impl.elem0.7b5)] // CHECK:STDOUT: %bound_method.loc14_9.1: = bound_method %.loc14_11, %impl.elem0.loc14_9.1 +// CHECK:STDOUT: %Inc.facet.loc14_9.1: %Inc.type = facet_value constants.%Int.67af24.1, (constants.%Inc.lookup_impl_witness) [symbolic = %Inc.facet.loc14_9.2 (constants.%Inc.facet)] +// CHECK:STDOUT: %.loc14_9.1: %Inc.type = converted constants.%Int.67af24.1, %Inc.facet.loc14_9.1 [symbolic = %Inc.facet.loc14_9.2 (constants.%Inc.facet)] // CHECK:STDOUT: %specific_impl_fn.loc14_9.1: = specific_impl_function %impl.elem0.loc14_9.1, @Inc.WithSelf.Op(constants.%Inc.facet) [symbolic = %specific_impl_fn.loc14_9.2 (constants.%specific_impl_fn.ed1)] // CHECK:STDOUT: %bound_method.loc14_9.2: = bound_method %.loc14_11, %specific_impl_fn.loc14_9.1 // CHECK:STDOUT: %Inc.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc14_9.2(%.loc14_11) @@ -664,21 +675,23 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: %Core.ref.loc15_30: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc15: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc15: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc15: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %OptionalStorage.facet.loc15_41: %OptionalStorage.type = facet_value %Int.loc15, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc15_41: %OptionalStorage.type = converted %Int.loc15, %OptionalStorage.facet.loc15_41 [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %Optional.loc15: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_75.1 (constants.%Optional.5ec)] +// CHECK:STDOUT: %Int.loc15: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %OptionalStorage.facet.loc15_41: %OptionalStorage.type = facet_value %Int.loc15, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc15_41: %OptionalStorage.type = converted %Int.loc15, %OptionalStorage.facet.loc15_41 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %Optional.loc15: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_69.1 (constants.%Optional.5ec)] // CHECK:STDOUT: %.loc15_42: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.422) = specific_constant imports.%Core.import_ref.84b, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.Some (constants.%Optional.Some.bcf)] // CHECK:STDOUT: %Some.ref: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.422) = name_ref Some, %.loc15_42 [symbolic = %Optional.Some (constants.%Optional.Some.bcf)] -// CHECK:STDOUT: %value.ref.loc15: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = name_ref value, %value -// CHECK:STDOUT: %OptionalStorage.facet.loc15_53: %OptionalStorage.type = facet_value constants.%Int.67af24.1, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc15_53: %OptionalStorage.type = converted constants.%Int.67af24.1, %OptionalStorage.facet.loc15_53 [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %value.ref.loc15: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = name_ref value, %value +// CHECK:STDOUT: %OptionalStorage.facet.loc15_53: %OptionalStorage.type = facet_value constants.%Int.67af24.1, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc15_53: %OptionalStorage.type = converted constants.%Int.67af24.1, %OptionalStorage.facet.loc15_53 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] // CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.1: = specific_function %Some.ref, @Optional.Some(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] -// CHECK:STDOUT: %.loc11_75.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.5ec) = splice_block %return.param {} -// CHECK:STDOUT: %.loc15_48: @IntRange.as.Iterate.impl.Next.%Int.loc11_43.1 (%Int.67af24.1) = acquire_value %value.ref.loc15 -// CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.5ec) to %.loc11_75.1 = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) -// CHECK:STDOUT: %impl.elem0.loc12_7.1: @IntRange.as.Iterate.impl.Next.%.loc12_7 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] +// CHECK:STDOUT: %.loc11_69.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = splice_block %return.param {} +// CHECK:STDOUT: %.loc15_48: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %value.ref.loc15 +// CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) to %.loc11_69.1 = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) +// CHECK:STDOUT: %impl.elem0.loc12_7.1: @IntRange.as.Iterate.impl.Next.%.loc12_7.3 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] // CHECK:STDOUT: %bound_method.loc12_7.1: = bound_method %value.var, %impl.elem0.loc12_7.1 +// CHECK:STDOUT: %Destroy.facet.loc12_7.1: %Destroy.type = facet_value constants.%Int.67af24.1, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc12_7.3 (constants.%Destroy.facet.7bb)] +// CHECK:STDOUT: %.loc12_7.1: %Destroy.type = converted constants.%Int.67af24.1, %Destroy.facet.loc12_7.1 [symbolic = %Destroy.facet.loc12_7.3 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %specific_impl_fn.loc12_7.1: = specific_impl_function %impl.elem0.loc12_7.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.693)] // CHECK:STDOUT: %bound_method.loc12_7.2: = bound_method %value.var, %specific_impl_fn.loc12_7.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12_7.1: init %empty_tuple.type = call %bound_method.loc12_7.2(%value.var) @@ -690,17 +703,19 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: %Core.ref.loc17_30: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc17: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc17: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc17: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_43.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %OptionalStorage.facet.loc17: %OptionalStorage.type = facet_value %Int.loc17, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc17_41: %OptionalStorage.type = converted %Int.loc17, %OptionalStorage.facet.loc17 [symbolic = %OptionalStorage.facet.loc11_75.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %Optional.loc17: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_75.1 (constants.%Optional.5ec)] +// CHECK:STDOUT: %Int.loc17: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %OptionalStorage.facet.loc17: %OptionalStorage.type = facet_value %Int.loc17, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc17_41: %OptionalStorage.type = converted %Int.loc17, %OptionalStorage.facet.loc17 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %Optional.loc17: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_69.1 (constants.%Optional.5ec)] // CHECK:STDOUT: %.loc17_42: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.2aa) = specific_constant imports.%Core.import_ref.6e4, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.None (constants.%Optional.None.fb7)] // CHECK:STDOUT: %None.ref: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.2aa) = name_ref None, %.loc17_42 [symbolic = %Optional.None (constants.%Optional.None.fb7)] // CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.1: = specific_function %None.ref, @Optional.None(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] -// CHECK:STDOUT: %.loc11_75.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.5ec) = splice_block %return.param {} -// CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_75.1 (%Optional.5ec) to %.loc11_75.2 = call %Optional.None.specific_fn.loc17_42.1() -// CHECK:STDOUT: %impl.elem0.loc12_7.2: @IntRange.as.Iterate.impl.Next.%.loc12_7 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] +// CHECK:STDOUT: %.loc11_69.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = splice_block %return.param {} +// CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) to %.loc11_69.2 = call %Optional.None.specific_fn.loc17_42.1() +// CHECK:STDOUT: %impl.elem0.loc12_7.2: @IntRange.as.Iterate.impl.Next.%.loc12_7.3 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] // CHECK:STDOUT: %bound_method.loc12_7.3: = bound_method %value.var, %impl.elem0.loc12_7.2 +// CHECK:STDOUT: %Destroy.facet.loc12_7.2: %Destroy.type = facet_value constants.%Int.67af24.1, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc12_7.3 (constants.%Destroy.facet.7bb)] +// CHECK:STDOUT: %.loc12_7.2: %Destroy.type = converted constants.%Int.67af24.1, %Destroy.facet.loc12_7.2 [symbolic = %Destroy.facet.loc12_7.3 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %specific_impl_fn.loc12_7.2: = specific_impl_function %impl.elem0.loc12_7.2, @Destroy.WithSelf.Op(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.693)] // CHECK:STDOUT: %bound_method.loc12_7.4: = bound_method %value.var, %specific_impl_fn.loc12_7.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12_7.2: init %empty_tuple.type = call %bound_method.loc12_7.4(%value.var) @@ -776,28 +791,28 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: specific @IntRange.as.Iterate.impl.NewCursor(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %IntRange => constants.%IntRange.2c4 -// CHECK:STDOUT: %pattern_type.loc10_22 => constants.%pattern_type.1ea -// CHECK:STDOUT: %Int.loc10_45.1 => constants.%Int.67af24.1 -// CHECK:STDOUT: %.loc10_45.1 => constants.%.df5d8d.1 -// CHECK:STDOUT: %pattern_type.loc10_45 => constants.%pattern_type.142cb7.1 +// CHECK:STDOUT: %pattern_type.loc10_18 => constants.%pattern_type.1ea +// CHECK:STDOUT: %Int.loc10_37.1 => constants.%Int.67af24.1 +// CHECK:STDOUT: %.loc10_37.1 => constants.%.df5d8d.1 +// CHECK:STDOUT: %pattern_type.loc10_37 => constants.%pattern_type.142cb7.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @IntRange.as.Iterate.impl.Next(constants.%N) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %IntRange => constants.%IntRange.2c4 -// CHECK:STDOUT: %pattern_type.loc11_17 => constants.%pattern_type.1ea -// CHECK:STDOUT: %Int.loc11_43.1 => constants.%Int.67af24.1 -// CHECK:STDOUT: %ptr.loc11_44.1 => constants.%ptr.41e -// CHECK:STDOUT: %pattern_type.loc11_31 => constants.%pattern_type.833 +// CHECK:STDOUT: %pattern_type.loc11_13 => constants.%pattern_type.1ea +// CHECK:STDOUT: %Int.loc11_37.1 => constants.%Int.67af24.1 +// CHECK:STDOUT: %ptr.loc11_38.1 => constants.%ptr.41e +// CHECK:STDOUT: %pattern_type.loc11_25 => constants.%pattern_type.833 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%Destroy.lookup_impl_witness.173 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.df6 // CHECK:STDOUT: %facet_value => constants.%facet_value -// CHECK:STDOUT: %.loc11_75.3 => constants.%.17c +// CHECK:STDOUT: %.loc11_69.3 => constants.%.17c // CHECK:STDOUT: %OptionalStorage.lookup_impl_witness => constants.%OptionalStorage.lookup_impl_witness.a32 -// CHECK:STDOUT: %OptionalStorage.facet.loc11_75.1 => constants.%OptionalStorage.facet.b99 -// CHECK:STDOUT: %Optional.loc11_75.1 => constants.%Optional.5ec -// CHECK:STDOUT: %.loc11_75.4 => constants.%.3f3 -// CHECK:STDOUT: %pattern_type.loc11_75 => constants.%pattern_type.b38 +// CHECK:STDOUT: %OptionalStorage.facet.loc11_69.1 => constants.%OptionalStorage.facet.b99 +// CHECK:STDOUT: %Optional.loc11_69.1 => constants.%Optional.5ec +// CHECK:STDOUT: %.loc11_69.4 => constants.%.3f3 +// CHECK:STDOUT: %pattern_type.loc11_69 => constants.%pattern_type.b38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @IntRange(constants.%int_32) { @@ -826,11 +841,11 @@ fn Read(y:! Core.IntLiteral) { // CHECK:STDOUT: %require_complete.loc5_16 => constants.%complete_type.f8a // CHECK:STDOUT: %require_complete.loc5_49 => constants.%complete_type.ec7 // CHECK:STDOUT: %struct_type.start.end => constants.%struct_type.start.end.e93 -// CHECK:STDOUT: %.loc6_22.1 => constants.%.cf6 +// CHECK:STDOUT: %.loc6_22.2 => constants.%.cf6 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.0e0 -// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.987 +// CHECK:STDOUT: %Copy.facet.loc6_22.2 => constants.%Copy.facet.987 // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.d09 -// CHECK:STDOUT: %.loc6_22.2 => constants.%.7a6 +// CHECK:STDOUT: %.loc6_22.3 => constants.%.7a6 // CHECK:STDOUT: %impl.elem0.loc6_22.2 => constants.%Int.as.Copy.impl.Op.4f6 // CHECK:STDOUT: %specific_impl_fn.loc6_22.2 => constants.%Int.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 5c560d25eb85..3dd5225fc6f6 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -34,8 +34,8 @@ library "[[@TEST_NAME]]"; class TrivialRange { impl as Core.Iterate where .CursorType = () and .ElementType = () { - fn NewCursor[unused self: Self]() {} - fn Next[unused self: Self](unused cursor: ()*) -> Core.Optional(()) { + fn NewCursor(unused self) {} + fn Next(unused self, unused cursor: ()*) -> Core.Optional(()) { return Core.Optional(()).None(); } } @@ -53,6 +53,7 @@ fn Run() { //@dump-sem-ir-end } + // CHECK:STDOUT: --- trivial.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -69,7 +70,7 @@ fn Run() { // CHECK:STDOUT: %Copy.impl_witness.77e: = impl_witness imports.%Copy.impl_witness_table.938 [concrete] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %empty_tuple.type, (%Copy.impl_witness.77e) [concrete] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @TrivialRange.as.Iterate.impl.%Iterate.impl_witness_table [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_39.1 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_31.1 [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.93de00.1: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1 = struct_value () [concrete] // CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] // CHECK:STDOUT: %Optional.21a: type = class_type @Optional, @Optional(%Copy.facet) [concrete] @@ -79,7 +80,7 @@ fn Run() { // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.b66: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [concrete] // CHECK:STDOUT: %Iterate.WithSelf.Next.type.4f6: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_39.2 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_31.2 [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.93de00.2: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.2 = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %Optional.HasValue.type.650: type = fn_type @Optional.HasValue, @Optional(%Copy.facet) [concrete] @@ -133,7 +134,7 @@ fn Run() { // CHECK:STDOUT: %impl.elem2: %.46f = impl_witness_access constants.%Iterate.impl_witness, element2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.93de00.2] // CHECK:STDOUT: %bound_method.loc18_35.1: = bound_method %.loc18_20.2, %impl.elem2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.bound.464] // CHECK:STDOUT: %.loc18_20.3: %TrivialRange = acquire_value %.loc18_20.2 [concrete = constants.%TrivialRange.val] -// CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_39.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.93de00.1] +// CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_31.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.93de00.1] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.loc18_20.3, %NewCursor.ref [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.bound.410] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.call: init %empty_tuple.type = call %TrivialRange.as.Iterate.impl.NewCursor.bound(%.loc18_20.3) // CHECK:STDOUT: %var: ref %empty_tuple.type = var invalid diff --git a/toolchain/check/testdata/for/pattern.carbon b/toolchain/check/testdata/for/pattern.carbon index b4953c717722..f5b530ce5252 100644 --- a/toolchain/check/testdata/for/pattern.carbon +++ b/toolchain/check/testdata/for/pattern.carbon @@ -18,10 +18,10 @@ class EmptyRange(T:! Core.Copy) { fn Make() -> Self { return {}; } impl as Core.Iterate where .CursorType = {} and .ElementType = T { - fn NewCursor[unused self: Self]() -> {} { + fn NewCursor(unused self) -> {} { return {}; } - fn Next[unused self: Self](unused cursor: {}*) -> Core.Optional(T) { + fn Next(unused self, unused cursor: {}*) -> Core.Optional(T) { return Core.Optional(T).None(); } } @@ -29,7 +29,7 @@ class EmptyRange(T:! Core.Copy) { class C { impl as Core.Copy { - fn Op[unused self: Self]() -> Self { return {}; } + fn Op(unused self) -> Self { return {}; } } } @@ -117,6 +117,7 @@ fn Run() { } } + // CHECK:STDOUT: --- value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -184,14 +185,14 @@ fn Run() { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.import_ref.a9e: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.140) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.0de)] -// CHECK:STDOUT: %Main.import_ref.341: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_40, loaded [concrete = constants.%C.as.Copy.impl.Op] +// CHECK:STDOUT: %Main.import_ref.341: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_32, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.506 = impl_witness_table (%Main.import_ref.341), @C.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.1db: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.224) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.c4f)] // CHECK:STDOUT: %Core.import_ref.73b: @Optional.%Optional.Get.type (%Optional.Get.type.e1b) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.20c)] // CHECK:STDOUT: %Main.import_ref.71a = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.19c: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.647) = import_ref Main//empty_range, loc8_45, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.9e2)] -// CHECK:STDOUT: %Main.import_ref.ee4: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.cfe) = import_ref Main//empty_range, loc11_72, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.0c8)] +// CHECK:STDOUT: %Main.import_ref.19c: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.647) = import_ref Main//empty_range, loc8_37, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.9e2)] +// CHECK:STDOUT: %Main.import_ref.ee4: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.cfe) = import_ref Main//empty_range, loc11_66, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.0c8)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.19c, %Main.import_ref.ee4), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -364,14 +365,14 @@ fn Run() { // CHECK:STDOUT: %Main.EmptyRange: %EmptyRange.type = import_ref Main//empty_range, EmptyRange, loaded [concrete = constants.%EmptyRange.generic] // CHECK:STDOUT: %Main.C: type = import_ref Main//empty_range, C, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.import_ref.a9e: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.140) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.0de)] -// CHECK:STDOUT: %Main.import_ref.341: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_40, loaded [concrete = constants.%C.as.Copy.impl.Op] +// CHECK:STDOUT: %Main.import_ref.341: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_32, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.506 = impl_witness_table (%Main.import_ref.341), @C.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.1db: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.224) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.c4f)] // CHECK:STDOUT: %Core.import_ref.73b: @Optional.%Optional.Get.type (%Optional.Get.type.e1b) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.20c)] // CHECK:STDOUT: %Main.import_ref.71a = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.19c: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.647) = import_ref Main//empty_range, loc8_45, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.9e2)] -// CHECK:STDOUT: %Main.import_ref.ee4: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.cfe) = import_ref Main//empty_range, loc11_72, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.0c8)] +// CHECK:STDOUT: %Main.import_ref.19c: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.647) = import_ref Main//empty_range, loc8_37, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.9e2)] +// CHECK:STDOUT: %Main.import_ref.ee4: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.cfe) = import_ref Main//empty_range, loc11_66, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.0c8)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.19c, %Main.import_ref.ee4), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -560,8 +561,8 @@ fn Run() { // CHECK:STDOUT: %Core.import_ref.73b: @Optional.%Optional.Get.type (%Optional.Get.type.e1b) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.20c)] // CHECK:STDOUT: %Main.import_ref.71a = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.19c: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.647) = import_ref Main//empty_range, loc8_45, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.9e2)] -// CHECK:STDOUT: %Main.import_ref.ee4: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.cfe) = import_ref Main//empty_range, loc11_72, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.0c8)] +// CHECK:STDOUT: %Main.import_ref.19c: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.647) = import_ref Main//empty_range, loc8_37, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.9e2)] +// CHECK:STDOUT: %Main.import_ref.ee4: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.cfe) = import_ref Main//empty_range, loc11_66, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.0c8)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.19c, %Main.import_ref.ee4), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -754,14 +755,14 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.a9e: @EmptyRange.%EmptyRange.Make.type (%EmptyRange.Make.type.140) = import_ref Main//empty_range, loc5_21, loaded [symbolic = @EmptyRange.%EmptyRange.Make (constants.%EmptyRange.Make.0de)] // CHECK:STDOUT: %Core.import_ref.44a: @tuple.type.as.Copy.impl.9bd.%tuple.type.as.Copy.impl.Op.type (%tuple.type.as.Copy.impl.Op.type.3ed) = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [symbolic = @tuple.type.as.Copy.impl.9bd.%tuple.type.as.Copy.impl.Op (constants.%tuple.type.as.Copy.impl.Op.0f8)] // CHECK:STDOUT: %Copy.impl_witness_table.828 = impl_witness_table (%Core.import_ref.44a), @tuple.type.as.Copy.impl.9bd [concrete] -// CHECK:STDOUT: %Main.import_ref.341: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_40, loaded [concrete = constants.%C.as.Copy.impl.Op] +// CHECK:STDOUT: %Main.import_ref.341: %C.as.Copy.impl.Op.type = import_ref Main//empty_range, loc19_32, loaded [concrete = constants.%C.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.506 = impl_witness_table (%Main.import_ref.341), @C.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.import_ref.1db: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.224) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.c4f)] // CHECK:STDOUT: %Core.import_ref.73b: @Optional.%Optional.Get.type (%Optional.Get.type.e1b) = import_ref Core//prelude/parts/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.20c)] // CHECK:STDOUT: %Main.import_ref.71a = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded -// CHECK:STDOUT: %Main.import_ref.19c: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.647) = import_ref Main//empty_range, loc8_45, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.9e2)] -// CHECK:STDOUT: %Main.import_ref.ee4: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.cfe) = import_ref Main//empty_range, loc11_72, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.0c8)] +// CHECK:STDOUT: %Main.import_ref.19c: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.647) = import_ref Main//empty_range, loc8_37, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.9e2)] +// CHECK:STDOUT: %Main.import_ref.ee4: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.cfe) = import_ref Main//empty_range, loc11_66, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.0c8)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.19c, %Main.import_ref.ee4), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/call_from_operator.carbon index 7d69f3fe0e89..e2421cb977ae 100644 --- a/toolchain/check/testdata/function/builtin/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/call_from_operator.carbon @@ -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 = // CHECK:STDOUT: .T = -// 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 = // CHECK:STDOUT: .T = -// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc17_32.1 +// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc17_24.1 // CHECK:STDOUT: .IntLiteral = // 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 diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 19235fb07ef9..c0a5ee772ae0 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -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: diff --git a/toolchain/check/testdata/function/call/fail_explicit_self_param.carbon b/toolchain/check/testdata/function/call/fail_explicit_self_param.carbon deleted file mode 100644 index a2e11add6a0d..000000000000 --- a/toolchain/check/testdata/function/call/fail_explicit_self_param.carbon +++ /dev/null @@ -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 [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: diff --git a/toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon b/toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon index 068052ff1817..a9662d8d62bd 100644 --- a/toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon +++ b/toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon @@ -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: diff --git a/toolchain/check/testdata/function/call/ref.carbon b/toolchain/check/testdata/function/call/ref.carbon index ff3ee3534759..daad33cc5d1c 100644 --- a/toolchain/check/testdata/function/call/ref.carbon +++ b/toolchain/check/testdata/function/call/ref.carbon @@ -31,7 +31,7 @@ library "[[@TEST_NAME]]"; //@dump-sem-ir-begin class C { - fn F[ref self: Self](); + fn F(ref self); } fn G() { diff --git a/toolchain/check/testdata/function/declaration/extern.carbon b/toolchain/check/testdata/function/declaration/extern.carbon index 3bc89ae0b02e..3e588f5a2bc0 100644 --- a/toolchain/check/testdata/function/declaration/extern.carbon +++ b/toolchain/check/testdata/function/declaration/extern.carbon @@ -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 diff --git a/toolchain/check/testdata/function/definition/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/syntactic_merge.carbon index 60311e50f064..a526a7e92150 100644 --- a/toolchain/check/testdata/function/definition/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/syntactic_merge.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: diff --git a/toolchain/check/testdata/function/generic/call.carbon b/toolchain/check/testdata/function/generic/call.carbon index eec71cb21287..a4144a301767 100644 --- a/toolchain/check/testdata/function/generic/call.carbon +++ b/toolchain/check/testdata/function/generic/call.carbon @@ -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: = 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: = 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_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 %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_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 %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: = 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: = 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_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 %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_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 %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 diff --git a/toolchain/check/testdata/function/generic/indirect_generic_type.carbon b/toolchain/check/testdata/function/generic/indirect_generic_type.carbon index ffbf7ddcd4da..ee3a88d949d4 100644 --- a/toolchain/check/testdata/function/generic/indirect_generic_type.carbon +++ b/toolchain/check/testdata/function/generic/indirect_generic_type.carbon @@ -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: -// 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: = 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_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_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 %.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_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 %.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) diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 2c4149c6f8d8..b49465b4eb59 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -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_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: = 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_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_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 %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_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 %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: } diff --git a/toolchain/check/testdata/function/generic/type_param.carbon b/toolchain/check/testdata/function/generic/type_param.carbon index 7246685da253..431f1e5e52d9 100644 --- a/toolchain/check/testdata/function/generic/type_param.carbon +++ b/toolchain/check/testdata/function/generic/type_param.carbon @@ -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: = 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: = 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_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_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 %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_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 %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) diff --git a/toolchain/check/testdata/function/generic/type_param_scope.carbon b/toolchain/check/testdata/function/generic/type_param_scope.carbon index 8d478b4f0225..f34271eb8c7f 100644 --- a/toolchain/check/testdata/function/generic/type_param_scope.carbon +++ b/toolchain/check/testdata/function/generic/type_param_scope.carbon @@ -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: -// 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: = 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_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_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 %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_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 %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) diff --git a/toolchain/check/testdata/generic/call_basic_depth.carbon b/toolchain/check/testdata/generic/call_basic_depth.carbon index 7aee1fe1707d..facb84070cc5 100644 --- a/toolchain/check/testdata/generic/call_basic_depth.carbon +++ b/toolchain/check/testdata/generic/call_basic_depth.carbon @@ -11,7 +11,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/generic/call_basic_depth.carbon class C { - fn Cfn[unused self: Self, T:! type](unused x: T) { + fn Cfn[T:! type](unused self, unused x: T) { } } @@ -45,15 +45,16 @@ fn M() { //@dump-sem-ir-end } + // CHECK:STDOUT: --- call_basic_depth.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic] // CHECK:STDOUT: %C.Cfn.type: type = fn_type @C.Cfn [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] diff --git a/toolchain/check/testdata/generic/dependent_param.carbon b/toolchain/check/testdata/generic/dependent_param.carbon index 75ca7783ac03..76f8677b9f5d 100644 --- a/toolchain/check/testdata/generic/dependent_param.carbon +++ b/toolchain/check/testdata/generic/dependent_param.carbon @@ -26,6 +26,7 @@ class Outer(T:! Core.Copy) { var n: i32 = Outer(i32).Inner(42).Get(); //@dump-sem-ir-end + // CHECK:STDOUT: --- nested_class.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -171,9 +172,9 @@ var n: i32 = Outer(i32).Inner(42).Get(); // CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc7_17.1 [symbolic = %require_complete (constants.%require_complete.d83)] // CHECK:STDOUT: %U: @Inner.Get.%T.as_type.loc7_17.1 (%T.as_type) = symbolic_binding U, 1 [symbolic = %U (constants.%U.7e5)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%T) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.2)] -// CHECK:STDOUT: %.loc7_28: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc7_28 (constants.%.c29)] +// CHECK:STDOUT: %.loc7_28.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %T [symbolic = %.loc7_28.2 (constants.%.c29)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %T, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c)] -// CHECK:STDOUT: %impl.elem0.loc7_28.2: @Inner.Get.%.loc7_28 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_28.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc7_28.2: @Inner.Get.%.loc7_28.2 (%.c29) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_28.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc7_28.3: = bound_method %U, %impl.elem0.loc7_28.2 [symbolic = %bound_method.loc7_28.3 (constants.%bound_method.023)] // CHECK:STDOUT: %specific_impl_fn.loc7_28.2: = specific_impl_function %impl.elem0.loc7_28.2, @Copy.WithSelf.Op(%T) [symbolic = %specific_impl_fn.loc7_28.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc7_28.4: = bound_method %U, %specific_impl_fn.loc7_28.2 [symbolic = %bound_method.loc7_28.4 (constants.%bound_method.0b2)] @@ -181,8 +182,9 @@ var n: i32 = Outer(i32).Inner(42).Get(); // CHECK:STDOUT: fn() -> out %return.param: @Inner.Get.%T.as_type.loc7_17.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %U.ref: @Inner.Get.%T.as_type.loc7_17.1 (%T.as_type) = name_ref U, @Inner.%U.loc5_16.2 [symbolic = %U (constants.%U.7e5)] -// CHECK:STDOUT: %impl.elem0.loc7_28.1: @Inner.Get.%.loc7_28 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc7_28.2 (constants.%impl.elem0.bd2)] +// CHECK:STDOUT: %impl.elem0.loc7_28.1: @Inner.Get.%.loc7_28.2 (%.c29) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c, element0 [symbolic = %impl.elem0.loc7_28.2 (constants.%impl.elem0.bd2)] // CHECK:STDOUT: %bound_method.loc7_28.1: = bound_method %U.ref, %impl.elem0.loc7_28.1 [symbolic = %bound_method.loc7_28.3 (constants.%bound_method.023)] +// CHECK:STDOUT: %.loc7_28.1: %Copy.type = converted constants.%T.as_type, constants.%T.f84 [symbolic = %T (constants.%T.f84)] // CHECK:STDOUT: %specific_impl_fn.loc7_28.1: = specific_impl_function %impl.elem0.loc7_28.1, @Copy.WithSelf.Op(constants.%T.f84) [symbolic = %specific_impl_fn.loc7_28.2 (constants.%specific_impl_fn.e2a)] // CHECK:STDOUT: %bound_method.loc7_28.2: = bound_method %U.ref, %specific_impl_fn.loc7_28.1 [symbolic = %bound_method.loc7_28.4 (constants.%bound_method.0b2)] // CHECK:STDOUT: %.loc7_17.1: ref @Inner.Get.%T.as_type.loc7_17.1 (%T.as_type) = splice_block %return.param {} @@ -274,7 +276,7 @@ var n: i32 = Outer(i32).Inner(42).Get(); // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a // CHECK:STDOUT: %U => constants.%int_42.ac4 // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.d09 -// CHECK:STDOUT: %.loc7_28 => constants.%.7a6 +// CHECK:STDOUT: %.loc7_28.2 => constants.%.7a6 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.0e0 // CHECK:STDOUT: %impl.elem0.loc7_28.2 => constants.%Int.as.Copy.impl.Op.4f6 // CHECK:STDOUT: %bound_method.loc7_28.3 => constants.%Int.as.Copy.impl.Op.bound diff --git a/toolchain/check/testdata/generic/template/convert.carbon b/toolchain/check/testdata/generic/template/convert.carbon index 01588d3e193e..ca8057118cab 100644 --- a/toolchain/check/testdata/generic/template/convert.carbon +++ b/toolchain/check/testdata/generic/template/convert.carbon @@ -28,7 +28,7 @@ fn Test1(n: i32) -> i32 { class C { var n: i32; impl as Core.ImplicitAs(i32) { - fn Convert[self: Self]() -> i32 { return self.n; } + fn Convert(self) -> i32 { return self.n; } } } @@ -61,6 +61,7 @@ fn Test(d: D) -> i32 { return F(d); } + // CHECK:STDOUT: --- convert.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -214,7 +215,7 @@ fn Test(d: D) -> i32 { // CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc16_33: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %.loc16_25: Core.Form = init_form %i32 [concrete = constants.%.795] // CHECK:STDOUT: %self.param: %C = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param @@ -289,13 +290,13 @@ fn Test(d: D) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %C = name_ref self, %self // CHECK:STDOUT: %n.ref: %C.elem = name_ref n, @C.%.loc14 [concrete = @C.%.loc14] -// CHECK:STDOUT: %.loc16_50.1: ref %i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc16_50.2: %i32 = acquire_value %.loc16_50.1 +// CHECK:STDOUT: %.loc16_42.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc16_42.2: %i32 = acquire_value %.loc16_42.1 // CHECK:STDOUT: %impl.elem0: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] -// CHECK:STDOUT: %bound_method.loc16_50.1: = bound_method %.loc16_50.2, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc16_42.1: = bound_method %.loc16_42.2, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_50.2: = bound_method %.loc16_50.2, %specific_fn -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc16_50.2(%.loc16_50.2) +// CHECK:STDOUT: %bound_method.loc16_42.2: = bound_method %.loc16_42.2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc16_42.2(%.loc16_42.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/template/unimplemented.carbon b/toolchain/check/testdata/generic/template/unimplemented.carbon index 89df99087afb..aeb6d5df3378 100644 --- a/toolchain/check/testdata/generic/template/unimplemented.carbon +++ b/toolchain/check/testdata/generic/template/unimplemented.carbon @@ -70,6 +70,7 @@ fn F[template T:! Core.Destroy](x: T) { var unused w: i32 = x; } + // CHECK:STDOUT: --- fail_todo_unimplemented_operator.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -327,12 +328,12 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc4_36.1 [template = %require_complete (constants.%require_complete.14c)] // CHECK:STDOUT: %ImplicitAs.type.loc14_3.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T.as_type.loc4_36.1)> [template = %ImplicitAs.type.loc14_3.2 (constants.%ImplicitAs.type.f42)] -// CHECK:STDOUT: %.loc14_3.3: = access_member_action %ImplicitAs.type.loc14_3.1, Convert [template] -// CHECK:STDOUT: %.loc14_3.4: type = type_of_inst %.loc14_3.3 [template] +// CHECK:STDOUT: %.loc14_3.4: = access_member_action %ImplicitAs.type.loc14_3.1, Convert [template] +// CHECK:STDOUT: %.loc14_3.5: type = type_of_inst %.loc14_3.4 [template] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%T.loc4_16.1) [template = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc14_3.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %T.loc4_16.1 [template = %.loc14_3.5 (constants.%.53a)] +// CHECK:STDOUT: %.loc14_3.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %T.loc4_16.1 [template = %.loc14_3.6 (constants.%.53a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %T.loc4_16.1, @Destroy [template = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc14_3.2: @F.%.loc14_3.5 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc14_3.2: @F.%.loc14_3.6 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %specific_impl_fn.loc14_3.2: = specific_impl_function %impl.elem0.loc14_3.2, @Destroy.WithSelf.Op(%T.loc4_16.1) [template = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%T.as_type.loc4_36.1 (%T.as_type.700)) { @@ -344,7 +345,7 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %v.var: ref @F.%T.as_type.loc4_36.1 (%T.as_type.700) = var %v.var_patt // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %ImplicitAs.type.loc14_3.1: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%T.as_type.700)> [template = %ImplicitAs.type.loc14_3.2 (constants.%ImplicitAs.type.f42)] -// CHECK:STDOUT: %.loc14_3.1: @F.%.loc14_3.4 (@F.%.loc14_3.4) = splice_inst %.loc14_3.3 +// CHECK:STDOUT: %.loc14_3.1: @F.%.loc14_3.5 (@F.%.loc14_3.5) = splice_inst %.loc14_3.4 // CHECK:STDOUT: %.loc14_3.2: @F.%T.as_type.loc4_36.1 (%T.as_type.700) = converted %int_0, [concrete = ] // CHECK:STDOUT: assign %v.var, // CHECK:STDOUT: %.loc14_17.1: type = splice_block %.loc14_17.2 [template = %T.as_type.loc4_36.1 (constants.%T.as_type.700)] { @@ -365,8 +366,9 @@ fn F[template T:! Core.Destroy](x: T) { // CHECK:STDOUT: %w: ref %i32 = ref_binding w, %w.var // CHECK:STDOUT: %Destroy.Op.bound: = bound_method %w.var, constants.%Destroy.Op.1a2547.2 // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%w.var) -// CHECK:STDOUT: %impl.elem0.loc14_3.1: @F.%.loc14_3.5 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc14_3.1: @F.%.loc14_3.6 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [template = %impl.elem0.loc14_3.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %v.var, %impl.elem0.loc14_3.1 +// CHECK:STDOUT: %.loc14_3.3: %Destroy.type = converted constants.%T.as_type.700, constants.%T.0e7 [template = %T.loc4_16.1 (constants.%T.0e7)] // CHECK:STDOUT: %specific_impl_fn.loc14_3.1: = specific_impl_function %impl.elem0.loc14_3.1, @Destroy.WithSelf.Op(constants.%T.0e7) [template = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: %bound_method.loc14_3.2: = bound_method %v.var, %specific_impl_fn.loc14_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc14_3.2(%v.var) diff --git a/toolchain/check/testdata/generic/template_dependence.carbon b/toolchain/check/testdata/generic/template_dependence.carbon index 71cf07ff69b3..f6c0ece53d78 100644 --- a/toolchain/check/testdata/generic/template_dependence.carbon +++ b/toolchain/check/testdata/generic/template_dependence.carbon @@ -30,6 +30,7 @@ fn F(template T:! type, U:! type) -> (T, U) { } //@dump-sem-ir-end + // CHECK:STDOUT: --- type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -95,21 +96,23 @@ fn F(template T:! type, U:! type) -> (T, U) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc5_26: = require_complete_type %ptr.loc5_30.1 [template = %require_complete.loc5_26 (constants.%require_complete.fbe)] // CHECK:STDOUT: %require_complete.loc5_33: = require_complete_type %ptr.loc5_29.1 [template = %require_complete.loc5_33 (constants.%require_complete.ef162c.1)] -// CHECK:STDOUT: %.loc6_10.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_16.1) [template = %.loc6_10.3 (constants.%.0e9)] +// CHECK:STDOUT: %.loc6_10.4: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_16.1) [template = %.loc6_10.4 (constants.%.0e9)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc5_29.1, @Copy [template = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc5_29.1, (%Copy.lookup_impl_witness) [template = %Copy.facet (constants.%Copy.facet)] -// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [template = %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 [template = %.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 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)] -// CHECK:STDOUT: %specific_impl_fn.loc6_10.2: = specific_impl_function %impl.elem0.loc6_10.2, @Copy.WithSelf.Op(%Copy.facet) [template = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.a76)] +// CHECK:STDOUT: %Copy.facet.loc6_10.2: %Copy.type = facet_value %ptr.loc5_29.1, (%Copy.lookup_impl_witness) [template = %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) [template = %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 [template = %.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 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %specific_impl_fn.loc6_10.2: = specific_impl_function %impl.elem0.loc6_10.2, @Copy.WithSelf.Op(%Copy.facet.loc6_10.2) [template = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%ptr.loc5_30.1 (%ptr.125)) -> out %return.param: @F.%ptr.loc5_29.1 (%ptr.e8f8f9.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @F.%ptr.loc5_30.1 (%ptr.125) = name_ref x, %x // CHECK:STDOUT: %.loc6_10.1: ref @F.%ptr.loc5_29.1 (%ptr.e8f8f9.1) = deref %x.ref // CHECK:STDOUT: %.loc6_10.2: @F.%ptr.loc5_29.1 (%ptr.e8f8f9.1) = 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 [template = %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 [template = %impl.elem0.loc6_10.2 (constants.%impl.elem0.484)] // CHECK:STDOUT: %bound_method.loc6_10.1: = bound_method %.loc6_10.2, %impl.elem0.loc6_10.1 +// CHECK:STDOUT: %Copy.facet.loc6_10.1: %Copy.type = facet_value constants.%ptr.e8f8f9.1, (constants.%Copy.lookup_impl_witness.1da) [template = %Copy.facet.loc6_10.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %.loc6_10.3: %Copy.type = converted constants.%ptr.e8f8f9.1, %Copy.facet.loc6_10.1 [template = %Copy.facet.loc6_10.2 (constants.%Copy.facet)] // CHECK:STDOUT: %specific_impl_fn.loc6_10.1: = specific_impl_function %impl.elem0.loc6_10.1, @Copy.WithSelf.Op(constants.%Copy.facet) [template = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: %bound_method.loc6_10.2: = bound_method %.loc6_10.2, %specific_impl_fn.loc6_10.1 // CHECK:STDOUT: %Copy.WithSelf.Op.call: init @F.%ptr.loc5_29.1 (%ptr.e8f8f9.1) = call %bound_method.loc6_10.2(%.loc6_10.2) diff --git a/toolchain/check/testdata/generic/var_param.carbon b/toolchain/check/testdata/generic/var_param.carbon index f9e72df9432c..c1e0298c291c 100644 --- a/toolchain/check/testdata/generic/var_param.carbon +++ b/toolchain/check/testdata/generic/var_param.carbon @@ -11,11 +11,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/generic/var_param.carbon interface I { - fn Op[self: Self](); + fn Op(self); } impl i32 as I { - fn Op[unused self: Self]() {} + fn Op(unused self) {} } //@dump-sem-ir-begin diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index 56e9a313bcf5..ed4aadcbe1df 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -52,7 +52,7 @@ interface I { class C {} impl () as Core.ImplicitAs(C) { - fn Convert[unused 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] @@ -100,6 +100,7 @@ fn CallF() { F({}); } + // CHECK:STDOUT: --- assoc_const_self.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -500,7 +501,7 @@ fn CallF() { // CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %C.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc11_36: Core.Form = init_form %C.ref [concrete = constants.%.a44] +// CHECK:STDOUT: %.loc11_34: Core.Form = init_form %C.ref [concrete = constants.%.a44] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 // 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] @@ -547,10 +548,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_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: %.loc11_46.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc11_46.2: init %C to %return.param = class_init () [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc11_47: init %C = converted %.loc11_46.1, %.loc11_46.2 [concrete = constants.%C.val] +// CHECK:STDOUT: return %.loc11_47 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self.37e) { diff --git a/toolchain/check/testdata/impl/basic.carbon b/toolchain/check/testdata/impl/basic.carbon index ec90cc3db32a..b25a61714089 100644 --- a/toolchain/check/testdata/impl/basic.carbon +++ b/toolchain/check/testdata/impl/basic.carbon @@ -31,7 +31,7 @@ impl C as Simple { library "[[@TEST_NAME]]"; interface I { - fn Op[self: Self](); + fn Op(self); } class C {} @@ -42,7 +42,7 @@ class C {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: impl Unknown as I { - fn Op[unused self: Self]() {} + fn Op(unused self) {} } // --- fail_import_invalid_impl.carbon diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index dab01b13b4fb..eaa9c98d242b 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -16,7 +16,7 @@ package Core; interface ImplicitAs(Dest:! type) { - fn Convert[self: Self]() -> Dest; + fn Convert(self) -> Dest; } // --- non-instance_success.carbon @@ -86,11 +86,11 @@ fn NonInstanceCallIndirect(p: {.c: ()}*) { library "[[@TEST_NAME]]"; interface Instance1 { - fn G1[self: Self](); + fn G1(self); } impl {.d: ()} as Instance1 { - fn G1[unused self: Self]() {} + fn G1(unused self) {} } fn InstanceCall(n: {.d: ()}) { @@ -105,11 +105,11 @@ fn InstanceCallIndirect(p: {.d: ()}*) { library "[[@TEST_NAME]]"; interface Instance2 { - fn G2[self: Self](); + fn G2(self); } impl {.e: ()} as Instance2 { - fn G2[unused self: Self]() {} + fn G2(unused self) {} } fn InstanceCallFail() { @@ -120,6 +120,7 @@ fn InstanceCallFail() { {.e: ()}.(Instance2.G2)(); } + // CHECK:STDOUT: --- core.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -169,31 +170,31 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.decl: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type) = fn_decl @ImplicitAs.WithSelf.Convert [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert)] { -// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_18 (%pattern_type.701) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_18 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_31 (%pattern_type.51d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %Dest.ref [concrete] +// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.701) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_23 (%pattern_type.51d) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_23 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %Dest.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc3_26.2 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.loc4_31.2: Core.Form = init_form %Dest.ref [symbolic = %.loc4_31.1 (constants.%.184)] -// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_20.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.3 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc4_20.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc3_35.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc4_20.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc4_20.3: type = converted %Self.ref, %Self.as_type.loc4_20.2 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_23.2: Core.Form = init_form %Dest.ref [symbolic = %.loc4_23.1 (constants.%.184)] +// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_14.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc4_14.1: type = splice_block %.loc4_14.3 [symbolic = %Self.as_type.loc4_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc4_14.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc3_35.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc4_14.2 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc4_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_14.3: type = converted %Self.ref, %Self.as_type.loc4_14.2 [symbolic = %Self.as_type.loc4_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_20.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_14.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref @ImplicitAs.WithSelf.Convert.%Dest (%Dest) = out_param call_param1 // CHECK:STDOUT: %return: ref @ImplicitAs.WithSelf.Convert.%Dest (%Dest) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc4_35.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0)] +// CHECK:STDOUT: %assoc0.loc4_27.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc4_27.2 (constants.%assoc0)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc3_35.1 // CHECK:STDOUT: .Dest = // CHECK:STDOUT: .Dest = -// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc4_35.1 +// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc4_27.1 // CHECK:STDOUT: witness = (@ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: @@ -204,12 +205,12 @@ fn InstanceCallFail() { // CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [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)] -// CHECK:STDOUT: %Self.as_type.loc4_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type.loc4_18: type = pattern_type %Self.as_type.loc4_20.1 [symbolic = %pattern_type.loc4_18 (constants.%pattern_type.701)] -// CHECK:STDOUT: %.loc4_31.1: Core.Form = init_form %Dest [symbolic = %.loc4_31.1 (constants.%.184)] -// CHECK:STDOUT: %pattern_type.loc4_31: type = pattern_type %Dest [symbolic = %pattern_type.loc4_31 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %Self.as_type.loc4_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type.loc4_14: type = pattern_type %Self.as_type.loc4_14.1 [symbolic = %pattern_type.loc4_14 (constants.%pattern_type.701)] +// CHECK:STDOUT: %.loc4_23.1: Core.Form = init_form %Dest [symbolic = %.loc4_23.1 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc4_23: type = pattern_type %Dest [symbolic = %pattern_type.loc4_23 (constants.%pattern_type.51d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_20.1 (%Self.as_type)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%Dest (%Dest); +// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_14.1 (%Self.as_type)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { @@ -222,10 +223,10 @@ fn InstanceCallFail() { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3aa // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc4_20.1 => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type.loc4_18 => constants.%pattern_type.701 -// CHECK:STDOUT: %.loc4_31.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc4_31 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc4_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %pattern_type.loc4_14 => constants.%pattern_type.701 +// CHECK:STDOUT: %.loc4_23.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc4_23 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- non-instance_success.carbon @@ -843,13 +844,13 @@ fn InstanceCallFail() { // CHECK:STDOUT: %self.param_patt: @Instance1.WithSelf.G1.%pattern_type (%pattern_type.f46) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Instance1.WithSelf.G1.%pattern_type (%pattern_type.f46) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Instance1.WithSelf.G1.%Self.as_type.loc4_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @Instance1.WithSelf.G1.%Self.as_type.loc4_9.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc4_9.1: type = splice_block %.loc4_9.2 [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %Instance1.type = name_ref Self, @Instance1.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref, %Self.as_type.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc4_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_9.2: type = converted %Self.ref, %Self.as_type.loc4_9.2 [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Instance1.WithSelf.G1.%Self.as_type.loc4_15.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Instance1.WithSelf.G1.%Self.as_type.loc4_9.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %Instance1.assoc_type = assoc_entity element0, %Instance1.WithSelf.G1.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -881,10 +882,10 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Instance1.WithSelf.G1(@Instance1.%Self: %Instance1.type) { // CHECK:STDOUT: %Self: %Instance1.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_15.1 [symbolic = %pattern_type (constants.%pattern_type.f46)] +// CHECK:STDOUT: %Self.as_type.loc4_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_9.1 [symbolic = %pattern_type (constants.%pattern_type.f46)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Instance1.WithSelf.G1.%Self.as_type.loc4_15.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @Instance1.WithSelf.G1.%Self.as_type.loc4_9.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @struct_type.d.as.Instance1.impl.G1(%self.param: %struct_type.d) { @@ -929,7 +930,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Instance1.WithSelf.G1(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc4_9.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f46 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -942,7 +943,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Instance1.WithSelf.G1(constants.%Instance1.facet) { // CHECK:STDOUT: %Self => constants.%Instance1.facet -// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%struct_type.d +// CHECK:STDOUT: %Self.as_type.loc4_9.1 => constants.%struct_type.d // CHECK:STDOUT: %pattern_type => constants.%pattern_type.515 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -995,13 +996,13 @@ fn InstanceCallFail() { // CHECK:STDOUT: %self.param_patt: @Instance2.WithSelf.G2.%pattern_type (%pattern_type.8a4) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Instance2.WithSelf.G2.%pattern_type (%pattern_type.8a4) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Instance2.WithSelf.G2.%Self.as_type.loc4_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @Instance2.WithSelf.G2.%Self.as_type.loc4_9.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc4_9.1: type = splice_block %.loc4_9.2 [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %Instance2.type = name_ref Self, @Instance2.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref, %Self.as_type.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc4_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_9.2: type = converted %Self.ref, %Self.as_type.loc4_9.2 [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Instance2.WithSelf.G2.%Self.as_type.loc4_15.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Instance2.WithSelf.G2.%Self.as_type.loc4_9.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %Instance2.assoc_type = assoc_entity element0, %Instance2.WithSelf.G2.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -1033,10 +1034,10 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Instance2.WithSelf.G2(@Instance2.%Self: %Instance2.type) { // CHECK:STDOUT: %Self: %Instance2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_15.1 [symbolic = %pattern_type (constants.%pattern_type.8a4)] +// CHECK:STDOUT: %Self.as_type.loc4_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_9.1 [symbolic = %pattern_type (constants.%pattern_type.8a4)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Instance2.WithSelf.G2.%Self.as_type.loc4_15.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @Instance2.WithSelf.G2.%Self.as_type.loc4_9.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @struct_type.e.as.Instance2.impl.G2(%self.param: %struct_type.e) { @@ -1063,7 +1064,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Instance2.WithSelf.G2(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc4_9.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8a4 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1076,7 +1077,7 @@ fn InstanceCallFail() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Instance2.WithSelf.G2(constants.%Instance2.facet) { // CHECK:STDOUT: %Self => constants.%Instance2.facet -// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%struct_type.e +// CHECK:STDOUT: %Self.as_type.loc4_9.1 => constants.%struct_type.e // CHECK:STDOUT: %pattern_type => constants.%pattern_type.efd // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/error_recovery.carbon b/toolchain/check/testdata/impl/error_recovery.carbon index 315754553dc3..60d00d5a1d04 100644 --- a/toolchain/check/testdata/impl/error_recovery.carbon +++ b/toolchain/check/testdata/impl/error_recovery.carbon @@ -111,7 +111,7 @@ fn G() { library "[[@TEST_NAME]]"; interface I { - fn Op[self: Self](); + fn Op(self); } class C {}; diff --git a/toolchain/check/testdata/impl/eval_musteval.carbon b/toolchain/check/testdata/impl/eval_musteval.carbon index c037a74bac16..500118dbdd00 100644 --- a/toolchain/check/testdata/impl/eval_musteval.carbon +++ b/toolchain/check/testdata/impl/eval_musteval.carbon @@ -15,15 +15,15 @@ library "[[@TEST_NAME]]"; interface Runtime { - fn F[self: Self]() -> type; + fn F(self) -> type; } interface Eval { - eval fn F[self: Self]() -> type; + eval fn F(self) -> type; } interface MustEval { - musteval fn F[self: Self]() -> type; + musteval fn F(self) -> type; } // --- impl_runtime.carbon @@ -35,19 +35,19 @@ import library "interface"; class A { adapt {}; } impl A as Runtime { - fn F[unused self: Self]() -> type { return A; } + fn F(unused self) -> type { return A; } } impl A as Eval { // TODO: Consider rejecting this, as compile-time evaluation would always // fail. - fn F[unused self: Self]() -> type { return A; } + fn F(unused self) -> type { return A; } } impl A as MustEval { // TODO: Consider rejecting this, as compile-time evaluation would always // fail. - fn F[unused self: Self]() -> type { return A; } + fn F(unused self) -> type { return A; } } fn Call() { @@ -65,15 +65,15 @@ import library "interface"; class A { adapt {}; } impl A as Runtime { - fn F[unused self: Self]() -> type { return A; } + fn F(unused self) -> type { return A; } } impl A as Eval { - fn F[unused self: Self]() -> type { return A; } + fn F(unused self) -> type { return A; } } impl A as MustEval { - fn F[unused self: Self]() -> type { return A; } + fn F(unused self) -> type { return A; } } fn Call() { @@ -103,15 +103,15 @@ import library "interface"; class A { adapt {}; } impl A as Runtime { - eval fn F[unused self: Self]() -> type { return A; } + eval fn F(unused self) -> type { return A; } } impl A as Eval { - eval fn F[unused self: Self]() -> type { return A; } + eval fn F(unused self) -> type { return A; } } impl A as MustEval { - eval fn F[unused self: Self]() -> type { return A; } + eval fn F(unused self) -> type { return A; } } fn Call() { @@ -132,11 +132,11 @@ class B {} class BView {} impl B as Core.ImplicitAs(BView) { - fn Convert[unused self: Self]() -> BView { return {}; } + fn Convert(unused self) -> BView { return {}; } } impl B as Runtime { - eval fn F[unused self: BView]() -> type { return B; } + eval fn F(unused self: BView) -> type { return B; } } fn Call() { @@ -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[unused self: Self]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F(unused 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[unused self: Self]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F(unused 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: fn F(self) -> type; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - musteval fn F[unused self: Self]() -> type { return B; } + musteval fn F(unused 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[unused self: Self]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F(unused 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[unused self: Self]() -> type { return B; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: musteval fn F(unused 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: eval fn F(self) -> type; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - musteval fn F[unused self: Self]() -> type { return B; } + musteval fn F(unused self) -> type { return B; } } // --- impl_musteval_from_musteval.carbon @@ -196,7 +196,7 @@ import library "interface"; class B { adapt {}; } impl B as MustEval { - musteval fn F[unused self: Self]() -> type { return B; } + musteval fn F(unused self) -> type { return B; } } fn Call() { @@ -213,20 +213,20 @@ class B {} class BView {} impl B as Core.ImplicitAs(BView) { - fn Convert[unused self: Self]() -> BView { return {}; } + fn Convert(unused 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[unused 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[unused 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) -> type; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - musteval fn F[unused self: BView]() -> type { return B; } + musteval fn F(unused self: BView) -> type { return B; } } diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index d59b4f28de8e..d84771d39544 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -42,15 +42,16 @@ fn G(c: C) { library "[[@TEST_NAME]]"; interface I(T:! type) { - fn F[self: Self](t: T); + fn F(self, t: T); } class X(U:! type) { extend impl as I(U) { - fn F[unused self: Self](unused t: U) { } + fn F(unused self, unused t: U) { } } } + // CHECK:STDOUT: --- extend_impl_generic_interface.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -513,30 +514,30 @@ class X(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %I.WithSelf.F.decl: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.09f79b.1) = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.5f2714.1)] { -// CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type.loc5_12 (%pattern_type.b82) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type.loc5_12 (%pattern_type.b82) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %t.param_patt: @I.WithSelf.F.%pattern_type.loc5_21 (%pattern_type.51d1c4.1) = value_param_pattern [concrete] -// CHECK:STDOUT: %t.patt: @I.WithSelf.F.%pattern_type.loc5_21 (%pattern_type.51d1c4.1) = at_binding_pattern t, %t.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type.loc5_8 (%pattern_type.b82) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type.loc5_8 (%pattern_type.b82) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %t.param_patt: @I.WithSelf.F.%pattern_type.loc5_15 (%pattern_type.51d1c4.1) = value_param_pattern [concrete] +// CHECK:STDOUT: %t.patt: @I.WithSelf.F.%pattern_type.loc5_15 (%pattern_type.51d1c4.1) = at_binding_pattern t, %t.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.3 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc5_14.2: @I.WithSelf.F.%I.type (%I.type.3fe556.1) = specific_constant @I.%Self.loc4_23.1, @I(constants.%T) [symbolic = %Self (constants.%Self.1916c4.1)] -// CHECK:STDOUT: %Self.ref: @I.WithSelf.F.%I.type (%I.type.3fe556.1) = name_ref Self, %.loc5_14.2 [symbolic = %Self (constants.%Self.1916c4.1)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.3: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.3 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc5_8.2: @I.WithSelf.F.%I.type (%I.type.3fe556.1) = specific_constant @I.%Self.loc4_23.1, @I(constants.%T) [symbolic = %Self (constants.%Self.1916c4.1)] +// CHECK:STDOUT: %Self.ref: @I.WithSelf.F.%I.type (%I.type.3fe556.1) = name_ref Self, %.loc5_8.2 [symbolic = %Self (constants.%Self.1916c4.1)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.3: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: %t.param: @I.WithSelf.F.%T (%T) = value_param call_param1 // CHECK:STDOUT: %T.ref: type = name_ref T, @I.%T.loc4_14.2 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %t: @I.WithSelf.F.%T (%T) = value_binding t, %t.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc5_25.1: @I.WithSelf.%I.assoc_type (%I.assoc_type.b71f2b.1) = assoc_entity element0, %I.WithSelf.F.decl [symbolic = %assoc0.loc5_25.2 (constants.%assoc0.13b5f8.1)] +// CHECK:STDOUT: %assoc0.loc5_19.1: @I.WithSelf.%I.assoc_type (%I.assoc_type.b71f2b.1) = assoc_entity element0, %I.WithSelf.F.decl [symbolic = %assoc0.loc5_19.2 (constants.%assoc0.13b5f8.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc4_23.1 // CHECK:STDOUT: .T = // CHECK:STDOUT: .T = -// CHECK:STDOUT: .F = @I.WithSelf.%assoc0.loc5_25.1 +// CHECK:STDOUT: .F = @I.WithSelf.%assoc0.loc5_19.1 // CHECK:STDOUT: .U = // CHECK:STDOUT: witness = (@I.WithSelf.%I.WithSelf.F.decl) // CHECK:STDOUT: @@ -557,15 +558,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.param_patt: @X.as.I.impl.F.%pattern_type.loc10_21 (%pattern_type.056) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @X.as.I.impl.F.%pattern_type.loc10_21 (%pattern_type.056) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %t.param_patt: @X.as.I.impl.F.%pattern_type.loc10_37 (%pattern_type.51d1c4.2) = value_param_pattern [concrete] -// CHECK:STDOUT: %t.patt: @X.as.I.impl.F.%pattern_type.loc10_37 (%pattern_type.51d1c4.2) = at_binding_pattern t, %t.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @X.as.I.impl.F.%pattern_type.loc10_17 (%pattern_type.056) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @X.as.I.impl.F.%pattern_type.loc10_17 (%pattern_type.056) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %t.param_patt: @X.as.I.impl.F.%pattern_type.loc10_31 (%pattern_type.51d1c4.2) = value_param_pattern [concrete] +// CHECK:STDOUT: %t.patt: @X.as.I.impl.F.%pattern_type.loc10_31 (%pattern_type.51d1c4.2) = at_binding_pattern t, %t.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: @X.as.I.impl.F.%X (%X) = value_param call_param0 -// 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: %.loc10_17.1: type = splice_block %Self.ref [symbolic = %X (constants.%X)] { +// CHECK:STDOUT: %.loc10_17.2: type = specific_constant constants.%X, @X(constants.%U) [symbolic = %X (constants.%X)] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc10_17.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 @@ -613,22 +614,22 @@ class X(U:! type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.3fe556.1)] // CHECK:STDOUT: %Self: @I.WithSelf.F.%I.type (%I.type.3fe556.1) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.1916c4.1)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type.loc5_12: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type.loc5_12 (constants.%pattern_type.b82)] -// CHECK:STDOUT: %pattern_type.loc5_21: type = pattern_type %T [symbolic = %pattern_type.loc5_21 (constants.%pattern_type.51d1c4.1)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type.loc5_8: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type.loc5_8 (constants.%pattern_type.b82)] +// CHECK:STDOUT: %pattern_type.loc5_15: type = pattern_type %T [symbolic = %pattern_type.loc5_15 (constants.%pattern_type.51d1c4.1)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type), %t.param: @I.WithSelf.F.%T (%T)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type), %t.param: @I.WithSelf.F.%T (%T)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @X.as.I.impl.F(@X.%U.loc8_10.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_21: type = pattern_type %X [symbolic = %pattern_type.loc10_21 (constants.%pattern_type.056)] -// CHECK:STDOUT: %pattern_type.loc10_37: type = pattern_type %U [symbolic = %pattern_type.loc10_37 (constants.%pattern_type.51d1c4.2)] +// CHECK:STDOUT: %pattern_type.loc10_17: type = pattern_type %X [symbolic = %pattern_type.loc10_17 (constants.%pattern_type.056)] +// CHECK:STDOUT: %pattern_type.loc10_31: type = pattern_type %U [symbolic = %pattern_type.loc10_31 (constants.%pattern_type.51d1c4.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc10_21: = require_complete_type %X [symbolic = %require_complete.loc10_21 (constants.%require_complete.ec9)] -// CHECK:STDOUT: %require_complete.loc10_37: = require_complete_type %U [symbolic = %require_complete.loc10_37 (constants.%require_complete.944)] +// CHECK:STDOUT: %require_complete.loc10_17: = require_complete_type %X [symbolic = %require_complete.loc10_17 (constants.%require_complete.ec9)] +// CHECK:STDOUT: %require_complete.loc10_31: = require_complete_type %U [symbolic = %require_complete.loc10_31 (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: @@ -646,9 +647,9 @@ class X(U:! type) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %I.type => constants.%I.type.3fe556.1 // CHECK:STDOUT: %Self => constants.%Self.1916c4.1 -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.b82 -// CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.51d1c4.1 +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type +// CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.b82 +// CHECK:STDOUT: %pattern_type.loc5_15 => constants.%pattern_type.51d1c4.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @X(constants.%U) { @@ -687,14 +688,14 @@ class X(U:! type) { // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.09f79b.2 // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.5f2714.2 // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.b71f2b.2 -// CHECK:STDOUT: %assoc0.loc5_25.2 => constants.%assoc0.13b5f8.2 +// CHECK:STDOUT: %assoc0.loc5_19.2 => constants.%assoc0.13b5f8.2 // CHECK:STDOUT: } // CHECK:STDOUT: // 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_21 => constants.%pattern_type.056 -// CHECK:STDOUT: %pattern_type.loc10_37 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: %pattern_type.loc10_17 => constants.%pattern_type.056 +// CHECK:STDOUT: %pattern_type.loc10_31 => constants.%pattern_type.51d1c4.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%U, constants.%I.facet) { @@ -705,15 +706,15 @@ class X(U:! type) { // CHECK:STDOUT: %I.WithSelf.F.type => constants.%I.WithSelf.F.type.2f9 // CHECK:STDOUT: %I.WithSelf.F => constants.%I.WithSelf.F.1c3 // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.b71f2b.2 -// CHECK:STDOUT: %assoc0.loc5_25.2 => constants.%assoc0.13b5f8.2 +// CHECK:STDOUT: %assoc0.loc5_19.2 => constants.%assoc0.13b5f8.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%U, constants.%I.facet) { // CHECK:STDOUT: %T => constants.%U // CHECK:STDOUT: %I.type => constants.%I.type.3fe556.2 // CHECK:STDOUT: %Self => constants.%I.facet -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%X -// CHECK:STDOUT: %pattern_type.loc5_12 => constants.%pattern_type.056 -// CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%X +// CHECK:STDOUT: %pattern_type.loc5_8 => constants.%pattern_type.056 +// CHECK:STDOUT: %pattern_type.loc5_15 => constants.%pattern_type.51d1c4.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 5f1a3c8f32e0..c0a4c76b467a 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -13,21 +13,22 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_call_invalid.carbon interface Simple { - fn G[self: Self](); + fn G(self); } impl i32 as Simple { // CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+4]]:14: error: name `Undeclared` not found [NameNotFound] - // CHECK:STDERR: fn G[self: Undeclared](); + // CHECK:STDERR: fn G(self: Undeclared); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - fn G[self: Undeclared](); + fn G(self: Undeclared); } fn InstanceCall(n: i32) { n.(Simple.G)(); } + // CHECK:STDOUT: --- fail_call_invalid.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -45,13 +46,13 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %Simple.impl_witness: = impl_witness @i32.as.Simple.impl.%Simple.impl_witness_table [concrete] -// CHECK:STDOUT: %i32.as.Simple.impl.G.type.321a2c.1: type = fn_type @i32.as.Simple.impl.G.loc24_27.1 [concrete] +// CHECK:STDOUT: %i32.as.Simple.impl.G.type.321a2c.1: type = fn_type @i32.as.Simple.impl.G.loc24_25.1 [concrete] // CHECK:STDOUT: %i32.as.Simple.impl.G.d407b2.1: %i32.as.Simple.impl.G.type.321a2c.1 = struct_value () [concrete] // CHECK:STDOUT: %Simple.facet: %Simple.type = facet_value %i32, (%Simple.impl_witness) [concrete] // CHECK:STDOUT: %Simple.WithSelf.G.type.780: type = fn_type @Simple.WithSelf.G, @Simple.WithSelf(%Simple.facet) [concrete] // CHECK:STDOUT: %Simple.WithSelf.G.dbb: %Simple.WithSelf.G.type.780 = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %i32.as.Simple.impl.G.type.321a2c.2: type = fn_type @i32.as.Simple.impl.G.loc24_27.2 [concrete] +// CHECK:STDOUT: %i32.as.Simple.impl.G.type.321a2c.2: type = fn_type @i32.as.Simple.impl.G.loc24_25.2 [concrete] // CHECK:STDOUT: %i32.as.Simple.impl.G.d407b2.2: %i32.as.Simple.impl.G.type.321a2c.2 = struct_value () [concrete] // CHECK:STDOUT: %InstanceCall.type: type = fn_type @InstanceCall [concrete] // CHECK:STDOUT: %InstanceCall: %InstanceCall.type = struct_value () [concrete] @@ -99,13 +100,13 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %self.param_patt: @Simple.WithSelf.G.%pattern_type (%pattern_type.c62) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Simple.WithSelf.G.%pattern_type (%pattern_type.c62) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Simple.WithSelf.G.%Self.as_type.loc16_14.1 (%Self.as_type) = 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)] { +// CHECK:STDOUT: %self.param: @Simple.WithSelf.G.%Self.as_type.loc16_8.1 (%Self.as_type) = 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)] { // CHECK:STDOUT: %Self.ref: %Simple.type = name_ref Self, @Simple.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc16_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc16_14.2: type = converted %Self.ref, %Self.as_type.loc16_14.2 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc16_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc16_8.2: type = converted %Self.ref, %Self.as_type.loc16_8.2 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Simple.WithSelf.G.%Self.as_type.loc16_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Simple.WithSelf.G.%Self.as_type.loc16_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %Simple.assoc_type = assoc_entity element0, %Simple.WithSelf.G.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -119,7 +120,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @i32.as.Simple.impl: %i32 as %Simple.ref { -// CHECK:STDOUT: %i32.as.Simple.impl.G.decl.loc24_27.1: %i32.as.Simple.impl.G.type.321a2c.1 = fn_decl @i32.as.Simple.impl.G.loc24_27.1 [concrete = constants.%i32.as.Simple.impl.G.d407b2.1] { +// CHECK:STDOUT: %i32.as.Simple.impl.G.decl.loc24_25.1: %i32.as.Simple.impl.G.type.321a2c.1 = fn_decl @i32.as.Simple.impl.G.loc24_25.1 [concrete = constants.%i32.as.Simple.impl.G.d407b2.1] { // CHECK:STDOUT: %self.param_patt: = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { @@ -127,36 +128,36 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %Undeclared.ref: = name_ref Undeclared, [concrete = ] // CHECK:STDOUT: %self: = value_binding self, [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %i32.as.Simple.impl.G.decl.loc24_27.2: %i32.as.Simple.impl.G.type.321a2c.2 = fn_decl @i32.as.Simple.impl.G.loc24_27.2 [concrete = constants.%i32.as.Simple.impl.G.d407b2.2] { +// CHECK:STDOUT: %i32.as.Simple.impl.G.decl.loc24_25.2: %i32.as.Simple.impl.G.type.321a2c.2 = fn_decl @i32.as.Simple.impl.G.loc24_25.2 [concrete = constants.%i32.as.Simple.impl.G.d407b2.2] { // CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.6b6 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: %i32 = value_param call_param0 // CHECK:STDOUT: %self: %i32 = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (%i32.as.Simple.impl.G.decl.loc24_27.2), @i32.as.Simple.impl [concrete] +// CHECK:STDOUT: %Simple.impl_witness_table = impl_witness_table (%i32.as.Simple.impl.G.decl.loc24_25.2), @i32.as.Simple.impl [concrete] // CHECK:STDOUT: %Simple.impl_witness: = impl_witness %Simple.impl_witness_table [concrete = constants.%Simple.impl_witness] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Undeclared = -// CHECK:STDOUT: .G = %i32.as.Simple.impl.G.decl.loc24_27.1 +// CHECK:STDOUT: .G = %i32.as.Simple.impl.G.decl.loc24_25.1 // CHECK:STDOUT: extend %Simple.ref // CHECK:STDOUT: witness = %Simple.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Simple.WithSelf.G(@Simple.%Self: %Simple.type) { // CHECK:STDOUT: %Self: %Simple.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc16_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_14.1 [symbolic = %pattern_type (constants.%pattern_type.c62)] +// CHECK:STDOUT: %Self.as_type.loc16_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_8.1 [symbolic = %pattern_type (constants.%pattern_type.c62)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Simple.WithSelf.G.%Self.as_type.loc16_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @Simple.WithSelf.G.%Self.as_type.loc16_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @i32.as.Simple.impl.G.loc24_27.1(%self.param: ); +// CHECK:STDOUT: fn @i32.as.Simple.impl.G.loc24_25.1(%self.param: ); // CHECK:STDOUT: -// CHECK:STDOUT: fn @i32.as.Simple.impl.G.loc24_27.2(%self.param: %i32) [thunk @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_27.1 for @Simple.WithSelf.%Simple.WithSelf.G.decl, @Simple.WithSelf.G(constants.%Simple.facet)] { +// CHECK:STDOUT: fn @i32.as.Simple.impl.G.loc24_25.2(%self.param: %i32) [thunk @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_25.1 for @Simple.WithSelf.%Simple.WithSelf.G.decl, @Simple.WithSelf.G(constants.%Simple.facet)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %G.ref: %i32.as.Simple.impl.G.type.321a2c.1 = name_ref G, @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_27.1 [concrete = constants.%i32.as.Simple.impl.G.d407b2.1] +// CHECK:STDOUT: %G.ref: %i32.as.Simple.impl.G.type.321a2c.1 = name_ref G, @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_25.1 [concrete = constants.%i32.as.Simple.impl.G.d407b2.1] // CHECK:STDOUT: %i32.as.Simple.impl.G.bound: = bound_method %self.param, %G.ref // CHECK:STDOUT: %i32.as.Simple.impl.G.call: init %empty_tuple.type = call %i32.as.Simple.impl.G.bound() // CHECK:STDOUT: return @@ -169,7 +170,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %G.ref.loc28_12: %Simple.assoc_type = name_ref G, @Simple.WithSelf.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.785 = impl_witness_access constants.%Simple.impl_witness, element0 [concrete = constants.%i32.as.Simple.impl.G.d407b2.2] // CHECK:STDOUT: %bound_method: = bound_method %n.ref, %impl.elem0 -// CHECK:STDOUT: %G.ref.loc28_16: %i32.as.Simple.impl.G.type.321a2c.1 = name_ref G, @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_27.1 [concrete = constants.%i32.as.Simple.impl.G.d407b2.1] +// CHECK:STDOUT: %G.ref.loc28_16: %i32.as.Simple.impl.G.type.321a2c.1 = name_ref G, @i32.as.Simple.impl.%i32.as.Simple.impl.G.decl.loc24_25.1 [concrete = constants.%i32.as.Simple.impl.G.d407b2.1] // CHECK:STDOUT: %i32.as.Simple.impl.G.bound: = bound_method %n.ref, %G.ref.loc28_16 // CHECK:STDOUT: %i32.as.Simple.impl.G.call: init %empty_tuple.type = call %i32.as.Simple.impl.G.bound() // CHECK:STDOUT: return @@ -184,7 +185,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple.WithSelf.G(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc16_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc16_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c62 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -197,7 +198,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple.WithSelf.G(constants.%Simple.facet) { // CHECK:STDOUT: %Self => constants.%Simple.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: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 4721be6003d2..e46273a512e9 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -48,7 +48,7 @@ library "[[@TEST_NAME]]"; interface Z { fn Zero(); - fn Method[self: Self](); + fn Method(self); // CHECK:STDERR: fail_impl_as_self_interface.carbon:[[@LINE+4]]:9: error: `impl as` can only be used in a class [ImplAsOutsideClass] // CHECK:STDERR: impl as Z { @@ -56,14 +56,14 @@ interface Z { // CHECK:STDERR: impl as Z { fn Zero() {} - fn Method[unused self: Self]() {} + fn Method(unused self) {} } } class Point { impl as Z { fn Zero() {} - fn Method[unused self: Self]() {} + fn Method(unused self) {} } } @@ -99,6 +99,7 @@ class X { } } + // CHECK:STDOUT: --- fail_impl_as_file_scope.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -312,13 +313,13 @@ class X { // CHECK:STDOUT: %self.param_patt: @Z.WithSelf.Method.%pattern_type (%pattern_type.52a) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Z.WithSelf.Method.%pattern_type (%pattern_type.52a) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Z.WithSelf.Method.%Self.as_type.loc5_19.1 (%Self.as_type.0cf) = value_param call_param0 -// CHECK:STDOUT: %.loc5_19.1: type = splice_block %.loc5_19.2 [symbolic = %Self.as_type.loc5_19.1 (constants.%Self.as_type.0cf)] { +// CHECK:STDOUT: %self.param: @Z.WithSelf.Method.%Self.as_type.loc5_13.1 (%Self.as_type.0cf) = value_param call_param0 +// CHECK:STDOUT: %.loc5_13.1: type = splice_block %.loc5_13.2 [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type.0cf)] { // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self [symbolic = %Self (constants.%Self.cb6)] -// CHECK:STDOUT: %Self.as_type.loc5_19.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_19.1 (constants.%Self.as_type.0cf)] -// CHECK:STDOUT: %.loc5_19.2: type = converted %Self.ref, %Self.as_type.loc5_19.2 [symbolic = %Self.as_type.loc5_19.1 (constants.%Self.as_type.0cf)] +// CHECK:STDOUT: %Self.as_type.loc5_13.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type.0cf)] +// CHECK:STDOUT: %.loc5_13.2: type = converted %Self.ref, %Self.as_type.loc5_13.2 [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type.0cf)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Z.WithSelf.Method.%Self.as_type.loc5_19.1 (%Self.as_type.0cf) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Z.WithSelf.Method.%Self.as_type.loc5_13.1 (%Self.as_type.0cf) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc1: %Z.assoc_type = assoc_entity element1, %Z.WithSelf.Method.decl [concrete = constants.%assoc1] // CHECK:STDOUT: impl_decl @.as.Z.impl [concrete] {} { @@ -350,13 +351,13 @@ class X { // CHECK:STDOUT: %self.param_patt: @.as.Z.impl.Method.%pattern_type (%pattern_type.52a) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @.as.Z.impl.Method.%pattern_type (%pattern_type.52a) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @.as.Z.impl.Method.%Self.as_type.loc13_28.1 (%Self.as_type.0cf) = value_param call_param0 -// CHECK:STDOUT: %.loc13_28.1: type = splice_block %.loc13_28.2 [symbolic = %Self.as_type.loc13_28.1 (constants.%Self.as_type.0cf)] { +// CHECK:STDOUT: %self.param: @.as.Z.impl.Method.%Self.as_type.loc13_22.1 (%Self.as_type.0cf) = value_param call_param0 +// CHECK:STDOUT: %.loc13_22.1: type = splice_block %.loc13_22.2 [symbolic = %Self.as_type.loc13_22.1 (constants.%Self.as_type.0cf)] { // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self [symbolic = %Self (constants.%Self.cb6)] -// CHECK:STDOUT: %Self.as_type.loc13_28.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_28.1 (constants.%Self.as_type.0cf)] -// CHECK:STDOUT: %.loc13_28.2: type = converted %Self.ref, %Self.as_type.loc13_28.2 [symbolic = %Self.as_type.loc13_28.1 (constants.%Self.as_type.0cf)] +// CHECK:STDOUT: %Self.as_type.loc13_22.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_22.1 (constants.%Self.as_type.0cf)] +// CHECK:STDOUT: %.loc13_22.2: type = converted %Self.ref, %Self.as_type.loc13_22.2 [symbolic = %Self.as_type.loc13_22.1 (constants.%Self.as_type.0cf)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @.as.Z.impl.Method.%Self.as_type.loc13_28.1 (%Self.as_type.0cf) = value_binding self, %self.param +// CHECK:STDOUT: %self: @.as.Z.impl.Method.%Self.as_type.loc13_22.1 (%Self.as_type.0cf) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -406,10 +407,10 @@ class X { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Z.WithSelf.Method(@Z.%Self: %Z.type) { // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.cb6)] -// CHECK:STDOUT: %Self.as_type.loc5_19.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_19.1 (constants.%Self.as_type.0cf)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_19.1 [symbolic = %pattern_type (constants.%pattern_type.52a)] +// CHECK:STDOUT: %Self.as_type.loc5_13.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type.0cf)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_13.1 [symbolic = %pattern_type (constants.%pattern_type.52a)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Z.WithSelf.Method.%Self.as_type.loc5_19.1 (%Self.as_type.0cf)); +// CHECK:STDOUT: fn(%self.param: @Z.WithSelf.Method.%Self.as_type.loc5_13.1 (%Self.as_type.0cf)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.as.Z.impl.Zero(@Z.%Self: %Z.type) { @@ -423,13 +424,13 @@ class X { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @.as.Z.impl.Method(@Z.%Self: %Z.type) { // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.cb6)] -// CHECK:STDOUT: %Self.as_type.loc13_28.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc13_28.1 (constants.%Self.as_type.0cf)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc13_28.1 [symbolic = %pattern_type (constants.%pattern_type.52a)] +// CHECK:STDOUT: %Self.as_type.loc13_22.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc13_22.1 (constants.%Self.as_type.0cf)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc13_22.1 [symbolic = %pattern_type (constants.%pattern_type.52a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc13_28.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc13_22.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @.as.Z.impl.Method.%Self.as_type.loc13_28.1 (%Self.as_type.0cf)) { +// CHECK:STDOUT: fn(%self.param: @.as.Z.impl.Method.%Self.as_type.loc13_22.1 (%Self.as_type.0cf)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -490,7 +491,7 @@ class X { // CHECK:STDOUT: // CHECK:STDOUT: specific @Z.WithSelf.Method(constants.%Self.cb6) { // CHECK:STDOUT: %Self => constants.%Self.cb6 -// CHECK:STDOUT: %Self.as_type.loc5_19.1 => constants.%Self.as_type.0cf +// CHECK:STDOUT: %Self.as_type.loc5_13.1 => constants.%Self.as_type.0cf // CHECK:STDOUT: %pattern_type => constants.%pattern_type.52a // CHECK:STDOUT: } // CHECK:STDOUT: @@ -507,7 +508,7 @@ class X { // CHECK:STDOUT: // CHECK:STDOUT: specific @.as.Z.impl.Method(constants.%Self.cb6) { // CHECK:STDOUT: %Self => constants.%Self.cb6 -// CHECK:STDOUT: %Self.as_type.loc13_28.1 => constants.%Self.as_type.0cf +// CHECK:STDOUT: %Self.as_type.loc13_22.1 => constants.%Self.as_type.0cf // CHECK:STDOUT: %pattern_type => constants.%pattern_type.52a // CHECK:STDOUT: } // CHECK:STDOUT: @@ -524,7 +525,7 @@ class X { // CHECK:STDOUT: // CHECK:STDOUT: specific @Z.WithSelf.Method(constants.%Z.facet) { // CHECK:STDOUT: %Self => constants.%Z.facet -// CHECK:STDOUT: %Self.as_type.loc5_19.1 => constants.%Point +// CHECK:STDOUT: %Self.as_type.loc5_13.1 => constants.%Point // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9d8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index 201f0db3262d..8a1831f07e0b 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -72,17 +72,17 @@ class FExtraParam { class FExtraImplicitParam { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+10]]:5: error: missing object argument in method call [MissingObjectInMethodCall] - // CHECK:STDERR: fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: note: calling function declared here [InCallToFunction] - // CHECK:STDERR: fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+10]]:5: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] + // CHECK:STDERR: fn F(self); + // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: note: calling function declared here [InCallToEntity] + // CHECK:STDERR: fn F(self); + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-66]]:15: note: while building thunk to match the signature of this function [ThunkSignature] // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - fn F[self: Self](); + fn F(self); } } @@ -100,21 +100,21 @@ class FExtraReturnType { } } -interface J { fn F[self: bool](b: bool) -> bool; } +interface J { fn F(self: bool, b: bool) -> bool; } class FMissingParam { impl as J { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+10]]:5: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch] - // CHECK:STDERR: fn F[self: bool]() -> bool; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F(self: bool) -> bool; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: note: calling function declared here [InCallToEntity] - // CHECK:STDERR: fn F[self: bool]() -> bool; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F(self: bool) -> bool; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-10]]:15: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - fn F[self: bool]() -> bool; + fn F(self: bool) -> bool; } } @@ -124,7 +124,7 @@ class FMissingImplicitParam { // CHECK:STDERR: fn F(b: bool) -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-23]]:15: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn F(b: bool) -> bool; @@ -134,70 +134,70 @@ class FMissingImplicitParam { class FMissingReturnType { impl as J { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+16]]:5: error: cannot implicitly convert expression of type `()` to `bool` [ConversionFailure] - // CHECK:STDERR: fn F[self: bool](b: bool); + // CHECK:STDERR: fn F(self: bool, b: bool); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+13]]:5: note: type `()` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: fn F[self: bool](b: bool); + // CHECK:STDERR: fn F(self: bool, b: bool); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-39]]:15: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-43]]:32: error: cannot implicitly convert expression of type `bool` to `FDifferentParamType` [ConversionFailure] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: note: type `bool` does not implement interface `Core.ImplicitAs(FDifferentParamType)` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~ - fn F[self: bool](b: bool); + fn F(self: bool, b: bool); } } class FDifferentParamType { impl as J { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+13]]:22: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[self: bool](b: Self) -> bool; + // CHECK:STDERR: fn F(self: bool, b: Self) -> bool; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-58]]:15: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-62]]:20: error: cannot implicitly convert expression of type `bool` to `FDifferentImplicitParamType` [ConversionFailure] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-65]]:20: note: type `bool` does not implement interface `Core.ImplicitAs(FDifferentImplicitParamType)` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~ - fn F[self: bool](b: Self) -> bool; + fn F(self: bool, b: Self) -> bool; } } class FDifferentImplicitParamType { impl as J { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[self: Self](b: bool) -> bool; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn F(self, b: bool) -> bool; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-77]]:15: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - fn F[self: Self](b: bool) -> bool; + fn F(self, b: bool) -> bool; } } class FDifferentReturnType { impl as J { // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+10]]:5: error: cannot implicitly convert expression of type `FDifferentReturnType` to `bool` [ConversionFailure] - // CHECK:STDERR: fn F[self: bool](b: bool) -> Self; + // CHECK:STDERR: fn F(self: bool, b: bool) -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: note: type `FDifferentReturnType` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] - // CHECK:STDERR: fn F[self: bool](b: bool) -> Self; + // CHECK:STDERR: fn F(self: bool, b: bool) -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-93]]:15: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } + // CHECK:STDERR: interface J { fn F(self: bool, b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - fn F[self: bool](b: bool) -> Self; + fn F(self: bool, b: bool) -> Self; } } @@ -240,6 +240,7 @@ class SelfNestedBadReturnType { } } + // CHECK:STDOUT: --- fail_impl_bad_assoc_fn.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -283,12 +284,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FExtraImplicitParam: type = class_type @FExtraImplicitParam [concrete] // CHECK:STDOUT: %I.impl_witness.2da: = impl_witness @FExtraImplicitParam.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.54d: type = pattern_type %FExtraImplicitParam [concrete] -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc85_23.1 [concrete] +// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc85_15.1 [concrete] // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.a42f35.1: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = struct_value () [concrete] // CHECK:STDOUT: %I.facet.334: %I.type = facet_value %FExtraImplicitParam, (%I.impl_witness.2da) [concrete] // CHECK:STDOUT: %I.WithSelf.F.type.6ff: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet.334) [concrete] // CHECK:STDOUT: %I.WithSelf.F.39e: %I.WithSelf.F.type.6ff = struct_value () [concrete] -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc85_23.2 [concrete] +// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2: type = fn_type @FExtraImplicitParam.as.I.impl.F.loc85_15.2 [concrete] // CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.a42f35.2: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2 = struct_value () [concrete] // CHECK:STDOUT: %FExtraReturnType: type = class_type @FExtraReturnType [concrete] // CHECK:STDOUT: %I.impl_witness.b63: = impl_witness @FExtraReturnType.as.I.impl.%I.impl_witness_table [concrete] @@ -306,12 +307,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %assoc0.000: %J.assoc_type = assoc_entity element0, @J.WithSelf.%J.WithSelf.F.decl [concrete] // CHECK:STDOUT: %FMissingParam: type = class_type @FMissingParam [concrete] // CHECK:STDOUT: %J.impl_witness.a34: = impl_witness @FMissingParam.as.J.impl.%J.impl_witness_table [concrete] -// CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.aad6ec.1: type = fn_type @FMissingParam.as.J.impl.F.loc117_31.1 [concrete] +// CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.aad6ec.1: type = fn_type @FMissingParam.as.J.impl.F.loc117_29.1 [concrete] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.dd09dc.1: %FMissingParam.as.J.impl.F.type.aad6ec.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.d77: %J.type = facet_value %FMissingParam, (%J.impl_witness.a34) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.51b: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.d77) [concrete] // CHECK:STDOUT: %J.WithSelf.F.ed6: %J.WithSelf.F.type.51b = struct_value () [concrete] -// CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.aad6ec.2: type = fn_type @FMissingParam.as.J.impl.F.loc117_31.2 [concrete] +// CHECK:STDOUT: %FMissingParam.as.J.impl.F.type.aad6ec.2: type = fn_type @FMissingParam.as.J.impl.F.loc117_29.2 [concrete] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.dd09dc.2: %FMissingParam.as.J.impl.F.type.aad6ec.2 = struct_value () [concrete] // CHECK:STDOUT: %FMissingImplicitParam: type = class_type @FMissingImplicitParam [concrete] // CHECK:STDOUT: %J.impl_witness.7e6: = impl_witness @FMissingImplicitParam.as.J.impl.%J.impl_witness_table [concrete] @@ -346,12 +347,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FDifferentImplicitParamType: type = class_type @FDifferentImplicitParamType [concrete] // CHECK:STDOUT: %J.impl_witness.cc3: = impl_witness @FDifferentImplicitParamType.as.J.impl.%J.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.1bc: type = pattern_type %FDifferentImplicitParamType [concrete] -// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc184_38.1 [concrete] +// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc184_32.1 [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.792c78.1: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.929: %J.type = facet_value %FDifferentImplicitParamType, (%J.impl_witness.cc3) [concrete] // CHECK:STDOUT: %J.WithSelf.F.type.97c: type = fn_type @J.WithSelf.F, @J.WithSelf(%J.facet.929) [concrete] // CHECK:STDOUT: %J.WithSelf.F.94b: %J.WithSelf.F.type.97c = struct_value () [concrete] -// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc184_38.2 [concrete] +// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2: type = fn_type @FDifferentImplicitParamType.as.J.impl.F.loc184_32.2 [concrete] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.792c78.2: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2 = struct_value () [concrete] // CHECK:STDOUT: %FDifferentReturnType: type = class_type @FDifferentReturnType [concrete] // CHECK:STDOUT: %J.impl_witness.6ab: = impl_witness @FDifferentReturnType.as.J.impl.%J.impl_witness_table [concrete] @@ -633,7 +634,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FExtraImplicitParam.as.I.impl: %Self.ref as %I.ref { -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc85_23.1: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc85_23.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.1] { +// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc85_15.1: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc85_15.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.54d = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.54d = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { @@ -641,12 +642,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FExtraImplicitParam [concrete = constants.%FExtraImplicitParam] // CHECK:STDOUT: %self: %FExtraImplicitParam = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc85_23.2: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc85_23.2 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.2] {} {} -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%FExtraImplicitParam.as.I.impl.F.decl.loc85_23.2), @FExtraImplicitParam.as.I.impl [concrete] +// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.decl.loc85_15.2: %FExtraImplicitParam.as.I.impl.F.type.54cac2.2 = fn_decl @FExtraImplicitParam.as.I.impl.F.loc85_15.2 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.2] {} {} +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%FExtraImplicitParam.as.I.impl.F.decl.loc85_15.2), @FExtraImplicitParam.as.I.impl [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness.2da] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FExtraImplicitParam.as.I.impl.F.decl.loc85_23.1 +// CHECK:STDOUT: .F = %FExtraImplicitParam.as.I.impl.F.decl.loc85_15.1 // CHECK:STDOUT: extend %I.ref // CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } @@ -671,14 +672,14 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FMissingParam.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FMissingParam.as.J.impl.F.decl.loc117_31.1: %FMissingParam.as.J.impl.F.type.aad6ec.1 = fn_decl @FMissingParam.as.J.impl.F.loc117_31.1 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.1] { +// CHECK:STDOUT: %FMissingParam.as.J.impl.F.decl.loc117_29.1: %FMissingParam.as.J.impl.F.type.aad6ec.1 = fn_decl @FMissingParam.as.J.impl.F.loc117_29.1 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.831 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc117_27.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc117_25.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc117_27.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc117_27.2: Core.Form = init_form %.loc117_27.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc117_25.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc117_25.2: Core.Form = init_form %.loc117_25.1 [concrete = constants.%.f34] // CHECK:STDOUT: %self.param: bool = value_param call_param0 // CHECK:STDOUT: %.loc117_16: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %self: bool = value_binding self, %self.param @@ -687,7 +688,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: %.loc103_44.1: type = specific_constant @J.WithSelf.F.%.loc103_44.1, @J.WithSelf.F(constants.%J.facet.d77) [concrete = bool] // CHECK:STDOUT: %.loc103_44.2: type = specific_constant @J.WithSelf.F.%.loc103_44.2, @J.WithSelf.F(constants.%J.facet.d77) [concrete = constants.%.f34] -// CHECK:STDOUT: %FMissingParam.as.J.impl.F.decl.loc117_31.2: %FMissingParam.as.J.impl.F.type.aad6ec.2 = fn_decl @FMissingParam.as.J.impl.F.loc117_31.2 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.2] { +// CHECK:STDOUT: %FMissingParam.as.J.impl.F.decl.loc117_29.2: %FMissingParam.as.J.impl.F.type.aad6ec.2 = fn_decl @FMissingParam.as.J.impl.F.loc117_29.2 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.2] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.831 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete] @@ -702,11 +703,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingParam.as.J.impl.F.decl.loc117_31.2), @FMissingParam.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FMissingParam.as.J.impl.F.decl.loc117_29.2), @FMissingParam.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.a34] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FMissingParam.as.J.impl.F.decl.loc117_31.1 +// CHECK:STDOUT: .F = %FMissingParam.as.J.impl.F.decl.loc117_29.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } @@ -839,28 +840,28 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @FDifferentImplicitParamType.as.J.impl: %Self.ref as %J.ref { -// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.1: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = fn_decl @FDifferentImplicitParamType.as.J.impl.F.loc184_38.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] { +// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.decl.loc184_32.1: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = fn_decl @FDifferentImplicitParamType.as.J.impl.F.loc184_32.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] { // CHECK:STDOUT: %self.param_patt: %pattern_type.1bc = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.1bc = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.831 = at_binding_pattern b, %b.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc184_34.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc184_28.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc184_34.1: type = type_literal bool [concrete = bool] -// CHECK:STDOUT: %.loc184_34.2: Core.Form = init_form %.loc184_34.1 [concrete = constants.%.f34] +// CHECK:STDOUT: %.loc184_28.1: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc184_28.2: Core.Form = init_form %.loc184_28.1 [concrete = constants.%.f34] // CHECK:STDOUT: %self.param: %FDifferentImplicitParamType = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [concrete = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %self: %FDifferentImplicitParamType = value_binding self, %self.param // CHECK:STDOUT: %b.param: bool = value_param call_param1 -// CHECK:STDOUT: %.loc184_25: type = type_literal bool [concrete = bool] +// CHECK:STDOUT: %.loc184_19: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %b: bool = value_binding b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %.loc103_44.1: type = specific_constant @J.WithSelf.F.%.loc103_44.1, @J.WithSelf.F(constants.%J.facet.929) [concrete = bool] // CHECK:STDOUT: %.loc103_44.2: type = specific_constant @J.WithSelf.F.%.loc103_44.2, @J.WithSelf.F(constants.%J.facet.929) [concrete = constants.%.f34] -// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.2: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2 = fn_decl @FDifferentImplicitParamType.as.J.impl.F.loc184_38.2 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.2] { +// CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.decl.loc184_32.2: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.2 = fn_decl @FDifferentImplicitParamType.as.J.impl.F.loc184_32.2 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.2] { // CHECK:STDOUT: %self.param_patt: %pattern_type.831 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.831 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete] @@ -875,11 +876,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %return.param: ref bool = out_param call_param2 // CHECK:STDOUT: %return: ref bool = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.2), @FDifferentImplicitParamType.as.J.impl [concrete] +// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_32.2), @FDifferentImplicitParamType.as.J.impl [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness.cc3] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.1 +// CHECK:STDOUT: .F = %FDifferentImplicitParamType.as.J.impl.F.decl.loc184_32.1 // CHECK:STDOUT: extend %J.ref // CHECK:STDOUT: witness = %J.impl_witness // CHECK:STDOUT: } @@ -1229,12 +1230,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_23.1(%self.param: %FExtraImplicitParam); +// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_15.1(%self.param: %FExtraImplicitParam); // CHECK:STDOUT: -// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_23.2() [thunk @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_23.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.334)] { +// CHECK:STDOUT: fn @FExtraImplicitParam.as.I.impl.F.loc85_15.2() [thunk @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_15.1 for @I.WithSelf.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.334)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = name_ref F, @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_23.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.1] -// CHECK:STDOUT: %FExtraImplicitParam.as.I.impl.F.call: init %empty_tuple.type = call %F.ref() +// CHECK:STDOUT: %F.ref: %FExtraImplicitParam.as.I.impl.F.type.54cac2.1 = name_ref F, @FExtraImplicitParam.as.I.impl.%FExtraImplicitParam.as.I.impl.F.decl.loc85_15.1 [concrete = constants.%FExtraImplicitParam.as.I.impl.F.a42f35.1] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1244,11 +1244,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: fn(%self.param: bool, %b.param: bool) -> out %return.param: bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc117_31.1(%self.param: bool) -> out %return.param: bool; +// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc117_29.1(%self.param: bool) -> out %return.param: bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc117_31.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc117_31.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.d77)] { +// CHECK:STDOUT: fn @FMissingParam.as.J.impl.F.loc117_29.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc117_29.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.d77)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FMissingParam.as.J.impl.F.type.aad6ec.1 = name_ref F, @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc117_31.1 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.1] +// CHECK:STDOUT: %F.ref: %FMissingParam.as.J.impl.F.type.aad6ec.1 = name_ref F, @FMissingParam.as.J.impl.%FMissingParam.as.J.impl.F.decl.loc117_29.1 [concrete = constants.%FMissingParam.as.J.impl.F.dd09dc.1] // CHECK:STDOUT: %FMissingParam.as.J.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1284,11 +1284,11 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: return %FDifferentParamType.as.J.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc184_38.1(%self.param: %FDifferentImplicitParamType, %b.param: bool) -> out %return.param: bool; +// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc184_32.1(%self.param: %FDifferentImplicitParamType, %b.param: bool) -> out %return.param: bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc184_38.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.929)] { +// CHECK:STDOUT: fn @FDifferentImplicitParamType.as.J.impl.F.loc184_32.2(%self.param: bool, %b.param: bool) -> out %return.param: bool [thunk @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_32.1 for @J.WithSelf.%J.WithSelf.F.decl, @J.WithSelf.F(constants.%J.facet.929)] { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = name_ref F, @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_38.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] +// CHECK:STDOUT: %F.ref: %FDifferentImplicitParamType.as.J.impl.F.type.6ef8a6.1 = name_ref F, @FDifferentImplicitParamType.as.J.impl.%FDifferentImplicitParamType.as.J.impl.F.decl.loc184_32.1 [concrete = constants.%FDifferentImplicitParamType.as.J.impl.F.792c78.1] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: %.loc103: %FDifferentImplicitParamType = converted %self.param, [concrete = ] // CHECK:STDOUT: %FDifferentImplicitParamType.as.J.impl.F.call: init bool = call %FDifferentImplicitParamType.as.J.impl.F.bound(, %b.param) diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index 682b1ba0fb65..fe768b7c2956 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -46,12 +46,12 @@ base class B { extend base: A; } class C { extend base: B; } interface X { - fn F[ref self: Self](other: Self*) -> Self*; + fn F(ref self, other: Self*) -> Self*; } impl B as X { //@dump-sem-ir-begin - fn F[ref self: A](other: A*) -> C*; + fn F(ref self: A, other: A*) -> C*; //@dump-sem-ir-end } @@ -63,12 +63,12 @@ base class A {} class B { extend base: A; } interface X { - fn F[self: Self](other: Self); + fn F(self, other: Self); } impl B as X { //@dump-sem-ir-begin - fn F[self: A](other: A); + fn F(self: A, other: A); //@dump-sem-ir-end } @@ -81,12 +81,12 @@ base class B { extend base: A; } class C { extend base: B; } interface X { - fn F[ref self: Self](other: Self*) -> Self*; + fn F(ref self, other: Self*) -> Self*; } impl B as X { //@dump-sem-ir-begin - fn F[ref self: A](other: A*) -> C*; + fn F(ref self: A, other: A*) -> C*; //@dump-sem-ir-end } @@ -99,12 +99,12 @@ base class B { extend base: A; } class C { extend base: B; } interface X { - fn F[ref self: Self](other: Self*) -> Self*; + fn F(ref self, other: Self*) -> Self*; } impl B as X { //@dump-sem-ir-begin - fn F[ref self: A](other: A*) -> C*; + fn F(ref self: A, other: A*) -> C*; //@dump-sem-ir-end } @@ -116,12 +116,12 @@ base class A {} base class B { extend base: A; } interface X { - fn F[self: Self](ref other: Self); + fn F(self, ref other: Self); } impl B as X { //@dump-sem-ir-begin - fn F[self: A](ref other: A); + fn F(self: A, ref other: A); //@dump-sem-ir-end } @@ -317,12 +317,12 @@ impl () as I { library "[[@TEST_NAME]]"; interface I { - fn F[self: Self, T:! type](x: T*) -> T*; + fn F[T:! type](self, x: T*) -> T*; } impl () as I { //@dump-sem-ir-begin - fn F[unused self: (), U:! Core.Copy](x: U) -> U { return x; } + fn F[U:! Core.Copy](unused self: (), x: U) -> U { return x; } //@dump-sem-ir-end } @@ -340,6 +340,7 @@ impl () as I({}) { //@dump-sem-ir-end } + // CHECK:STDOUT: --- struct_conversion.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -525,7 +526,7 @@ impl () as I({}) { // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc9_16.2, %.loc9_29.3) +// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc9_12.2, %.loc9_23.3) // CHECK:STDOUT: %.loc14_37.1: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call // CHECK:STDOUT: %.loc14_37.2: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.1 // CHECK:STDOUT: %.loc14_37.3: ref %C = deref %.loc14_37.2 @@ -591,7 +592,7 @@ impl () as I({}) { // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc13_26.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %empty_tuple.type = call %B.as.X.impl.F.bound(%.loc8_12.3, %.loc8_25.3) +// CHECK:STDOUT: %B.as.X.impl.F.call: init %empty_tuple.type = call %B.as.X.impl.F.bound(%.loc8_8.3, %.loc8_19.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -680,7 +681,7 @@ impl () as I({}) { // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc9_16.2, %.loc9_29.3) +// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc9_12.2, %.loc9_23.3) // CHECK:STDOUT: %.loc14_37.1: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call // CHECK:STDOUT: %.loc14_37.2: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.1 // CHECK:STDOUT: %.loc14_37.3: ref %C = deref %.loc14_37.2 @@ -780,7 +781,7 @@ impl () as I({}) { // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc14_37.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc9_16.2, %.loc9_29.3) +// CHECK:STDOUT: %B.as.X.impl.F.call: init %ptr.6b6 = call %B.as.X.impl.F.bound(%.loc9_12.2, %.loc9_23.3) // CHECK:STDOUT: %.loc14_37.1: %ptr.6b6 = value_of_initializer %B.as.X.impl.F.call // CHECK:STDOUT: %.loc14_37.2: %ptr.6b6 = converted %B.as.X.impl.F.call, %.loc14_37.1 // CHECK:STDOUT: %.loc14_37.3: ref %C = deref %.loc14_37.2 @@ -846,7 +847,7 @@ impl () as I({}) { // CHECK:STDOUT: %F.ref: %B.as.X.impl.F.type.48cdab.1 = name_ref F, @B.as.X.impl.%B.as.X.impl.F.decl.loc13_30.1 [concrete = constants.%B.as.X.impl.F.bd5be1.1] // CHECK:STDOUT: %B.as.X.impl.F.bound: = bound_method %self.param, %F.ref // CHECK:STDOUT: -// CHECK:STDOUT: %B.as.X.impl.F.call: init %empty_tuple.type = call %B.as.X.impl.F.bound(%.loc8_12.3, %.loc8_29.2) +// CHECK:STDOUT: %B.as.X.impl.F.call: init %empty_tuple.type = call %B.as.X.impl.F.bound(%.loc8_8.3, %.loc8_23.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1029,16 +1030,17 @@ impl () as I({}) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %U.as_type.loc10_26.1 [symbolic = %require_complete (constants.%require_complete.d83f06.1)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%U.loc10_9.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.3)] -// CHECK:STDOUT: %.loc10_43: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc10_9.1 [symbolic = %.loc10_43 (constants.%.c29330.2)] +// CHECK:STDOUT: %.loc10_43.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc10_9.1 [symbolic = %.loc10_43.2 (constants.%.c29330.2)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %U.loc10_9.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c332.2)] -// CHECK:STDOUT: %impl.elem0.loc10_43.2: @empty_tuple.type.as.I.impl.F.loc10_34.1.%.loc10_43 (%.c29330.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_43.2 (constants.%impl.elem0.bd2456.2)] +// CHECK:STDOUT: %impl.elem0.loc10_43.2: @empty_tuple.type.as.I.impl.F.loc10_34.1.%.loc10_43.2 (%.c29330.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_43.2 (constants.%impl.elem0.bd2456.2)] // CHECK:STDOUT: %specific_impl_fn.loc10_43.2: = specific_impl_function %impl.elem0.loc10_43.2, @Copy.WithSelf.Op(%U.loc10_9.1) [symbolic = %specific_impl_fn.loc10_43.2 (constants.%specific_impl_fn.e2af7e.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @empty_tuple.type.as.I.impl.F.loc10_34.1.%U.as_type.loc10_26.1 (%U.as_type.c1c)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_34.1.%U.as_type.loc10_26.1 (%U.as_type.c1c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @empty_tuple.type.as.I.impl.F.loc10_34.1.%U.as_type.loc10_26.1 (%U.as_type.c1c) = name_ref x, %x -// CHECK:STDOUT: %impl.elem0.loc10_43.1: @empty_tuple.type.as.I.impl.F.loc10_34.1.%.loc10_43 (%.c29330.2) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c332.2, element0 [symbolic = %impl.elem0.loc10_43.2 (constants.%impl.elem0.bd2456.2)] +// CHECK:STDOUT: %impl.elem0.loc10_43.1: @empty_tuple.type.as.I.impl.F.loc10_34.1.%.loc10_43.2 (%.c29330.2) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c332.2, element0 [symbolic = %impl.elem0.loc10_43.2 (constants.%impl.elem0.bd2456.2)] // CHECK:STDOUT: %bound_method.loc10_43.1: = bound_method %x.ref, %impl.elem0.loc10_43.1 +// CHECK:STDOUT: %.loc10_43.1: %Copy.type = converted constants.%U.as_type.c1c, constants.%U.f84 [symbolic = %U.loc10_9.1 (constants.%U.f84)] // CHECK:STDOUT: %specific_impl_fn.loc10_43.1: = specific_impl_function %impl.elem0.loc10_43.1, @Copy.WithSelf.Op(constants.%U.f84) [symbolic = %specific_impl_fn.loc10_43.2 (constants.%specific_impl_fn.e2af7e.2)] // CHECK:STDOUT: %bound_method.loc10_43.2: = bound_method %x.ref, %specific_impl_fn.loc10_43.1 // CHECK:STDOUT: %.loc10_32.1: ref @empty_tuple.type.as.I.impl.F.loc10_34.1.%U.as_type.loc10_26.1 (%U.as_type.c1c) = splice_block %return.param {} @@ -1091,7 +1093,7 @@ impl () as I({}) { // 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: %.loc10_43 => constants.%.be5 +// CHECK:STDOUT: %.loc10_43.2 => constants.%.be5 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.1da // CHECK:STDOUT: %impl.elem0.loc10_43.2 => constants.%impl.elem0.484 // CHECK:STDOUT: %specific_impl_fn.loc10_43.2 => constants.%specific_impl_fn.a76 @@ -1106,10 +1108,10 @@ impl () as I({}) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness @empty_tuple.type.as.I.impl.%I.impl_witness_table [concrete] -// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %pattern_type.e81: type = pattern_type %Copy.type [concrete] // CHECK:STDOUT: %U.f84: %Copy.type = symbolic_binding U, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %U.as_type.c1c: type = facet_access_type %U.f84 [symbolic] // CHECK:STDOUT: %pattern_type.2c66b4.2: type = pattern_type %U.as_type.c1c [symbolic] // CHECK:STDOUT: %.1ce700.2: Core.Form = init_form %U.as_type.c1c [symbolic] @@ -1150,33 +1152,33 @@ impl () as I({}) { // 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_51.1: %empty_tuple.type.as.I.impl.F.type.48cdab.1 = fn_decl @empty_tuple.type.as.I.impl.F.loc10_51.1 [concrete = constants.%empty_tuple.type.as.I.impl.F.bd5be1.1] { +// CHECK:STDOUT: %U.patt: %pattern_type.e81 = symbolic_binding_pattern U, 0 [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.cb1 = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %U.patt: %pattern_type.e81 = symbolic_binding_pattern U, 0 [concrete] // CHECK:STDOUT: %x.param_patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.2c66b4.2) = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.2c66b4.2) = at_binding_pattern x, %x.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.2c66b4.2) = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt: @empty_tuple.type.as.I.impl.F.loc10_51.1.%pattern_type (%pattern_type.2c66b4.2) = return_slot_pattern %return.param_patt, %.loc10_49.3 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.ref.loc10_49: %Copy.type = name_ref U, %U.loc10_26.2 [symbolic = %U.loc10_26.1 (constants.%U.f84)] +// CHECK:STDOUT: %U.ref.loc10_49: %Copy.type = name_ref U, %U.loc10_9.2 [symbolic = %U.loc10_9.1 (constants.%U.f84)] // CHECK:STDOUT: %U.as_type.loc10_49: type = facet_access_type %U.ref.loc10_49 [symbolic = %U.as_type.loc10_43.1 (constants.%U.as_type.c1c)] // CHECK:STDOUT: %.loc10_49.3: type = converted %U.ref.loc10_49, %U.as_type.loc10_49 [symbolic = %U.as_type.loc10_43.1 (constants.%U.as_type.c1c)] // CHECK:STDOUT: %.loc10_49.4: Core.Form = init_form %.loc10_49.3 [symbolic = %.loc10_49.2 (constants.%.1ce700.2)] -// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 -// 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_33: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { +// CHECK:STDOUT: %.loc10_16: type = splice_block %Copy.ref [concrete = constants.%Copy.type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref: = 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_26.2: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_26.1 (constants.%U.f84)] +// CHECK:STDOUT: %U.loc10_9.2: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_9.1 (constants.%U.f84)] +// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 +// CHECK:STDOUT: %.loc10_37.1: type = splice_block %.loc10_37.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc10_37.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc10_37.3: type = converted %.loc10_37.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: %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.as_type.loc10_43.1 (%U.as_type.c1c) = value_param call_param1 // CHECK:STDOUT: %.loc10_43.1: type = splice_block %.loc10_43.2 [symbolic = %U.as_type.loc10_43.1 (constants.%U.as_type.c1c)] { -// CHECK:STDOUT: %U.ref.loc10_43: %Copy.type = name_ref U, %U.loc10_26.2 [symbolic = %U.loc10_26.1 (constants.%U.f84)] +// CHECK:STDOUT: %U.ref.loc10_43: %Copy.type = name_ref U, %U.loc10_9.2 [symbolic = %U.loc10_9.1 (constants.%U.f84)] // CHECK:STDOUT: %U.as_type.loc10_43.2: type = facet_access_type %U.ref.loc10_43 [symbolic = %U.as_type.loc10_43.1 (constants.%U.as_type.c1c)] // CHECK:STDOUT: %.loc10_43.2: type = converted %U.ref.loc10_43, %U.as_type.loc10_43.2 [symbolic = %U.as_type.loc10_43.1 (constants.%U.as_type.c1c)] // CHECK:STDOUT: } @@ -1198,25 +1200,26 @@ impl () as I({}) { // CHECK:STDOUT: witness = %I.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_51.1(%U.loc10_26.2: %Copy.type) { -// CHECK:STDOUT: %U.loc10_26.1: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_26.1 (constants.%U.f84)] -// CHECK:STDOUT: %U.as_type.loc10_43.1: type = facet_access_type %U.loc10_26.1 [symbolic = %U.as_type.loc10_43.1 (constants.%U.as_type.c1c)] +// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_51.1(%U.loc10_9.2: %Copy.type) { +// CHECK:STDOUT: %U.loc10_9.1: %Copy.type = symbolic_binding U, 0 [symbolic = %U.loc10_9.1 (constants.%U.f84)] +// CHECK:STDOUT: %U.as_type.loc10_43.1: type = facet_access_type %U.loc10_9.1 [symbolic = %U.as_type.loc10_43.1 (constants.%U.as_type.c1c)] // CHECK:STDOUT: %pattern_type: type = pattern_type %U.as_type.loc10_43.1 [symbolic = %pattern_type (constants.%pattern_type.2c66b4.2)] // CHECK:STDOUT: %.loc10_49.2: Core.Form = init_form %U.as_type.loc10_43.1 [symbolic = %.loc10_49.2 (constants.%.1ce700.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %U.as_type.loc10_43.1 [symbolic = %require_complete (constants.%require_complete.d83f06.1)] -// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%U.loc10_26.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.3)] -// CHECK:STDOUT: %.loc10_60: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc10_26.1 [symbolic = %.loc10_60 (constants.%.c29330.2)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %U.loc10_26.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c332.2)] -// CHECK:STDOUT: %impl.elem0.loc10_60.2: @empty_tuple.type.as.I.impl.F.loc10_51.1.%.loc10_60 (%.c29330.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.bd2456.2)] -// CHECK:STDOUT: %specific_impl_fn.loc10_60.2: = specific_impl_function %impl.elem0.loc10_60.2, @Copy.WithSelf.Op(%U.loc10_26.1) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.e2af7e.2)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%U.loc10_9.1) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.c85f21.3)] +// CHECK:STDOUT: %.loc10_60.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %U.loc10_9.1 [symbolic = %.loc10_60.2 (constants.%.c29330.2)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %U.loc10_9.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d9c332.2)] +// CHECK:STDOUT: %impl.elem0.loc10_60.2: @empty_tuple.type.as.I.impl.F.loc10_51.1.%.loc10_60.2 (%.c29330.2) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.bd2456.2)] +// CHECK:STDOUT: %specific_impl_fn.loc10_60.2: = specific_impl_function %impl.elem0.loc10_60.2, @Copy.WithSelf.Op(%U.loc10_9.1) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.e2af7e.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: %empty_tuple.type, %x.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.as_type.loc10_43.1 (%U.as_type.c1c)) -> out %return.param: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.as_type.loc10_43.1 (%U.as_type.c1c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @empty_tuple.type.as.I.impl.F.loc10_51.1.%U.as_type.loc10_43.1 (%U.as_type.c1c) = name_ref x, %x -// CHECK:STDOUT: %impl.elem0.loc10_60.1: @empty_tuple.type.as.I.impl.F.loc10_51.1.%.loc10_60 (%.c29330.2) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c332.2, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.bd2456.2)] +// CHECK:STDOUT: %impl.elem0.loc10_60.1: @empty_tuple.type.as.I.impl.F.loc10_51.1.%.loc10_60.2 (%.c29330.2) = impl_witness_access constants.%Copy.lookup_impl_witness.d9c332.2, element0 [symbolic = %impl.elem0.loc10_60.2 (constants.%impl.elem0.bd2456.2)] // CHECK:STDOUT: %bound_method.loc10_60.1: = bound_method %x.ref, %impl.elem0.loc10_60.1 +// CHECK:STDOUT: %.loc10_60.1: %Copy.type = converted constants.%U.as_type.c1c, constants.%U.f84 [symbolic = %U.loc10_9.1 (constants.%U.f84)] // CHECK:STDOUT: %specific_impl_fn.loc10_60.1: = specific_impl_function %impl.elem0.loc10_60.1, @Copy.WithSelf.Op(constants.%U.f84) [symbolic = %specific_impl_fn.loc10_60.2 (constants.%specific_impl_fn.e2af7e.2)] // CHECK:STDOUT: %bound_method.loc10_60.2: = 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.as_type.loc10_43.1 (%U.as_type.c1c) = splice_block %return.param {} @@ -1225,12 +1228,12 @@ impl () as I({}) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_51.2(%T.loc5_21.2: type) { +// CHECK:STDOUT: generic fn @empty_tuple.type.as.I.impl.F.loc10_51.2(%T.loc5_9.2: type) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %.loc10_51.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_21.1) [symbolic = %.loc10_51.2 (constants.%.0e9)] +// CHECK:STDOUT: %.loc10_51.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc5_9.1) [symbolic = %.loc10_51.2 (constants.%.0e9)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] // CHECK:STDOUT: %Copy.facet.loc10_51.2: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_51.2 (constants.%Copy.facet)] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2: = specific_function constants.%empty_tuple.type.as.I.impl.F.bd5be1.1, @empty_tuple.type.as.I.impl.F.loc10_51.1(%Copy.facet.loc10_51.2) [symbolic = %empty_tuple.type.as.I.impl.F.specific_fn.loc10_51.2 (constants.%empty_tuple.type.as.I.impl.F.specific_fn)] @@ -1249,21 +1252,21 @@ impl () as I({}) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.1(constants.%U.f84) { -// CHECK:STDOUT: %U.loc10_26.1 => constants.%U.f84 +// CHECK:STDOUT: %U.loc10_9.1 => constants.%U.f84 // CHECK:STDOUT: %U.as_type.loc10_43.1 => constants.%U.as_type.c1c // CHECK:STDOUT: %pattern_type => constants.%pattern_type.2c66b4.2 // CHECK:STDOUT: %.loc10_49.2 => constants.%.1ce700.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.2(constants.%T.67d) { -// CHECK:STDOUT: %T.loc5_21.1 => constants.%T.67d +// CHECK:STDOUT: %T.loc5_9.1 => constants.%T.67d // CHECK:STDOUT: %ptr => constants.%ptr.e8f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4 // CHECK:STDOUT: %.loc5 => constants.%.cb6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_tuple.type.as.I.impl.F.loc10_51.1(constants.%Copy.facet) { -// CHECK:STDOUT: %U.loc10_26.1 => constants.%Copy.facet +// CHECK:STDOUT: %U.loc10_9.1 => constants.%Copy.facet // CHECK:STDOUT: %U.as_type.loc10_43.1 => constants.%ptr.e8f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4 // CHECK:STDOUT: %.loc10_49.2 => constants.%.cb6 @@ -1271,7 +1274,7 @@ impl () as I({}) { // 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: %.loc10_60 => constants.%.be5 +// CHECK:STDOUT: %.loc10_60.2 => constants.%.be5 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.1da // CHECK:STDOUT: %impl.elem0.loc10_60.2 => constants.%impl.elem0.484 // CHECK:STDOUT: %specific_impl_fn.loc10_60.2 => constants.%specific_impl_fn.a76 diff --git a/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon b/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon index 1fcf1cbf04b7..0cf73a5d17b7 100644 --- a/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon +++ b/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon @@ -31,12 +31,12 @@ class A { } impl ConvertsToB as Core.ImplicitAs(B) { - fn Convert[unused self: Self]() -> B { return {}; } + fn Convert(unused self) -> B { return {}; } } } impl ConvertsToA as Core.ImplicitAs(A) { - fn Convert[unused self: Self]() -> A { return {}; } + fn Convert(unused self) -> A { return {}; } } } @@ -47,23 +47,23 @@ library "[[@TEST_NAME]]"; class Wrap(T:! type) {} interface OpWith(U:! type) { - fn Op[self: Self](u: U); + fn Op(self, u: U); } impl forall [T:! type, U:! Core.ImplicitAs(Wrap(T))] Wrap(T) as OpWith(U) { // CHECK:STDERR: fail_todo_out_of_line_thunk.carbon:[[@LINE+7]]:3: error: use of undefined generic function [MissingGenericFunctionDefinition] - // CHECK:STDERR: fn Op[self: Self](other: Self); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Op(self, other: Self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_out_of_line_thunk.carbon:[[@LINE+4]]:3: note: generic function declared here [MissingGenericFunctionDefinitionHere] - // CHECK:STDERR: fn Op[self: Self](other: Self); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Op(self, other: Self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - fn Op[self: Self](other: Self); + fn Op(self, other: Self); } // TODO: Once we support the syntax for defining impl members out of line, // define the above function here. -// fn (forall [T:! type, U:! Core.ImplicitAs(Wrap(T))] Wrap(T) as OpWith(U)).Op[self: Self](other: Self) {} +// fn (forall [T:! type, U:! Core.ImplicitAs(Wrap(T))] Wrap(T) as OpWith(U)).Op(self, other: Self) {} // --- builtin_thunk.carbon @@ -72,11 +72,11 @@ library "[[@TEST_NAME]]"; class Wrap(T:! type) {} interface OpWith(U:! type) { - fn Op[self: Self](u: U); + fn Op(self, u: U); } impl forall [T:! type, U:! Core.ImplicitAs(Wrap(T))] Wrap(T) as OpWith(U) { - fn Op[self: Self](other: Self) = "no_op"; + fn Op(self, other: Self) = "no_op"; } // --- thunk_literal_convert.carbon diff --git a/toolchain/check/testdata/impl/import_builtin_call.carbon b/toolchain/check/testdata/impl/import_builtin_call.carbon index 063a9fe5c29b..2649891cf0b8 100644 --- a/toolchain/check/testdata/impl/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/import_builtin_call.carbon @@ -24,7 +24,7 @@ library "[[@TEST_NAME]]"; import library "int_literal"; interface Add { - fn Op[self: Self](other: Self) -> Self; + fn Op(self, other: Self) -> Self; } fn Int(n: IntLiteral) -> type = "int.make_type_signed"; @@ -34,7 +34,7 @@ class MyInt(N:! IntLiteral) { } impl forall [N:! IntLiteral] MyInt(N) as Add { - fn Op[self: Self](other: Self) -> Self = "int.sadd"; + fn Op(self, other: Self) -> Self = "int.sadd"; } fn Double[N:! IntLiteral](x: MyInt(N)) -> MyInt(N) { @@ -67,10 +67,10 @@ fn Make(N:! Int(32)) -> Int(ToLiteral(N)) { return Make(N); } class OtherInt { adapt Int(32); - fn ToLiteral[self: Self]() -> IntLiteral; + fn ToLiteral(self) -> IntLiteral; }; -fn OtherInt.ToLiteral[self: Self]() -> IntLiteral = "int.convert_checked"; +fn OtherInt.ToLiteral(self) -> IntLiteral = "int.convert_checked"; fn MakeFromClass(N:! OtherInt) -> Int(N.ToLiteral()) { return MakeFromClass(N); } @@ -85,6 +85,7 @@ var m: Int(64) = Make(FromLiteral(64)); var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); //@dump-sem-ir-end + // CHECK:STDOUT: --- use_generic_impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/impl/import_canonical_witnesses.carbon b/toolchain/check/testdata/impl/import_canonical_witnesses.carbon index a99273f0d45f..1b7d3acdb267 100644 --- a/toolchain/check/testdata/impl/import_canonical_witnesses.carbon +++ b/toolchain/check/testdata/impl/import_canonical_witnesses.carbon @@ -36,11 +36,11 @@ library "[[@TEST_NAME]]"; // An interface with a trivial function and blanket impl for pointers. interface SimpleOp { - fn Op[self: Self](); + fn Op(self); } impl forall [T:! type] T as SimpleOp { - fn Op[unused self: Self]() {} + fn Op(unused 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[unused self: Self](value:! T) { + fn UseSimpleOp(unused self, value:! T) { value.(SimpleOp.Op)(); } } @@ -58,13 +58,13 @@ class InterfaceWrap(T:! SimpleOp & Empty) { // particularly use an associated constant. interface CombinedFacet { let T:! SimpleOp & Empty; - fn GetInterfaceWrap[self: Self]() -> InterfaceWrap(T); + fn GetInterfaceWrap(self) -> InterfaceWrap(T); } // A wrapper providing `CombinedFacet`. class TypeWrap(T:! type) { impl as CombinedFacet where .T = T { - fn GetInterfaceWrap[unused self: Self]() -> InterfaceWrap(T) { + fn GetInterfaceWrap(unused self) -> InterfaceWrap(T) { return {}; } } diff --git a/toolchain/check/testdata/impl/import_compound.carbon b/toolchain/check/testdata/impl/import_compound.carbon index 5dd835771af6..8dc7090715c0 100644 --- a/toolchain/check/testdata/impl/import_compound.carbon +++ b/toolchain/check/testdata/impl/import_compound.carbon @@ -24,11 +24,11 @@ impl {.i: ()} as NonInstance { } interface Instance { - fn G[self: Self](); + fn G(self); } impl {.i: ()} as Instance { - fn G[unused self: Self]() {} + fn G(unused self) {} } // --- import_non-instance_success.carbon @@ -98,6 +98,7 @@ fn InstanceCallImportFail() { {.i: ()}.(Instance.G)(); } + // CHECK:STDOUT: --- lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -188,13 +189,13 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: %self.param_patt: @Instance.WithSelf.G.%pattern_type (%pattern_type.362) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Instance.WithSelf.G.%pattern_type (%pattern_type.362) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Instance.WithSelf.G.%Self.as_type.loc12_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc12_14.1: type = splice_block %.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @Instance.WithSelf.G.%Self.as_type.loc12_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc12_8.1: type = splice_block %.loc12_8.2 [symbolic = %Self.as_type.loc12_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %Instance.type = name_ref Self, @Instance.%Self [symbolic = %Self (constants.%Self.bb5)] -// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc12_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc12_8.2: type = converted %Self.ref, %Self.as_type.loc12_8.2 [symbolic = %Self.as_type.loc12_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Instance.WithSelf.G.%Self.as_type.loc12_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Instance.WithSelf.G.%Self.as_type.loc12_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %Instance.assoc_type = assoc_entity element0, %Instance.WithSelf.G.decl [concrete = constants.%assoc0.94f] // CHECK:STDOUT: @@ -246,10 +247,10 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Instance.WithSelf.G(@Instance.%Self: %Instance.type) { // CHECK:STDOUT: %Self: %Instance.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.bb5)] -// CHECK:STDOUT: %Self.as_type.loc12_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc12_14.1 [symbolic = %pattern_type (constants.%pattern_type.362)] +// CHECK:STDOUT: %Self.as_type.loc12_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc12_8.1 [symbolic = %pattern_type (constants.%pattern_type.362)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Instance.WithSelf.G.%Self.as_type.loc12_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @Instance.WithSelf.G.%Self.as_type.loc12_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @struct_type.i.as.Instance.impl.G(%self.param: %struct_type.i) { @@ -284,7 +285,7 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Instance.WithSelf.G(constants.%Self.bb5) { // CHECK:STDOUT: %Self => constants.%Self.bb5 -// CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc12_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.362 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -297,7 +298,7 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Instance.WithSelf.G(constants.%Instance.facet) { // CHECK:STDOUT: %Self => constants.%Instance.facet -// CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%struct_type.i +// CHECK:STDOUT: %Self.as_type.loc12_8.1 => constants.%struct_type.i // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9b2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -624,15 +625,15 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.756: %Instance.assoc_type = import_ref Main//lib, loc12_21, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Main.import_ref.756: %Instance.assoc_type = import_ref Main//lib, loc12_13, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %Main.G = import_ref Main//lib, G, unloaded // CHECK:STDOUT: %Main.import_ref.a85b8b.2: %Instance.type = import_ref Main//lib, loc11_20, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %Main.import_ref.2cd = import_ref Main//lib, loc11_20, unloaded -// CHECK:STDOUT: %Main.import_ref.b3c: @Instance.WithSelf.%Instance.WithSelf.G.type (%Instance.WithSelf.G.type.8ba) = import_ref Main//lib, loc12_21, loaded [symbolic = @Instance.WithSelf.%Instance.WithSelf.G (constants.%Instance.WithSelf.G.114)] +// CHECK:STDOUT: %Main.import_ref.b3c: @Instance.WithSelf.%Instance.WithSelf.G.type (%Instance.WithSelf.G.type.8ba) = import_ref Main//lib, loc12_13, loaded [symbolic = @Instance.WithSelf.%Instance.WithSelf.G (constants.%Instance.WithSelf.G.114)] // CHECK:STDOUT: %Main.import_ref.b09: = 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.fd3: type = import_ref Main//lib, loc15_18, loaded [concrete = constants.%Instance.type] -// CHECK:STDOUT: %Main.import_ref.7e2: %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: %Main.import_ref.7e2: %struct_type.i.as.Instance.impl.G.type = import_ref Main//lib, loc16_21, loaded [concrete = constants.%struct_type.i.as.Instance.impl.G] // CHECK:STDOUT: %Instance.impl_witness_table = impl_witness_table (%Main.import_ref.7e2), @struct_type.i.as.Instance.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -770,11 +771,11 @@ fn InstanceCallImportFail() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.756: %Instance.assoc_type = import_ref Main//lib, loc12_21, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Main.import_ref.756: %Instance.assoc_type = import_ref Main//lib, loc12_13, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %Main.G = import_ref Main//lib, G, unloaded // CHECK:STDOUT: %Main.import_ref.a85b8b.2: %Instance.type = import_ref Main//lib, loc11_20, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %Main.import_ref.2cd = import_ref Main//lib, loc11_20, unloaded -// CHECK:STDOUT: %Main.import_ref.b3c: @Instance.WithSelf.%Instance.WithSelf.G.type (%Instance.WithSelf.G.type) = import_ref Main//lib, loc12_21, loaded [symbolic = @Instance.WithSelf.%Instance.WithSelf.G (constants.%Instance.WithSelf.G)] +// CHECK:STDOUT: %Main.import_ref.b3c: @Instance.WithSelf.%Instance.WithSelf.G.type (%Instance.WithSelf.G.type) = import_ref Main//lib, loc12_13, loaded [symbolic = @Instance.WithSelf.%Instance.WithSelf.G (constants.%Instance.WithSelf.G)] // CHECK:STDOUT: %Main.import_ref.e22 = import_ref Main//lib, loc15_27, unloaded // CHECK:STDOUT: %Main.import_ref.c9a: type = import_ref Main//lib, loc15_13, loaded [concrete = constants.%struct_type.i] // CHECK:STDOUT: %Main.import_ref.fd3: type = import_ref Main//lib, loc15_18, loaded [concrete = constants.%Instance.type] diff --git a/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon b/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon index 2cca3e8e531e..82982dfddcfb 100644 --- a/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon +++ b/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon @@ -22,11 +22,11 @@ impl {.i: ()} as Undeclared { } interface Instance { - fn G[self: Self](); + fn G(self); } impl {.i: ()} as Instance { - fn G[unused self: Self]() {} + fn G(unused self) {} } // --- import_instance_success.carbon diff --git a/toolchain/check/testdata/impl/import_self.carbon b/toolchain/check/testdata/impl/import_self.carbon index 5825f2a3a9a9..5b7ad6895f49 100644 --- a/toolchain/check/testdata/impl/import_self.carbon +++ b/toolchain/check/testdata/impl/import_self.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; interface Add { - fn Op[self: Self](other: Self) -> Self; + fn Op(self, other: Self) -> Self; } // --- b.carbon @@ -29,13 +29,14 @@ import library "a"; class C { adapt (); } impl C as Add { - fn Op[unused self: Self](unused other: Self) -> Self { return () as C; } + fn Op(unused self, unused other: Self) -> Self { return () as C; } } fn F(x: C, y: C) -> C { return x.(Add.Op)(y); } + // CHECK:STDOUT: --- a.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -77,28 +78,28 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: %other.param_patt: @Add.WithSelf.Op.%pattern_type (%pattern_type) = value_param_pattern [concrete] // CHECK:STDOUT: %other.patt: @Add.WithSelf.Op.%pattern_type (%pattern_type) = at_binding_pattern other, %other.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: @Add.WithSelf.Op.%pattern_type (%pattern_type) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Add.WithSelf.Op.%pattern_type (%pattern_type) = return_slot_pattern %return.param_patt, %.loc5_37.2 [concrete] +// CHECK:STDOUT: %return.patt: @Add.WithSelf.Op.%pattern_type (%pattern_type) = return_slot_pattern %return.param_patt, %.loc5_31.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc5_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_37: type = facet_access_type %Self.ref.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_37.2: type = converted %Self.ref.loc5_37, %Self.as_type.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_37.3: Core.Form = init_form %.loc5_37.2 [symbolic = %.loc5_37.1 (constants.%.3bf)] -// CHECK:STDOUT: %self.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref.loc5_15 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref.loc5_15, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.ref.loc5_31: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_31: type = facet_access_type %Self.ref.loc5_31 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_31.2: type = converted %Self.ref.loc5_31, %Self.as_type.loc5_31 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_31.3: Core.Form = init_form %.loc5_31.2 [symbolic = %.loc5_31.1 (constants.%.3bf)] +// CHECK:STDOUT: %self.param: @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_9.1: type = splice_block %.loc5_9.2 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_9: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_9.2: type = facet_access_type %Self.ref.loc5_9 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_9.2: type = converted %Self.ref.loc5_9, %Self.as_type.loc5_9.2 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_binding self, %self.param -// CHECK:STDOUT: %other.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param1 -// CHECK:STDOUT: %.loc5_28.1: type = splice_block %.loc5_28.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_28.2: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self: @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %other.param: @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type) = value_param call_param1 +// CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.2 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %Self.ref.loc5_22: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_22: type = facet_access_type %Self.ref.loc5_22 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_22.2: type = converted %Self.ref.loc5_22, %Self.as_type.loc5_22 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %other: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_binding other, %other.param -// CHECK:STDOUT: %return.param: ref @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param call_param2 -// CHECK:STDOUT: %return: ref @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot %return.param +// CHECK:STDOUT: %other: @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type) = value_binding other, %other.param +// CHECK:STDOUT: %return.param: ref @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type) = out_param call_param2 +// CHECK:STDOUT: %return: ref @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %Add.assoc_type = assoc_entity element0, %Add.WithSelf.Op.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -112,20 +113,20 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Add.WithSelf.Op(@Add.%Self: %Add.type) { // CHECK:STDOUT: %Self: %Add.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type (constants.%pattern_type)] -// CHECK:STDOUT: %.loc5_37.1: Core.Form = init_form %Self.as_type.loc5_15.1 [symbolic = %.loc5_37.1 (constants.%.3bf)] +// CHECK:STDOUT: %Self.as_type.loc5_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_9.1 [symbolic = %pattern_type (constants.%pattern_type)] +// CHECK:STDOUT: %.loc5_31.1: Core.Form = init_form %Self.as_type.loc5_9.1 [symbolic = %.loc5_31.1 (constants.%.3bf)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type), %other.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type)) -> out %return.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type); +// CHECK:STDOUT: fn(%self.param: @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type), %other.param: @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type)) -> out %return.param: @Add.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Add.WithSelf(constants.%Self) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Add.WithSelf.Op(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_9.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type -// CHECK:STDOUT: %.loc5_37.1 => constants.%.3bf +// CHECK:STDOUT: %.loc5_31.1 => constants.%.3bf // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon @@ -164,11 +165,11 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.d84: %Add.assoc_type = import_ref Main//a, loc5_41, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Main.import_ref.d84: %Add.assoc_type = import_ref Main//a, loc5_35, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %Main.Op: @Add.WithSelf.%Add.WithSelf.Op.type (%Add.WithSelf.Op.type.ee5) = import_ref Main//a, Op, loaded [symbolic = @Add.WithSelf.%Add.WithSelf.Op (constants.%Add.WithSelf.Op.39f)] // CHECK:STDOUT: %Main.import_ref.9e12ee.2: %Add.type = import_ref Main//a, loc4_15, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %Main.import_ref.6b4 = import_ref Main//a, loc4_15, unloaded -// CHECK:STDOUT: %Main.import_ref.f19: @Add.WithSelf.%Add.WithSelf.Op.type (%Add.WithSelf.Op.type.ee5) = import_ref Main//a, loc5_41, loaded [symbolic = @Add.WithSelf.%Add.WithSelf.Op (constants.%Add.WithSelf.Op.39f)] +// CHECK:STDOUT: %Main.import_ref.f19: @Add.WithSelf.%Add.WithSelf.Op.type (%Add.WithSelf.Op.type.ee5) = import_ref Main//a, loc5_35, loaded [symbolic = @Add.WithSelf.%Add.WithSelf.Op (constants.%Add.WithSelf.Op.39f)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -223,15 +224,15 @@ fn F(x: C, y: C) -> C { // CHECK:STDOUT: %other.param_patt: %pattern_type.98b = value_param_pattern [concrete] // CHECK:STDOUT: %other.patt: %pattern_type.98b = at_binding_pattern other, %other.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.98b = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %Self.ref.loc9_51 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %Self.ref.loc9_45 [concrete] // CHECK:STDOUT: } { -// 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 [concrete = constants.%.a44] +// CHECK:STDOUT: %Self.ref.loc9_45: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] +// CHECK:STDOUT: %.loc9_45: Core.Form = init_form %Self.ref.loc9_45 [concrete = constants.%.a44] // CHECK:STDOUT: %self.param: %C = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc9_22: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] +// CHECK:STDOUT: %Self.ref.loc9_16: 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_42: type = name_ref Self, @C.as.Add.impl.%C.ref [concrete = constants.%C] +// CHECK:STDOUT: %Self.ref.loc9_36: 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 @@ -268,16 +269,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_66: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple.af4] +// CHECK:STDOUT: %.loc9_60: %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_68.1: %C = as_compatible %empty_tuple [concrete = constants.%empty_tuple.4db] -// CHECK:STDOUT: %.loc9_68.2: %C = converted %.loc9_66, %.loc9_68.1 [concrete = constants.%empty_tuple.4db] -// 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.4db] -// CHECK:STDOUT: %.loc9_72.4: init %C = converted %.loc9_68.2, %.loc9_72.3 [concrete = constants.%empty_tuple.4db] -// CHECK:STDOUT: return %.loc9_72.4 +// CHECK:STDOUT: %.loc9_62.1: %C = as_compatible %empty_tuple [concrete = constants.%empty_tuple.4db] +// CHECK:STDOUT: %.loc9_62.2: %C = converted %.loc9_60, %.loc9_62.1 [concrete = constants.%empty_tuple.4db] +// CHECK:STDOUT: %.loc9_66.1: %empty_tuple.type = as_compatible %.loc9_62.2 [concrete = constants.%empty_tuple.af4] +// CHECK:STDOUT: %.loc9_66.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple.af4] +// CHECK:STDOUT: %.loc9_66.3: init %C = as_compatible %.loc9_66.2 [concrete = constants.%empty_tuple.4db] +// CHECK:STDOUT: %.loc9_66.4: init %C = converted %.loc9_62.2, %.loc9_66.3 [concrete = constants.%empty_tuple.4db] +// CHECK:STDOUT: return %.loc9_66.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%x.param: %C, %y.param: %C) -> out %return.param: %C { diff --git a/toolchain/check/testdata/impl/import_thunk.carbon b/toolchain/check/testdata/impl/import_thunk.carbon index 9e06aaa93f82..1d77ab1ee12a 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -41,6 +41,7 @@ fn G() { C(()).(I.F)({}); } + // CHECK:STDOUT: --- a.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -301,15 +302,15 @@ fn G() { // CHECK:STDOUT: %C: type = class_type @C, @C(%Y) [symbolic = %C (constants.%C.6b1ed7.2)] // CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = struct_value () [symbolic = %C.val (constants.%C.val)] -// CHECK:STDOUT: %.6: ref @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = temporary invalid, %C.val [symbolic = %.6 (constants.%.e66)] +// CHECK:STDOUT: %.7: ref @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = temporary invalid, %C.val [symbolic = %.7 (constants.%.e66)] // CHECK:STDOUT: %Destroy.lookup_impl_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.886)] -// 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.ba0)] -// CHECK:STDOUT: %.7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.7 (constants.%.854)] -// CHECK:STDOUT: %impl.elem0.2: @C.as.I.impl.F.loc8_24.2.%.7 (%.854) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.3: = bound_method %.6, %impl.elem0.2 [symbolic = %bound_method.3 (constants.%bound_method.3e7)] -// CHECK:STDOUT: %specific_impl_fn.2: = specific_impl_function %impl.elem0.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: %bound_method.4: = bound_method %.6, %specific_impl_fn.2 [symbolic = %bound_method.4 (constants.%bound_method.ef4)] +// CHECK:STDOUT: %Destroy.facet.2: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.2 (constants.%Destroy.facet.886)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.ba0)] +// CHECK:STDOUT: %.8: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.2 [symbolic = %.8 (constants.%.854)] +// CHECK:STDOUT: %impl.elem0.2: @C.as.I.impl.F.loc8_24.2.%.8 (%.854) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %bound_method.3: = bound_method %.7, %impl.elem0.2 [symbolic = %bound_method.3 (constants.%bound_method.3e7)] +// CHECK:STDOUT: %specific_impl_fn.2: = specific_impl_function %impl.elem0.2, @Destroy.WithSelf.Op(%Destroy.facet.2) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %bound_method.4: = bound_method %.7, %specific_impl_fn.2 [symbolic = %bound_method.4 (constants.%bound_method.ef4)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: %empty_struct_type) [thunk @C.as.I.impl.%C.as.I.impl.F.decl.loc8_24.1 for imports.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet)] { // CHECK:STDOUT: !entry: @@ -319,12 +320,14 @@ fn G() { // CHECK:STDOUT: %.1: ref @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = temporary_storage // CHECK:STDOUT: %.2: init @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) to %.1 = class_init () [symbolic = %C.val (constants.%C.val)] // CHECK:STDOUT: %.3: init @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = converted %x.param, %.2 [symbolic = %C.val (constants.%C.val)] -// CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = temporary %.1, %.3 [symbolic = %.6 (constants.%.e66)] +// CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = temporary %.1, %.3 [symbolic = %.7 (constants.%.e66)] // CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = acquire_value %.4 [symbolic = %C.val (constants.%C.val)] // 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.c64 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_24.2.%.7 (%.854) = 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.%.8 (%.854) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.1: = bound_method %.4, %impl.elem0.1 [symbolic = %bound_method.3 (constants.%bound_method.3e7)] +// CHECK:STDOUT: %Destroy.facet.1: %Destroy.type = facet_value constants.%C.6b1ed7.2, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.2 (constants.%Destroy.facet.886)] +// CHECK:STDOUT: %.6: %Destroy.type = converted constants.%C.6b1ed7.2, %Destroy.facet.1 [symbolic = %Destroy.facet.2 (constants.%Destroy.facet.886)] // CHECK:STDOUT: %specific_impl_fn.1: = specific_impl_function %impl.elem0.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.886) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.2: = bound_method %.4, %specific_impl_fn.1 [symbolic = %bound_method.4 (constants.%bound_method.ef4)] // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.2(%.4) diff --git a/toolchain/check/testdata/impl/interface_args.carbon b/toolchain/check/testdata/impl/interface_args.carbon index 7e1fa63a6745..3e12cdbca3e4 100644 --- a/toolchain/check/testdata/impl/interface_args.carbon +++ b/toolchain/check/testdata/impl/interface_args.carbon @@ -16,7 +16,7 @@ package Core; interface ImplicitAs(Dest:! type) { - fn Convert[self: Self]() -> Dest; + fn Convert(self) -> Dest; } // --- action.carbon @@ -24,7 +24,7 @@ interface ImplicitAs(Dest:! type) { library "[[@TEST_NAME]]"; interface Action(T:! type) { - fn Op[self: Self](); + fn Op(self); } class A {} @@ -32,7 +32,7 @@ class B {} class C {} impl A as Action(B) { - fn Op[unused self: Self]() {} + fn Op(unused self) {} } fn F(a: A) { a.(Action(B).Op)(); } @@ -61,7 +61,7 @@ interface Factory(T:! type) { // Non-instance class function fn Make() -> T; // Instance method - fn Method[self: Self]() -> T; + fn Method(self) -> T; } class A {} @@ -69,7 +69,7 @@ class B {} impl A as Factory(B) { fn Make() -> B; - fn Method[self: Self]() -> B; + fn Method(self) -> B; } // --- factory.impl.carbon @@ -107,6 +107,7 @@ fn InstanceC(a: A) -> C { return a.(Factory(C).Method)(); } + // CHECK:STDOUT: --- core.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -156,31 +157,31 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.decl: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type) = fn_decl @ImplicitAs.WithSelf.Convert [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert)] { -// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_18 (%pattern_type.701) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_18 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_31 (%pattern_type.51d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %Dest.ref [concrete] +// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.701) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_23 (%pattern_type.51d) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_23 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %Dest.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc3_26.2 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.loc4_31.2: Core.Form = init_form %Dest.ref [symbolic = %.loc4_31.1 (constants.%.184)] -// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_20.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.3 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc4_20.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc3_35.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc4_20.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc4_20.3: type = converted %Self.ref, %Self.as_type.loc4_20.2 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_23.2: Core.Form = init_form %Dest.ref [symbolic = %.loc4_23.1 (constants.%.184)] +// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_14.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc4_14.1: type = splice_block %.loc4_14.3 [symbolic = %Self.as_type.loc4_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc4_14.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc3_35.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc4_14.2 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc4_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_14.3: type = converted %Self.ref, %Self.as_type.loc4_14.2 [symbolic = %Self.as_type.loc4_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_20.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_14.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref @ImplicitAs.WithSelf.Convert.%Dest (%Dest) = out_param call_param1 // CHECK:STDOUT: %return: ref @ImplicitAs.WithSelf.Convert.%Dest (%Dest) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc4_35.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0)] +// CHECK:STDOUT: %assoc0.loc4_27.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc4_27.2 (constants.%assoc0)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc3_35.1 // CHECK:STDOUT: .Dest = // CHECK:STDOUT: .Dest = -// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc4_35.1 +// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc4_27.1 // CHECK:STDOUT: witness = (@ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: @@ -191,12 +192,12 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Dest: type = symbolic_binding Dest, 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [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)] -// CHECK:STDOUT: %Self.as_type.loc4_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type.loc4_18: type = pattern_type %Self.as_type.loc4_20.1 [symbolic = %pattern_type.loc4_18 (constants.%pattern_type.701)] -// CHECK:STDOUT: %.loc4_31.1: Core.Form = init_form %Dest [symbolic = %.loc4_31.1 (constants.%.184)] -// CHECK:STDOUT: %pattern_type.loc4_31: type = pattern_type %Dest [symbolic = %pattern_type.loc4_31 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %Self.as_type.loc4_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type.loc4_14: type = pattern_type %Self.as_type.loc4_14.1 [symbolic = %pattern_type.loc4_14 (constants.%pattern_type.701)] +// CHECK:STDOUT: %.loc4_23.1: Core.Form = init_form %Dest [symbolic = %.loc4_23.1 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc4_23: type = pattern_type %Dest [symbolic = %pattern_type.loc4_23 (constants.%pattern_type.51d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_20.1 (%Self.as_type)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%Dest (%Dest); +// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc4_14.1 (%Self.as_type)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { @@ -209,10 +210,10 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3aa // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc4_20.1 => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type.loc4_18 => constants.%pattern_type.701 -// CHECK:STDOUT: %.loc4_31.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc4_31 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc4_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %pattern_type.loc4_14 => constants.%pattern_type.701 +// CHECK:STDOUT: %.loc4_23.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc4_23 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- action.carbon @@ -317,20 +318,20 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %self.param_patt: @Action.WithSelf.Op.%pattern_type (%pattern_type.085) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Action.WithSelf.Op.%pattern_type (%pattern_type.085) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Action.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc5_15.2: @Action.WithSelf.Op.%Action.type (%Action.type.cbf) = specific_constant @Action.%Self.loc4_28.1, @Action(constants.%T) [symbolic = %Self (constants.%Self.67c)] -// CHECK:STDOUT: %Self.ref: @Action.WithSelf.Op.%Action.type (%Action.type.cbf) = name_ref Self, %.loc5_15.2 [symbolic = %Self (constants.%Self.67c)] -// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_15.3: type = converted %Self.ref, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @Action.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_9.1: type = splice_block %.loc5_9.3 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc5_9.2: @Action.WithSelf.Op.%Action.type (%Action.type.cbf) = specific_constant @Action.%Self.loc4_28.1, @Action(constants.%T) [symbolic = %Self (constants.%Self.67c)] +// CHECK:STDOUT: %Self.ref: @Action.WithSelf.Op.%Action.type (%Action.type.cbf) = name_ref Self, %.loc5_9.2 [symbolic = %Self (constants.%Self.67c)] +// CHECK:STDOUT: %Self.as_type.loc5_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_9.3: type = converted %Self.ref, %Self.as_type.loc5_9.2 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Action.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Action.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc5_22.1: @Action.WithSelf.%Action.assoc_type (%Action.assoc_type.1c3) = assoc_entity element0, %Action.WithSelf.Op.decl [symbolic = %assoc0.loc5_22.2 (constants.%assoc0.26f)] +// CHECK:STDOUT: %assoc0.loc5_14.1: @Action.WithSelf.%Action.assoc_type (%Action.assoc_type.1c3) = assoc_entity element0, %Action.WithSelf.Op.decl [symbolic = %assoc0.loc5_14.2 (constants.%assoc0.26f)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc4_28.1 -// CHECK:STDOUT: .Op = @Action.WithSelf.%assoc0.loc5_22.1 +// CHECK:STDOUT: .Op = @Action.WithSelf.%assoc0.loc5_14.1 // CHECK:STDOUT: witness = (@Action.WithSelf.%Action.WithSelf.Op.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: @@ -383,10 +384,10 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(%T)> [symbolic = %Action.type (constants.%Action.type.cbf)] // CHECK:STDOUT: %Self: @Action.WithSelf.Op.%Action.type (%Action.type.cbf) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.67c)] -// CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type (constants.%pattern_type.085)] +// CHECK:STDOUT: %Self.as_type.loc5_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_9.1 [symbolic = %pattern_type (constants.%pattern_type.085)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Action.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @Action.WithSelf.Op.%Self.as_type.loc5_9.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A.as.Action.impl.Op(%self.param: %A) { @@ -400,7 +401,7 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Action.ref: %Action.type.538 = name_ref Action, file.%Action.decl [concrete = constants.%Action.generic] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [concrete = constants.%Action.type.5d2] -// CHECK:STDOUT: %.loc16: %Action.assoc_type.4ce = specific_constant @Action.WithSelf.%assoc0.loc5_22.1, @Action.WithSelf(constants.%B, constants.%Self.67c) [concrete = constants.%assoc0.005] +// CHECK:STDOUT: %.loc16: %Action.assoc_type.4ce = specific_constant @Action.WithSelf.%assoc0.loc5_14.1, @Action.WithSelf(constants.%B, constants.%Self.67c) [concrete = constants.%assoc0.005] // CHECK:STDOUT: %Op.ref: %Action.assoc_type.4ce = name_ref Op, %.loc16 [concrete = constants.%assoc0.005] // CHECK:STDOUT: %impl.elem0: %.898 = impl_witness_access constants.%Action.impl_witness, element0 [concrete = constants.%A.as.Action.impl.Op] // CHECK:STDOUT: %bound_method: = bound_method %a.ref, %impl.elem0 @@ -418,7 +419,7 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Action.type => constants.%Action.type.cbf // CHECK:STDOUT: %Self => constants.%Self.67c -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_9.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.085 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -438,7 +439,7 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Action.WithSelf.Op.type => constants.%Action.WithSelf.Op.type.cd3 // CHECK:STDOUT: %Action.WithSelf.Op => constants.%Action.WithSelf.Op.d98 // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.4ce -// CHECK:STDOUT: %assoc0.loc5_22.2 => constants.%assoc0.005 +// CHECK:STDOUT: %assoc0.loc5_14.2 => constants.%assoc0.005 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action.WithSelf(constants.%B, constants.%Action.facet) { @@ -449,14 +450,14 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Action.WithSelf.Op.type => constants.%Action.WithSelf.Op.type.e59 // CHECK:STDOUT: %Action.WithSelf.Op => constants.%Action.WithSelf.Op.c3b // CHECK:STDOUT: %Action.assoc_type => constants.%Action.assoc_type.4ce -// CHECK:STDOUT: %assoc0.loc5_22.2 => constants.%assoc0.005 +// CHECK:STDOUT: %assoc0.loc5_14.2 => constants.%assoc0.005 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action.WithSelf.Op(constants.%B, constants.%Action.facet) { // CHECK:STDOUT: %T => constants.%B // CHECK:STDOUT: %Action.type => constants.%Action.type.5d2 // CHECK:STDOUT: %Self => constants.%Action.facet -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%A +// CHECK:STDOUT: %Self.as_type.loc5_9.1 => constants.%A // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9ef // CHECK:STDOUT: } // CHECK:STDOUT: @@ -509,9 +510,9 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//action, loc9_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.7b8 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.00f: @Action.WithSelf.%Action.assoc_type (%Action.assoc_type.1c3) = import_ref Main//action, loc5_22, loaded [symbolic = @Action.WithSelf.%assoc0 (constants.%assoc0.029)] +// CHECK:STDOUT: %Main.import_ref.00f: @Action.WithSelf.%Action.assoc_type (%Action.assoc_type.1c3) = import_ref Main//action, loc5_14, loaded [symbolic = @Action.WithSelf.%assoc0 (constants.%assoc0.029)] // CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded -// CHECK:STDOUT: %Main.import_ref.c56: @Action.WithSelf.%Action.WithSelf.Op.type (%Action.WithSelf.Op.type.a98) = import_ref Main//action, loc5_22, loaded [symbolic = @Action.WithSelf.%Action.WithSelf.Op (constants.%Action.WithSelf.Op.876)] +// CHECK:STDOUT: %Main.import_ref.c56: @Action.WithSelf.%Action.WithSelf.Op.type (%Action.WithSelf.Op.type.a98) = import_ref Main//action, loc5_14, loaded [symbolic = @Action.WithSelf.%Action.WithSelf.Op (constants.%Action.WithSelf.Op.876)] // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//action, loc4_19, loaded [symbolic = @Action.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.7dfc68.2: @Action.%Action.type (%Action.type.cbf) = import_ref Main//action, loc4_28, loaded [symbolic = @Action.%Self (constants.%Self.ea2)] // CHECK:STDOUT: %Main.import_ref.422 = import_ref Main//action, loc4_28, unloaded @@ -521,10 +522,10 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.0ee = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.239: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A] // CHECK:STDOUT: %Main.import_ref.4a4: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.5d2] -// CHECK:STDOUT: %Main.import_ref.294 = import_ref Main//action, loc13_30, unloaded +// CHECK:STDOUT: %Main.import_ref.294 = import_ref Main//action, loc13_22, unloaded // CHECK:STDOUT: %Main.import_ref.07b = import_ref Main//action, loc12_19, unloaded -// CHECK:STDOUT: %Main.import_ref.b3a = import_ref Main//action, loc5_22, unloaded -// CHECK:STDOUT: %Main.import_ref.b97: %A.as.Action.impl.Op.type = import_ref Main//action, loc13_30, loaded [concrete = constants.%A.as.Action.impl.Op] +// CHECK:STDOUT: %Main.import_ref.b3a = import_ref Main//action, loc5_14, unloaded +// CHECK:STDOUT: %Main.import_ref.b97: %A.as.Action.impl.Op.type = import_ref Main//action, loc13_22, loaded [concrete = constants.%A.as.Action.impl.Op] // CHECK:STDOUT: %Action.impl_witness_table = impl_witness_table (%Main.import_ref.b97), @A.as.Action.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -703,9 +704,9 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//action, loc9_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.7b8 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.00f: @Action.WithSelf.%Action.assoc_type (%Action.assoc_type.1c3) = import_ref Main//action, loc5_22, loaded [symbolic = @Action.WithSelf.%assoc0 (constants.%assoc0.029)] +// CHECK:STDOUT: %Main.import_ref.00f: @Action.WithSelf.%Action.assoc_type (%Action.assoc_type.1c3) = import_ref Main//action, loc5_14, loaded [symbolic = @Action.WithSelf.%assoc0 (constants.%assoc0.029)] // CHECK:STDOUT: %Main.Op = import_ref Main//action, Op, unloaded -// CHECK:STDOUT: %Main.import_ref.c56: @Action.WithSelf.%Action.WithSelf.Op.type (%Action.WithSelf.Op.type.a98) = import_ref Main//action, loc5_22, loaded [symbolic = @Action.WithSelf.%Action.WithSelf.Op (constants.%Action.WithSelf.Op.876)] +// CHECK:STDOUT: %Main.import_ref.c56: @Action.WithSelf.%Action.WithSelf.Op.type (%Action.WithSelf.Op.type.a98) = import_ref Main//action, loc5_14, loaded [symbolic = @Action.WithSelf.%Action.WithSelf.Op (constants.%Action.WithSelf.Op.876)] // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//action, loc4_19, loaded [symbolic = @Action.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.7dfc68.2: @Action.%Action.type (%Action.type.cbf) = import_ref Main//action, loc4_28, loaded [symbolic = @Action.%Self (constants.%Self.ea2)] // CHECK:STDOUT: %Main.import_ref.422 = import_ref Main//action, loc4_28, unloaded @@ -715,11 +716,11 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.0ee = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.239: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A] // CHECK:STDOUT: %Main.import_ref.4a4: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.5d2] -// CHECK:STDOUT: %Main.import_ref.294 = import_ref Main//action, loc13_30, unloaded +// CHECK:STDOUT: %Main.import_ref.294 = import_ref Main//action, loc13_22, unloaded // CHECK:STDOUT: %Main.import_ref.07b = import_ref Main//action, loc12_19, unloaded // CHECK:STDOUT: %Main.import_ref.8f24d3.3: = import_ref Main//action, loc10_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.e47 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.b3a = import_ref Main//action, loc5_22, unloaded +// CHECK:STDOUT: %Main.import_ref.b3a = import_ref Main//action, loc5_14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -959,32 +960,32 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0.loc6_17.1: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = assoc_entity element0, %Factory.WithSelf.Make.decl [symbolic = %assoc0.loc6_17.2 (constants.%assoc0.6f5)] // CHECK:STDOUT: %Factory.WithSelf.Method.decl: @Factory.WithSelf.%Factory.WithSelf.Method.type (%Factory.WithSelf.Method.type.63a) = fn_decl @Factory.WithSelf.Method [symbolic = @Factory.WithSelf.%Factory.WithSelf.Method (constants.%Factory.WithSelf.Method.097)] { -// CHECK:STDOUT: %self.param_patt: @Factory.WithSelf.Method.%pattern_type.loc8_17 (%pattern_type.5ba) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Factory.WithSelf.Method.%pattern_type.loc8_17 (%pattern_type.5ba) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Factory.WithSelf.Method.%pattern_type.loc8_30 (%pattern_type.51d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Factory.WithSelf.Method.%pattern_type.loc8_30 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] +// CHECK:STDOUT: %self.param_patt: @Factory.WithSelf.Method.%pattern_type.loc8_13 (%pattern_type.5ba) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @Factory.WithSelf.Method.%pattern_type.loc8_13 (%pattern_type.5ba) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @Factory.WithSelf.Method.%pattern_type.loc8_22 (%pattern_type.51d) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @Factory.WithSelf.Method.%pattern_type.loc8_22 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @Factory.%T.loc4_20.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc8_30.2: Core.Form = init_form %T.ref [symbolic = %.loc8_30.1 (constants.%.184)] -// CHECK:STDOUT: %self.param: @Factory.WithSelf.Method.%Self.as_type.loc8_19.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [symbolic = %Self.as_type.loc8_19.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc8_19.2: @Factory.WithSelf.Method.%Factory.type (%Factory.type.711) = specific_constant @Factory.%Self.loc4_29.1, @Factory(constants.%T) [symbolic = %Self (constants.%Self.9c2)] -// CHECK:STDOUT: %Self.ref: @Factory.WithSelf.Method.%Factory.type (%Factory.type.711) = name_ref Self, %.loc8_19.2 [symbolic = %Self (constants.%Self.9c2)] -// CHECK:STDOUT: %Self.as_type.loc8_19.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_19.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc8_19.3: type = converted %Self.ref, %Self.as_type.loc8_19.2 [symbolic = %Self.as_type.loc8_19.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc8_22.2: Core.Form = init_form %T.ref [symbolic = %.loc8_22.1 (constants.%.184)] +// CHECK:STDOUT: %self.param: @Factory.WithSelf.Method.%Self.as_type.loc8_13.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc8_13.1: type = splice_block %.loc8_13.3 [symbolic = %Self.as_type.loc8_13.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc8_13.2: @Factory.WithSelf.Method.%Factory.type (%Factory.type.711) = specific_constant @Factory.%Self.loc4_29.1, @Factory(constants.%T) [symbolic = %Self (constants.%Self.9c2)] +// CHECK:STDOUT: %Self.ref: @Factory.WithSelf.Method.%Factory.type (%Factory.type.711) = name_ref Self, %.loc8_13.2 [symbolic = %Self (constants.%Self.9c2)] +// CHECK:STDOUT: %Self.as_type.loc8_13.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_13.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc8_13.3: type = converted %Self.ref, %Self.as_type.loc8_13.2 [symbolic = %Self.as_type.loc8_13.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Factory.WithSelf.Method.%Self.as_type.loc8_19.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Factory.WithSelf.Method.%Self.as_type.loc8_13.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref @Factory.WithSelf.Method.%T (%T) = out_param call_param1 // CHECK:STDOUT: %return: ref @Factory.WithSelf.Method.%T (%T) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc1.loc8_31.1: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = assoc_entity element1, %Factory.WithSelf.Method.decl [symbolic = %assoc1.loc8_31.2 (constants.%assoc1.b7b)] +// CHECK:STDOUT: %assoc1.loc8_23.1: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = assoc_entity element1, %Factory.WithSelf.Method.decl [symbolic = %assoc1.loc8_23.2 (constants.%assoc1.b7b)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc4_29.1 // CHECK:STDOUT: .T = // CHECK:STDOUT: .T = // CHECK:STDOUT: .Make = @Factory.WithSelf.%assoc0.loc6_17.1 -// CHECK:STDOUT: .Method = @Factory.WithSelf.%assoc1.loc8_31.1 +// CHECK:STDOUT: .Method = @Factory.WithSelf.%assoc1.loc8_23.1 // CHECK:STDOUT: .B = // CHECK:STDOUT: witness = (@Factory.WithSelf.%Factory.WithSelf.Make.decl, @Factory.WithSelf.%Factory.WithSelf.Method.decl) // CHECK:STDOUT: @@ -1055,12 +1056,12 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(%T)> [symbolic = %Factory.type (constants.%Factory.type.711)] // CHECK:STDOUT: %Self: @Factory.WithSelf.Method.%Factory.type (%Factory.type.711) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.9c2)] -// CHECK:STDOUT: %Self.as_type.loc8_19.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_19.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type.loc8_17: type = pattern_type %Self.as_type.loc8_19.1 [symbolic = %pattern_type.loc8_17 (constants.%pattern_type.5ba)] -// CHECK:STDOUT: %.loc8_30.1: Core.Form = init_form %T [symbolic = %.loc8_30.1 (constants.%.184)] -// CHECK:STDOUT: %pattern_type.loc8_30: type = pattern_type %T [symbolic = %pattern_type.loc8_30 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %Self.as_type.loc8_13.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_13.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type.loc8_13: type = pattern_type %Self.as_type.loc8_13.1 [symbolic = %pattern_type.loc8_13 (constants.%pattern_type.5ba)] +// CHECK:STDOUT: %.loc8_22.1: Core.Form = init_form %T [symbolic = %.loc8_22.1 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc8_22: type = pattern_type %T [symbolic = %pattern_type.loc8_22 (constants.%pattern_type.51d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Factory.WithSelf.Method.%Self.as_type.loc8_19.1 (%Self.as_type)) -> out %return.param: @Factory.WithSelf.Method.%T (%T); +// CHECK:STDOUT: fn(%self.param: @Factory.WithSelf.Method.%Self.as_type.loc8_13.1 (%Self.as_type)) -> out %return.param: @Factory.WithSelf.Method.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A.as.Factory.impl.Make() -> out %return.param: %B; @@ -1083,10 +1084,10 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %Factory.type => constants.%Factory.type.711 // CHECK:STDOUT: %Self => constants.%Self.9c2 -// CHECK:STDOUT: %Self.as_type.loc8_19.1 => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type.loc8_17 => constants.%pattern_type.5ba -// CHECK:STDOUT: %.loc8_30.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc8_30 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc8_13.1 => constants.%Self.as_type +// CHECK:STDOUT: %pattern_type.loc8_13 => constants.%pattern_type.5ba +// CHECK:STDOUT: %.loc8_22.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc8_22 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(constants.%B) { @@ -1108,7 +1109,7 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %assoc0.loc6_17.2 => constants.%assoc0.012 // CHECK:STDOUT: %Factory.WithSelf.Method.type => constants.%Factory.WithSelf.Method.type.dc9 // CHECK:STDOUT: %Factory.WithSelf.Method => constants.%Factory.WithSelf.Method.5a4 -// CHECK:STDOUT: %assoc1.loc8_31.2 => constants.%assoc1.682 +// CHECK:STDOUT: %assoc1.loc8_23.2 => constants.%assoc1.682 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory.WithSelf(constants.%B, constants.%Factory.facet) { @@ -1122,7 +1123,7 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %assoc0.loc6_17.2 => constants.%assoc0.012 // CHECK:STDOUT: %Factory.WithSelf.Method.type => constants.%Factory.WithSelf.Method.type.99a // CHECK:STDOUT: %Factory.WithSelf.Method => constants.%Factory.WithSelf.Method.637 -// CHECK:STDOUT: %assoc1.loc8_31.2 => constants.%assoc1.682 +// CHECK:STDOUT: %assoc1.loc8_23.2 => constants.%assoc1.682 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory.WithSelf.Make(constants.%B, constants.%Factory.facet) { @@ -1135,10 +1136,10 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %T => constants.%B // CHECK:STDOUT: %Factory.type => constants.%Factory.type.5e3 // CHECK:STDOUT: %Self => constants.%Factory.facet -// CHECK:STDOUT: %Self.as_type.loc8_19.1 => constants.%A -// CHECK:STDOUT: %pattern_type.loc8_17 => constants.%pattern_type.9ef -// CHECK:STDOUT: %.loc8_30.1 => constants.%.d83 -// CHECK:STDOUT: %pattern_type.loc8_30 => constants.%pattern_type.e39 +// CHECK:STDOUT: %Self.as_type.loc8_13.1 => constants.%A +// CHECK:STDOUT: %pattern_type.loc8_13 => constants.%pattern_type.9ef +// CHECK:STDOUT: %.loc8_22.1 => constants.%.d83 +// CHECK:STDOUT: %pattern_type.loc8_22 => constants.%pattern_type.e39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- factory.impl.carbon @@ -1205,10 +1206,10 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//factory, loc12_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.7b8 = import_ref Main//factory, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.a26: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = import_ref Main//factory, loc6_17, loaded [symbolic = @Factory.WithSelf.%assoc0 (constants.%assoc0.c0a)] -// CHECK:STDOUT: %Main.import_ref.1ef: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = import_ref Main//factory, loc8_31, loaded [symbolic = @Factory.WithSelf.%assoc1 (constants.%assoc1.c00)] +// CHECK:STDOUT: %Main.import_ref.1ef: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = import_ref Main//factory, loc8_23, loaded [symbolic = @Factory.WithSelf.%assoc1 (constants.%assoc1.c00)] // CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded // CHECK:STDOUT: %Main.Method = import_ref Main//factory, Method, unloaded -// CHECK:STDOUT: %Main.import_ref.ad0: @Factory.WithSelf.%Factory.WithSelf.Method.type (%Factory.WithSelf.Method.type.d40) = import_ref Main//factory, loc8_31, loaded [symbolic = @Factory.WithSelf.%Factory.WithSelf.Method (constants.%Factory.WithSelf.Method.459)] +// CHECK:STDOUT: %Main.import_ref.ad0: @Factory.WithSelf.%Factory.WithSelf.Method.type (%Factory.WithSelf.Method.type.d40) = import_ref Main//factory, loc8_23, loaded [symbolic = @Factory.WithSelf.%Factory.WithSelf.Method (constants.%Factory.WithSelf.Method.459)] // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//factory, loc4_20, loaded [symbolic = @Factory.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.0f8e01.2: @Factory.%Factory.type (%Factory.type.711) = import_ref Main//factory, loc4_29, loaded [symbolic = @Factory.%Self (constants.%Self.3e3)] // CHECK:STDOUT: %Main.import_ref.0a8: @Factory.WithSelf.%Factory.WithSelf.Make.type (%Factory.WithSelf.Make.type.cf7) = import_ref Main//factory, loc6_17, loaded [symbolic = @Factory.WithSelf.%Factory.WithSelf.Make (constants.%Factory.WithSelf.Make.86c)] @@ -1222,13 +1223,13 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.239: type = import_ref Main//factory, loc14_6, loaded [concrete = constants.%A] // CHECK:STDOUT: %Main.import_ref.1d4: type = import_ref Main//factory, loc14_20, loaded [concrete = constants.%Factory.type.5e3] // CHECK:STDOUT: %Main.import_ref.213 = import_ref Main//factory, loc15_17, unloaded -// CHECK:STDOUT: %Main.import_ref.1ee = import_ref Main//factory, loc16_31, unloaded +// CHECK:STDOUT: %Main.import_ref.1ee = import_ref Main//factory, loc16_23, unloaded // CHECK:STDOUT: %Main.import_ref.ebb = import_ref Main//factory, loc14_20, unloaded // CHECK:STDOUT: %Main.import_ref.587 = import_ref Main//factory, loc6_17, unloaded // CHECK:STDOUT: %Main.import_ref.127: %A.as.Factory.impl.Make.type = import_ref Main//factory, loc15_17, loaded [concrete = constants.%A.as.Factory.impl.Make] -// CHECK:STDOUT: %Main.import_ref.84c: %A.as.Factory.impl.Method.type = import_ref Main//factory, loc16_31, loaded [concrete = constants.%A.as.Factory.impl.Method] +// CHECK:STDOUT: %Main.import_ref.84c: %A.as.Factory.impl.Method.type = import_ref Main//factory, loc16_23, loaded [concrete = constants.%A.as.Factory.impl.Method] // CHECK:STDOUT: %Factory.impl_witness_table = impl_witness_table (%Main.import_ref.127, %Main.import_ref.84c), @A.as.Factory.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.82f = import_ref Main//factory, loc8_31, unloaded +// CHECK:STDOUT: %Main.import_ref.82f = import_ref Main//factory, loc8_23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1477,10 +1478,10 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//factory, loc12_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.7b8 = import_ref Main//factory, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.a26: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = import_ref Main//factory, loc6_17, loaded [symbolic = @Factory.WithSelf.%assoc0 (constants.%assoc0.c0a)] -// CHECK:STDOUT: %Main.import_ref.1ef: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = import_ref Main//factory, loc8_31, loaded [symbolic = @Factory.WithSelf.%assoc1 (constants.%assoc1.c00)] +// CHECK:STDOUT: %Main.import_ref.1ef: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.0ed) = import_ref Main//factory, loc8_23, loaded [symbolic = @Factory.WithSelf.%assoc1 (constants.%assoc1.c00)] // CHECK:STDOUT: %Main.Make = import_ref Main//factory, Make, unloaded // CHECK:STDOUT: %Main.Method = import_ref Main//factory, Method, unloaded -// CHECK:STDOUT: %Main.import_ref.ad0: @Factory.WithSelf.%Factory.WithSelf.Method.type (%Factory.WithSelf.Method.type.d40) = import_ref Main//factory, loc8_31, loaded [symbolic = @Factory.WithSelf.%Factory.WithSelf.Method (constants.%Factory.WithSelf.Method.459)] +// CHECK:STDOUT: %Main.import_ref.ad0: @Factory.WithSelf.%Factory.WithSelf.Method.type (%Factory.WithSelf.Method.type.d40) = import_ref Main//factory, loc8_23, loaded [symbolic = @Factory.WithSelf.%Factory.WithSelf.Method (constants.%Factory.WithSelf.Method.459)] // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//factory, loc4_20, loaded [symbolic = @Factory.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.0f8e01.2: @Factory.%Factory.type (%Factory.type.711) = import_ref Main//factory, loc4_29, loaded [symbolic = @Factory.%Self (constants.%Self.3e3)] // CHECK:STDOUT: %Main.import_ref.0a8: @Factory.WithSelf.%Factory.WithSelf.Make.type (%Factory.WithSelf.Make.type.cf7) = import_ref Main//factory, loc6_17, loaded [symbolic = @Factory.WithSelf.%Factory.WithSelf.Make (constants.%Factory.WithSelf.Make.86c)] @@ -1494,10 +1495,10 @@ fn InstanceC(a: A) -> C { // CHECK:STDOUT: %Main.import_ref.239: type = import_ref Main//factory, loc14_6, loaded [concrete = constants.%A] // CHECK:STDOUT: %Main.import_ref.1d4: type = import_ref Main//factory, loc14_20, loaded [concrete = constants.%Factory.type.5e3] // CHECK:STDOUT: %Main.import_ref.213 = import_ref Main//factory, loc15_17, unloaded -// CHECK:STDOUT: %Main.import_ref.1ee = import_ref Main//factory, loc16_31, unloaded +// CHECK:STDOUT: %Main.import_ref.1ee = import_ref Main//factory, loc16_23, unloaded // CHECK:STDOUT: %Main.import_ref.ebb = import_ref Main//factory, loc14_20, unloaded // CHECK:STDOUT: %Main.import_ref.587 = import_ref Main//factory, loc6_17, unloaded -// CHECK:STDOUT: %Main.import_ref.82f = import_ref Main//factory, loc8_31, unloaded +// CHECK:STDOUT: %Main.import_ref.82f = import_ref Main//factory, loc8_23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon index 09bd9299a3bb..8b1f2bee6e3f 100644 --- a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon +++ b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon @@ -13,10 +13,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/canonical_query_self.carbon interface I { - fn II[self: Self](); + fn II(self); } interface J { - fn JJ[self: Self](); + fn JJ(self); } fn F(T:! I & J, t: T) { @@ -29,10 +29,10 @@ fn F(T:! I & J, t: T) { fn G() { class C { extend impl as I { - fn II[unused self: Self]() {} + fn II(unused self) {} } extend impl as J { - fn JJ[unused self: Self]() {} + fn JJ(unused self) {} } } // Nesting FacetValue and FacetAccessTypes, the impl lookup for `JJ` resolves @@ -46,6 +46,7 @@ fn G() { F(C, {} as C); } + // CHECK:STDOUT: --- canonical_query_self.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -195,13 +196,13 @@ fn G() { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.II.%pattern_type (%pattern_type.c60) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.II.%pattern_type (%pattern_type.c60) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.II.%Self.as_type.loc16_15.1 (%Self.as_type.c84) = value_param call_param0 -// CHECK:STDOUT: %.loc16_15.1: type = splice_block %.loc16_15.2 [symbolic = %Self.as_type.loc16_15.1 (constants.%Self.as_type.c84)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.II.%Self.as_type.loc16_9.1 (%Self.as_type.c84) = value_param call_param0 +// CHECK:STDOUT: %.loc16_9.1: type = splice_block %.loc16_9.2 [symbolic = %Self.as_type.loc16_9.1 (constants.%Self.as_type.c84)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.37e)] -// CHECK:STDOUT: %Self.as_type.loc16_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc16_15.1 (constants.%Self.as_type.c84)] -// CHECK:STDOUT: %.loc16_15.2: type = converted %Self.ref, %Self.as_type.loc16_15.2 [symbolic = %Self.as_type.loc16_15.1 (constants.%Self.as_type.c84)] +// CHECK:STDOUT: %Self.as_type.loc16_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc16_9.1 (constants.%Self.as_type.c84)] +// CHECK:STDOUT: %.loc16_9.2: type = converted %Self.ref, %Self.as_type.loc16_9.2 [symbolic = %Self.as_type.loc16_9.1 (constants.%Self.as_type.c84)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.II.%Self.as_type.loc16_15.1 (%Self.as_type.c84) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.II.%Self.as_type.loc16_9.1 (%Self.as_type.c84) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.II.decl [concrete = constants.%assoc0.153] // CHECK:STDOUT: @@ -224,13 +225,13 @@ fn G() { // CHECK:STDOUT: %self.param_patt: @J.WithSelf.JJ.%pattern_type (%pattern_type.506) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @J.WithSelf.JJ.%pattern_type (%pattern_type.506) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @J.WithSelf.JJ.%Self.as_type.loc19_15.1 (%Self.as_type.976) = value_param call_param0 -// CHECK:STDOUT: %.loc19_15.1: type = splice_block %.loc19_15.2 [symbolic = %Self.as_type.loc19_15.1 (constants.%Self.as_type.976)] { +// CHECK:STDOUT: %self.param: @J.WithSelf.JJ.%Self.as_type.loc19_9.1 (%Self.as_type.976) = value_param call_param0 +// CHECK:STDOUT: %.loc19_9.1: type = splice_block %.loc19_9.2 [symbolic = %Self.as_type.loc19_9.1 (constants.%Self.as_type.976)] { // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.653)] -// CHECK:STDOUT: %Self.as_type.loc19_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc19_15.1 (constants.%Self.as_type.976)] -// CHECK:STDOUT: %.loc19_15.2: type = converted %Self.ref, %Self.as_type.loc19_15.2 [symbolic = %Self.as_type.loc19_15.1 (constants.%Self.as_type.976)] +// CHECK:STDOUT: %Self.as_type.loc19_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc19_9.1 (constants.%Self.as_type.976)] +// CHECK:STDOUT: %.loc19_9.2: type = converted %Self.ref, %Self.as_type.loc19_9.2 [symbolic = %Self.as_type.loc19_9.1 (constants.%Self.as_type.976)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @J.WithSelf.JJ.%Self.as_type.loc19_15.1 (%Self.as_type.976) = value_binding self, %self.param +// CHECK:STDOUT: %self: @J.WithSelf.JJ.%Self.as_type.loc19_9.1 (%Self.as_type.976) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, %J.WithSelf.JJ.decl [concrete = constants.%assoc0.7d8] // CHECK:STDOUT: @@ -301,18 +302,18 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @I.WithSelf.II(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.37e)] -// CHECK:STDOUT: %Self.as_type.loc16_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_15.1 (constants.%Self.as_type.c84)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_15.1 [symbolic = %pattern_type (constants.%pattern_type.c60)] +// CHECK:STDOUT: %Self.as_type.loc16_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_9.1 (constants.%Self.as_type.c84)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_9.1 [symbolic = %pattern_type (constants.%pattern_type.c60)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.II.%Self.as_type.loc16_15.1 (%Self.as_type.c84)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.II.%Self.as_type.loc16_9.1 (%Self.as_type.c84)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @J.WithSelf.JJ(@J.%Self: %J.type) { // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.653)] -// CHECK:STDOUT: %Self.as_type.loc19_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc19_15.1 (constants.%Self.as_type.976)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc19_15.1 [symbolic = %pattern_type (constants.%pattern_type.506)] +// CHECK:STDOUT: %Self.as_type.loc19_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc19_9.1 (constants.%Self.as_type.976)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc19_9.1 [symbolic = %pattern_type (constants.%pattern_type.506)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @J.WithSelf.JJ.%Self.as_type.loc19_15.1 (%Self.as_type.976)); +// CHECK:STDOUT: fn(%self.param: @J.WithSelf.JJ.%Self.as_type.loc19_9.1 (%Self.as_type.976)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc22_7.2: %facet_type) { @@ -362,6 +363,8 @@ fn G() { // CHECK:STDOUT: %JJ.ref: %J.assoc_type = name_ref JJ, @J.WithSelf.%assoc0 [concrete = constants.%assoc0.7d8] // CHECK:STDOUT: %impl.elem0.loc26_69.1: @F.%.loc26_69 (%.443) = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_69.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc26_69: = bound_method %t.ref, %impl.elem0.loc26_69.1 +// CHECK:STDOUT: %J.facet.loc26_73: %J.type = facet_value constants.%T.as_type, (constants.%J.lookup_impl_witness) [symbolic = %J.facet.loc26_33.2 (constants.%J.facet.cbc)] +// CHECK:STDOUT: %.loc26_73: %J.type = converted constants.%T.as_type, %J.facet.loc26_73 [symbolic = %J.facet.loc26_33.2 (constants.%J.facet.cbc)] // CHECK:STDOUT: %specific_impl_fn.loc26_69.1: = specific_impl_function %impl.elem0.loc26_69.1, @J.WithSelf.JJ(constants.%J.facet.cbc) [symbolic = %specific_impl_fn.loc26_69.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc26_73: = bound_method %t.ref, %specific_impl_fn.loc26_69.1 // CHECK:STDOUT: %J.WithSelf.JJ.call: init %empty_tuple.type = call %bound_method.loc26_73(%t.ref) @@ -453,7 +456,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.II(constants.%Self.37e) { // CHECK:STDOUT: %Self => constants.%Self.37e -// CHECK:STDOUT: %Self.as_type.loc16_15.1 => constants.%Self.as_type.c84 +// CHECK:STDOUT: %Self.as_type.loc16_9.1 => constants.%Self.as_type.c84 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c60 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -466,7 +469,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf.JJ(constants.%Self.653) { // CHECK:STDOUT: %Self => constants.%Self.653 -// CHECK:STDOUT: %Self.as_type.loc19_15.1 => constants.%Self.as_type.976 +// CHECK:STDOUT: %Self.as_type.loc19_9.1 => constants.%Self.as_type.976 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.506 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -499,7 +502,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf.JJ(constants.%J.facet.cbc) { // CHECK:STDOUT: %Self => constants.%J.facet.cbc -// CHECK:STDOUT: %Self.as_type.loc19_15.1 => constants.%T.as_type +// CHECK:STDOUT: %Self.as_type.loc19_9.1 => constants.%T.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.936 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -512,7 +515,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.II(constants.%I.facet.947) { // CHECK:STDOUT: %Self => constants.%I.facet.947 -// CHECK:STDOUT: %Self.as_type.loc16_15.1 => constants.%C +// CHECK:STDOUT: %Self.as_type.loc16_9.1 => constants.%C // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f79 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -525,7 +528,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf.JJ(constants.%J.facet.a74) { // CHECK:STDOUT: %Self => constants.%J.facet.a74 -// CHECK:STDOUT: %Self.as_type.loc19_15.1 => constants.%C +// CHECK:STDOUT: %Self.as_type.loc19_9.1 => constants.%C // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f79 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index 72a09e3e0a21..93a5f06a465d 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -17,11 +17,11 @@ library "[[@TEST_NAME]]"; interface HasF { - fn F[self: Self](); + fn F(self); } impl forall [T:! type] T as HasF { - fn F[unused self: Self]() {} + fn F(unused self) {} } fn G(x: {}) { @@ -33,11 +33,11 @@ fn G(x: {}) { library "[[@TEST_NAME]]"; interface HasF { - fn F[self: Self]() -> Self; + fn F(self) -> Self; } impl forall [T:! type] T* as HasF { - fn F[self: Self]() -> T* { return self; } + fn F(self) -> T* { return self; } } fn G(x: {}*) -> {}* { @@ -49,13 +49,13 @@ fn G(x: {}*) -> {}* { library "[[@TEST_NAME]]"; interface HasF { - fn F[self: Self](); + fn F(self); } class C(T:! type) {} impl forall [T:! type] C(T) as HasF { - fn F[unused self: Self]() {} + fn F(unused self) {} } fn G(x: C({})) { @@ -67,11 +67,11 @@ fn G(x: C({})) { library "[[@TEST_NAME]]"; interface HasF(T:! type) { - fn F[self: Self](); + fn F(self); } impl forall [T:! type] {} as HasF(T) { - fn F[unused self: Self]() {} + fn F(unused self) {} } fn G(x: {}) { @@ -83,7 +83,7 @@ fn G(x: {}) { library "[[@TEST_NAME]]"; interface HasF { - fn F[self: Self](); + fn F(self); } // CHECK:STDERR: fail_incomplete_deduction.carbon:[[@LINE+4]]:13: error: `impl` with unused generic binding [ImplUnusedBinding] @@ -91,7 +91,7 @@ interface HasF { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: impl forall [T:! type, U:! type] T as HasF { - fn F[unused self: Self]() {} + fn F(unused self) {} } fn G(x: {}) { @@ -107,11 +107,11 @@ fn G(x: {}) { library "[[@TEST_NAME]]"; interface HasF(T:! type) { - fn F[self: Self](); + fn F(self); } impl forall [T:! type] T as HasF(T) { - fn F[unused self: Self]() {} + fn F(unused self) {} } class A {} @@ -127,6 +127,7 @@ fn G(x: A) { x.(HasF(B).F)(); } + // CHECK:STDOUT: --- deduced_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -215,13 +216,13 @@ fn G(x: A) { // CHECK:STDOUT: %self.param_patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.2: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -262,10 +263,10 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.WithSelf.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.c9f)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.c9f)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc8_15.2: type) { @@ -303,7 +304,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c9f // CHECK:STDOUT: } // CHECK:STDOUT: @@ -330,7 +331,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%HasF.facet.805) { // CHECK:STDOUT: %Self => constants.%HasF.facet.805 -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%T // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: @@ -482,21 +483,21 @@ fn G(x: A) { // CHECK:STDOUT: %self.param_patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = return_slot_pattern %return.param_patt, %.loc5_25.2 [concrete] +// CHECK:STDOUT: %return.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = return_slot_pattern %return.param_patt, %.loc5_17.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc5_25: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.c62)] -// CHECK:STDOUT: %Self.as_type.loc5_25: type = facet_access_type %Self.ref.loc5_25 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.5c2)] -// CHECK:STDOUT: %.loc5_25.2: type = converted %Self.ref.loc5_25, %Self.as_type.loc5_25 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.5c2)] -// CHECK:STDOUT: %.loc5_25.3: Core.Form = init_form %.loc5_25.2 [symbolic = %.loc5_25.1 (constants.%.376)] -// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.5c2) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.5c2)] { -// CHECK:STDOUT: %Self.ref.loc5_14: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.c62)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref.loc5_14 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.5c2)] -// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref.loc5_14, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.5c2)] +// CHECK:STDOUT: %Self.ref.loc5_17: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.c62)] +// CHECK:STDOUT: %Self.as_type.loc5_17: type = facet_access_type %Self.ref.loc5_17 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type.5c2)] +// CHECK:STDOUT: %.loc5_17.2: type = converted %Self.ref.loc5_17, %Self.as_type.loc5_17 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type.5c2)] +// CHECK:STDOUT: %.loc5_17.3: Core.Form = init_form %.loc5_17.2 [symbolic = %.loc5_17.1 (constants.%.376)] +// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type.5c2) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type.5c2)] { +// CHECK:STDOUT: %Self.ref.loc5_8: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self.c62)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref.loc5_8 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type.5c2)] +// CHECK:STDOUT: %.loc5_8.2: type = converted %Self.ref.loc5_8, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type.5c2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.5c2) = value_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.5c2) = out_param call_param1 -// CHECK:STDOUT: %return: ref @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.5c2) = return_slot %return.param +// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type.5c2) = value_binding self, %self.param +// CHECK:STDOUT: %return.param: ref @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type.5c2) = out_param call_param1 +// CHECK:STDOUT: %return: ref @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type.5c2) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.WithSelf.F.decl [concrete = constants.%assoc0.a0c] // CHECK:STDOUT: @@ -523,16 +524,16 @@ fn G(x: A) { // CHECK:STDOUT: %self.param_patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.4f4) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.4f4) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.4f4) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.4f4) = return_slot_pattern %return.param_patt, %ptr.loc9_26 [concrete] +// CHECK:STDOUT: %return.patt: @ptr.as.HasF.impl.F.%pattern_type (%pattern_type.4f4) = return_slot_pattern %return.param_patt, %ptr.loc9_18 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.ref: type = name_ref T, @ptr.as.HasF.impl.%T.loc8_15.2 [symbolic = %T (constants.%T.67d)] -// CHECK:STDOUT: %ptr.loc9_26: type = ptr_type %T.ref [symbolic = %ptr.loc9_14 (constants.%ptr.e8f)] -// CHECK:STDOUT: %.loc9_26.2: Core.Form = init_form %ptr.loc9_26 [symbolic = %.loc9_26.1 (constants.%.cb6)] -// CHECK:STDOUT: %self.param: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) = value_param call_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @ptr.as.HasF.impl.%ptr.loc8_25.2 [symbolic = %ptr.loc9_14 (constants.%ptr.e8f)] -// CHECK:STDOUT: %self: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) = value_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) = out_param call_param1 -// CHECK:STDOUT: %return: ref @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) = return_slot %return.param +// CHECK:STDOUT: %ptr.loc9_18: type = ptr_type %T.ref [symbolic = %ptr.loc9_8 (constants.%ptr.e8f)] +// CHECK:STDOUT: %.loc9_18.2: Core.Form = init_form %ptr.loc9_18 [symbolic = %.loc9_18.1 (constants.%.cb6)] +// CHECK:STDOUT: %self.param: @ptr.as.HasF.impl.F.%ptr.loc9_8 (%ptr.e8f) = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @ptr.as.HasF.impl.%ptr.loc8_25.2 [symbolic = %ptr.loc9_8 (constants.%ptr.e8f)] +// CHECK:STDOUT: %self: @ptr.as.HasF.impl.F.%ptr.loc9_8 (%ptr.e8f) = value_binding self, %self.param +// CHECK:STDOUT: %return.param: ref @ptr.as.HasF.impl.F.%ptr.loc9_8 (%ptr.e8f) = out_param call_param1 +// CHECK:STDOUT: %return: ref @ptr.as.HasF.impl.F.%ptr.loc9_8 (%ptr.e8f) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%ptr.as.HasF.impl.F.decl), @ptr.as.HasF.impl [concrete] // CHECK:STDOUT: %HasF.impl_witness.loc8_35.1: = impl_witness %HasF.impl_witness_table, @ptr.as.HasF.impl(constants.%T.67d) [symbolic = %HasF.impl_witness.loc8_35.2 (constants.%HasF.impl_witness.672)] @@ -547,37 +548,39 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.WithSelf.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.c62)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type.5c2)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.c9f)] -// CHECK:STDOUT: %.loc5_25.1: Core.Form = init_form %Self.as_type.loc5_14.1 [symbolic = %.loc5_25.1 (constants.%.376)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type.5c2)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.c9f)] +// CHECK:STDOUT: %.loc5_17.1: Core.Form = init_form %Self.as_type.loc5_8.1 [symbolic = %.loc5_17.1 (constants.%.376)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.5c2)) -> out %return.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type.5c2); +// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type.5c2)) -> out %return.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type.5c2); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ptr.as.HasF.impl.F(@ptr.as.HasF.impl.%T.loc8_15.2: type) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T.67d)] -// CHECK:STDOUT: %ptr.loc9_14: type = ptr_type %T [symbolic = %ptr.loc9_14 (constants.%ptr.e8f)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_14 [symbolic = %pattern_type (constants.%pattern_type.4f4)] -// CHECK:STDOUT: %.loc9_26.1: Core.Form = init_form %ptr.loc9_14 [symbolic = %.loc9_26.1 (constants.%.cb6)] +// CHECK:STDOUT: %ptr.loc9_8: type = ptr_type %T [symbolic = %ptr.loc9_8 (constants.%ptr.e8f)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_8 [symbolic = %pattern_type (constants.%pattern_type.4f4)] +// CHECK:STDOUT: %.loc9_18.1: Core.Form = init_form %ptr.loc9_8 [symbolic = %.loc9_18.1 (constants.%.cb6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.loc9_14 [symbolic = %require_complete (constants.%require_complete.ef1)] -// CHECK:STDOUT: %.loc9_37.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T) [symbolic = %.loc9_37.1 (constants.%.0e9)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc9_14, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc9_14, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.302)] -// 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: %.loc9_37.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc9_37.2 (constants.%.be5)] -// CHECK:STDOUT: %impl.elem0.loc9_37.2: @ptr.as.HasF.impl.F.%.loc9_37.2 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.484)] -// CHECK:STDOUT: %specific_impl_fn.loc9_37.2: = specific_impl_function %impl.elem0.loc9_37.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_37.2 (constants.%specific_impl_fn.a76)] +// CHECK:STDOUT: %require_complete: = require_complete_type %ptr.loc9_8 [symbolic = %require_complete (constants.%require_complete.ef1)] +// CHECK:STDOUT: %.loc9_29.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T) [symbolic = %.loc9_29.2 (constants.%.0e9)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc9_8, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] +// CHECK:STDOUT: %Copy.facet.loc9_29.2: %Copy.type = facet_value %ptr.loc9_8, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc9_29.2 (constants.%Copy.facet.302)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc9_29.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)] +// CHECK:STDOUT: %.loc9_29.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc9_29.2 [symbolic = %.loc9_29.3 (constants.%.be5)] +// CHECK:STDOUT: %impl.elem0.loc9_29.2: @ptr.as.HasF.impl.F.%.loc9_29.3 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_29.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %specific_impl_fn.loc9_29.2: = specific_impl_function %impl.elem0.loc9_29.2, @Copy.WithSelf.Op(%Copy.facet.loc9_29.2) [symbolic = %specific_impl_fn.loc9_29.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f)) -> out %return.param: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) { +// CHECK:STDOUT: fn(%self.param: @ptr.as.HasF.impl.F.%ptr.loc9_8 (%ptr.e8f)) -> out %return.param: @ptr.as.HasF.impl.F.%ptr.loc9_8 (%ptr.e8f) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) = name_ref self, %self -// CHECK:STDOUT: %impl.elem0.loc9_37.1: @ptr.as.HasF.impl.F.%.loc9_37.2 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc9_37.2 (constants.%impl.elem0.484)] -// CHECK:STDOUT: %bound_method.loc9_37.1: = bound_method %self.ref, %impl.elem0.loc9_37.1 -// CHECK:STDOUT: %specific_impl_fn.loc9_37.1: = specific_impl_function %impl.elem0.loc9_37.1, @Copy.WithSelf.Op(constants.%Copy.facet.302) [symbolic = %specific_impl_fn.loc9_37.2 (constants.%specific_impl_fn.a76)] -// CHECK:STDOUT: %bound_method.loc9_37.2: = bound_method %self.ref, %specific_impl_fn.loc9_37.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @ptr.as.HasF.impl.F.%ptr.loc9_14 (%ptr.e8f) = call %bound_method.loc9_37.2(%self.ref) +// CHECK:STDOUT: %self.ref: @ptr.as.HasF.impl.F.%ptr.loc9_8 (%ptr.e8f) = name_ref self, %self +// CHECK:STDOUT: %impl.elem0.loc9_29.1: @ptr.as.HasF.impl.F.%.loc9_29.3 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc9_29.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %bound_method.loc9_29.1: = bound_method %self.ref, %impl.elem0.loc9_29.1 +// CHECK:STDOUT: %Copy.facet.loc9_29.1: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.1da) [symbolic = %Copy.facet.loc9_29.2 (constants.%Copy.facet.302)] +// CHECK:STDOUT: %.loc9_29.1: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc9_29.1 [symbolic = %Copy.facet.loc9_29.2 (constants.%Copy.facet.302)] +// CHECK:STDOUT: %specific_impl_fn.loc9_29.1: = specific_impl_function %impl.elem0.loc9_29.1, @Copy.WithSelf.Op(constants.%Copy.facet.302) [symbolic = %specific_impl_fn.loc9_29.2 (constants.%specific_impl_fn.a76)] +// CHECK:STDOUT: %bound_method.loc9_29.2: = bound_method %self.ref, %specific_impl_fn.loc9_29.1 +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @ptr.as.HasF.impl.F.%ptr.loc9_8 (%ptr.e8f) = call %bound_method.loc9_29.2(%self.ref) // CHECK:STDOUT: return %Copy.WithSelf.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -604,9 +607,9 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%Self.c62) { // CHECK:STDOUT: %Self => constants.%Self.c62 -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type.5c2 +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type.5c2 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c9f -// CHECK:STDOUT: %.loc5_25.1 => constants.%.376 +// CHECK:STDOUT: %.loc5_17.1 => constants.%.376 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ptr.as.HasF.impl(constants.%T.67d) { @@ -621,9 +624,9 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ptr.as.HasF.impl.F(constants.%T.67d) { // CHECK:STDOUT: %T => constants.%T.67d -// CHECK:STDOUT: %ptr.loc9_14 => constants.%ptr.e8f +// CHECK:STDOUT: %ptr.loc9_8 => constants.%ptr.e8f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4 -// CHECK:STDOUT: %.loc9_26.1 => constants.%.cb6 +// CHECK:STDOUT: %.loc9_18.1 => constants.%.cb6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf(constants.%HasF.facet.3fb) { @@ -635,9 +638,9 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%HasF.facet.3fb) { // CHECK:STDOUT: %Self => constants.%HasF.facet.3fb -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%ptr.e8f +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%ptr.e8f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4 -// CHECK:STDOUT: %.loc5_25.1 => constants.%.cb6 +// CHECK:STDOUT: %.loc5_17.1 => constants.%.cb6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ptr.as.HasF.impl(constants.%empty_struct_type) { @@ -659,19 +662,19 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @ptr.as.HasF.impl.F(constants.%empty_struct_type) { // CHECK:STDOUT: %T => constants.%empty_struct_type -// CHECK:STDOUT: %ptr.loc9_14 => constants.%ptr.c28 +// CHECK:STDOUT: %ptr.loc9_8 => constants.%ptr.c28 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1cc -// CHECK:STDOUT: %.loc9_26.1 => constants.%.9ba +// CHECK:STDOUT: %.loc9_18.1 => constants.%.9ba // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type -// CHECK:STDOUT: %.loc9_37.1 => constants.%.a81 +// CHECK:STDOUT: %.loc9_29.2 => constants.%.a81 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.1c2 -// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.80f +// CHECK:STDOUT: %Copy.facet.loc9_29.2 => constants.%Copy.facet.80f // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.8a4 -// CHECK:STDOUT: %.loc9_37.2 => constants.%.523 -// CHECK:STDOUT: %impl.elem0.loc9_37.2 => constants.%ptr.as.Copy.impl.Op.9ed -// CHECK:STDOUT: %specific_impl_fn.loc9_37.2 => constants.%ptr.as.Copy.impl.Op.specific_fn +// CHECK:STDOUT: %.loc9_29.3 => constants.%.523 +// CHECK:STDOUT: %impl.elem0.loc9_29.2 => constants.%ptr.as.Copy.impl.Op.9ed +// CHECK:STDOUT: %specific_impl_fn.loc9_29.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduced_type_argument.carbon @@ -780,13 +783,13 @@ fn G(x: A) { // CHECK:STDOUT: %self.param_patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.2: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -842,10 +845,10 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.WithSelf.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.c9f)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.c9f)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @C.as.HasF.impl.F(@C.as.HasF.impl.%T.loc10_15.2: type) { @@ -884,7 +887,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c9f // CHECK:STDOUT: } // CHECK:STDOUT: @@ -919,7 +922,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%HasF.facet.0c3) { // CHECK:STDOUT: %Self => constants.%HasF.facet.0c3 -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%C.1d0 +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%C.1d0 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ebe // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1068,20 +1071,20 @@ fn G(x: A) { // CHECK:STDOUT: %self.param_patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.a2b) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.a2b) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.3 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc5_14.2: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = specific_constant @HasF.%Self.loc4_26.1, @HasF(constants.%T) [symbolic = %Self (constants.%Self.822)] -// CHECK:STDOUT: %Self.ref: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = name_ref Self, %.loc5_14.2 [symbolic = %Self (constants.%Self.822)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.3: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.3 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc5_8.2: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = specific_constant @HasF.%Self.loc4_26.1, @HasF(constants.%T) [symbolic = %Self (constants.%Self.822)] +// CHECK:STDOUT: %Self.ref: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = name_ref Self, %.loc5_8.2 [symbolic = %Self (constants.%Self.822)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.3: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc5_21.1: @HasF.WithSelf.%HasF.assoc_type (%HasF.assoc_type.ddf) = assoc_entity element0, %HasF.WithSelf.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.e9a)] +// CHECK:STDOUT: %assoc0.loc5_13.1: @HasF.WithSelf.%HasF.assoc_type (%HasF.assoc_type.ddf) = assoc_entity element0, %HasF.WithSelf.F.decl [symbolic = %assoc0.loc5_13.2 (constants.%assoc0.e9a)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc4_26.1 -// CHECK:STDOUT: .F = @HasF.WithSelf.%assoc0.loc5_21.1 +// CHECK:STDOUT: .F = @HasF.WithSelf.%assoc0.loc5_13.1 // CHECK:STDOUT: witness = (@HasF.WithSelf.%HasF.WithSelf.F.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: @@ -1121,10 +1124,10 @@ fn G(x: A) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T)> [symbolic = %HasF.type (constants.%HasF.type.daf)] // CHECK:STDOUT: %Self: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.822)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.a2b)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.a2b)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @empty_struct_type.as.HasF.impl.F(@empty_struct_type.as.HasF.impl.%T.loc8_15.2: type) { @@ -1143,7 +1146,7 @@ fn G(x: A) { // CHECK:STDOUT: %.loc13_12: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc13_13: type = converted %.loc13_12, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%empty_struct_type)> [concrete = constants.%HasF.type.b91] -// CHECK:STDOUT: %.loc13_14: %HasF.assoc_type.1d0 = specific_constant @HasF.WithSelf.%assoc0.loc5_21.1, @HasF.WithSelf(constants.%empty_struct_type, constants.%Self.822) [concrete = constants.%assoc0.3f7] +// CHECK:STDOUT: %.loc13_14: %HasF.assoc_type.1d0 = specific_constant @HasF.WithSelf.%assoc0.loc5_13.1, @HasF.WithSelf(constants.%empty_struct_type, constants.%Self.822) [concrete = constants.%assoc0.3f7] // CHECK:STDOUT: %F.ref: %HasF.assoc_type.1d0 = name_ref F, %.loc13_14 [concrete = constants.%assoc0.3f7] // CHECK:STDOUT: %impl.elem0: %.abf = impl_witness_access constants.%HasF.impl_witness.7f1, element0 [concrete = constants.%empty_struct_type.as.HasF.impl.F.0aa] // CHECK:STDOUT: %bound_method.loc13_4: = bound_method %x.ref, %impl.elem0 @@ -1169,14 +1172,14 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.WithSelf.F.type => constants.%HasF.WithSelf.F.type.41d // CHECK:STDOUT: %HasF.WithSelf.F => constants.%HasF.WithSelf.F.ff7 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.ddf -// CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.e9a +// CHECK:STDOUT: %assoc0.loc5_13.2 => constants.%assoc0.e9a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%T, constants.%Self.822) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %HasF.type => constants.%HasF.type.daf // CHECK:STDOUT: %Self => constants.%Self.822 -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a2b // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1201,14 +1204,14 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.WithSelf.F.type => constants.%HasF.WithSelf.F.type.dd7 // CHECK:STDOUT: %HasF.WithSelf.F => constants.%HasF.WithSelf.F.7b3 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.ddf -// CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.e9a +// CHECK:STDOUT: %assoc0.loc5_13.2 => constants.%assoc0.e9a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%T, constants.%HasF.facet.9f2) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %HasF.type => constants.%HasF.type.daf // CHECK:STDOUT: %Self => constants.%HasF.facet.9f2 -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_struct_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%empty_struct_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a96 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1228,7 +1231,7 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.WithSelf.F.type => constants.%HasF.WithSelf.F.type.b94 // CHECK:STDOUT: %HasF.WithSelf.F => constants.%HasF.WithSelf.F.0d9 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.1d0 -// CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.3f7 +// CHECK:STDOUT: %assoc0.loc5_13.2 => constants.%assoc0.3f7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl(constants.%empty_struct_type) { @@ -1250,7 +1253,7 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.WithSelf.F.type => constants.%HasF.WithSelf.F.type.1ff // CHECK:STDOUT: %HasF.WithSelf.F => constants.%HasF.WithSelf.F.260 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.1d0 -// CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.3f7 +// CHECK:STDOUT: %assoc0.loc5_13.2 => constants.%assoc0.3f7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @empty_struct_type.as.HasF.impl.F(constants.%empty_struct_type) { @@ -1339,13 +1342,13 @@ fn G(x: A) { // CHECK:STDOUT: %self.param_patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.c9f) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.2: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -1387,10 +1390,10 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.WithSelf.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.c9f)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.c9f)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc12_15.2: type, @T.as.HasF.impl.%U.loc12_25.2: type) { @@ -1423,7 +1426,7 @@ fn G(x: A) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c9f // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1549,20 +1552,20 @@ fn G(x: A) { // CHECK:STDOUT: %self.param_patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.a2b) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.a2b) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.3 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc5_14.2: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = specific_constant @HasF.%Self.loc4_26.1, @HasF(constants.%T) [symbolic = %Self (constants.%Self.822)] -// CHECK:STDOUT: %Self.ref: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = name_ref Self, %.loc5_14.2 [symbolic = %Self (constants.%Self.822)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.3: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.3 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc5_8.2: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = specific_constant @HasF.%Self.loc4_26.1, @HasF(constants.%T) [symbolic = %Self (constants.%Self.822)] +// CHECK:STDOUT: %Self.ref: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = name_ref Self, %.loc5_8.2 [symbolic = %Self (constants.%Self.822)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.3: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc5_21.1: @HasF.WithSelf.%HasF.assoc_type (%HasF.assoc_type.ddf) = assoc_entity element0, %HasF.WithSelf.F.decl [symbolic = %assoc0.loc5_21.2 (constants.%assoc0.e9a)] +// CHECK:STDOUT: %assoc0.loc5_13.1: @HasF.WithSelf.%HasF.assoc_type (%HasF.assoc_type.ddf) = assoc_entity element0, %HasF.WithSelf.F.decl [symbolic = %assoc0.loc5_13.2 (constants.%assoc0.e9a)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc4_26.1 -// CHECK:STDOUT: .F = @HasF.WithSelf.%assoc0.loc5_21.1 +// CHECK:STDOUT: .F = @HasF.WithSelf.%assoc0.loc5_13.1 // CHECK:STDOUT: witness = (@HasF.WithSelf.%HasF.WithSelf.F.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: @@ -1618,10 +1621,10 @@ fn G(x: A) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(%T)> [symbolic = %HasF.type (constants.%HasF.type.daf)] // CHECK:STDOUT: %Self: @HasF.WithSelf.F.%HasF.type (%HasF.type.daf) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.822)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.a2b)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.a2b)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @T.as.HasF.impl.F(@T.as.HasF.impl.%T.loc8_15.2: type) { @@ -1643,7 +1646,7 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.ref: %HasF.type.c96 = name_ref HasF, file.%HasF.decl [concrete = constants.%HasF.generic] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%B)> [concrete = constants.%HasF.type.5a7] -// CHECK:STDOUT: %.loc22: %HasF.assoc_type.43e = specific_constant @HasF.WithSelf.%assoc0.loc5_21.1, @HasF.WithSelf(constants.%B, constants.%Self.822) [concrete = constants.%assoc0.613] +// CHECK:STDOUT: %.loc22: %HasF.assoc_type.43e = specific_constant @HasF.WithSelf.%assoc0.loc5_13.1, @HasF.WithSelf(constants.%B, constants.%Self.822) [concrete = constants.%assoc0.613] // CHECK:STDOUT: %F.ref: %HasF.assoc_type.43e = name_ref F, %.loc22 [concrete = constants.%assoc0.613] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1664,14 +1667,14 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.WithSelf.F.type => constants.%HasF.WithSelf.F.type.41d // CHECK:STDOUT: %HasF.WithSelf.F => constants.%HasF.WithSelf.F.ff7 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.ddf -// CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.e9a +// CHECK:STDOUT: %assoc0.loc5_13.2 => constants.%assoc0.e9a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%T, constants.%Self.822) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %HasF.type => constants.%HasF.type.daf // CHECK:STDOUT: %Self => constants.%Self.822 -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a2b // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1699,14 +1702,14 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.WithSelf.F.type => constants.%HasF.WithSelf.F.type.f9f // CHECK:STDOUT: %HasF.WithSelf.F => constants.%HasF.WithSelf.F.3d5 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.ddf -// CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.e9a +// CHECK:STDOUT: %assoc0.loc5_13.2 => constants.%assoc0.e9a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%T, constants.%HasF.facet) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %HasF.type => constants.%HasF.type.daf // CHECK:STDOUT: %Self => constants.%HasF.facet -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%T +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%T // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1726,6 +1729,6 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.WithSelf.F.type => constants.%HasF.WithSelf.F.type.2a0 // CHECK:STDOUT: %HasF.WithSelf.F => constants.%HasF.WithSelf.F.836 // CHECK:STDOUT: %HasF.assoc_type => constants.%HasF.assoc_type.43e -// CHECK:STDOUT: %assoc0.loc5_21.2 => constants.%assoc0.613 +// CHECK:STDOUT: %assoc0.loc5_13.2 => constants.%assoc0.613 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/impl_forall.carbon b/toolchain/check/testdata/impl/lookup/impl_forall.carbon index 8d0836a80f2a..ef8bbf7138d6 100644 --- a/toolchain/check/testdata/impl/lookup/impl_forall.carbon +++ b/toolchain/check/testdata/impl/lookup/impl_forall.carbon @@ -18,12 +18,12 @@ class A(T:! type) { } interface I(U:! type) { - fn F[ref self: Self]() -> U*; + fn F(ref self) -> U*; } //@dump-sem-ir-begin impl forall [V:! type] A(V) as I(V) { - fn F[ref self: Self]() -> V* { + fn F(ref self) -> V* { return &self.n; } } @@ -41,6 +41,7 @@ fn TestSpecific(a: A({})*) -> {}* { //@dump-sem-ir-end } + // CHECK:STDOUT: --- impl_forall.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -169,19 +170,19 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: // CHECK:STDOUT: impl: %A.loc12_27.2 as %I.type.loc12_35.2 { // CHECK:STDOUT: %A.as.I.impl.F.decl: @A.as.I.impl.%A.as.I.impl.F.type (%A.as.I.impl.F.type.d1ec9e.1) = fn_decl @A.as.I.impl.F [symbolic = @A.as.I.impl.%A.as.I.impl.F (constants.%A.as.I.impl.F.d83bf5.1)] { -// CHECK:STDOUT: %self.param_patt: @A.as.I.impl.F.%pattern_type.loc13_16 (%pattern_type.44a178.1) = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @A.as.I.impl.F.%pattern_type.loc13_16 (%pattern_type.44a178.1) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @A.as.I.impl.F.%pattern_type.loc13_30 (%pattern_type.4f4b84.2) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @A.as.I.impl.F.%pattern_type.loc13_30 (%pattern_type.4f4b84.2) = return_slot_pattern %return.param_patt, %ptr.loc13_30.2 [concrete] +// CHECK:STDOUT: %self.param_patt: @A.as.I.impl.F.%pattern_type.loc13_12 (%pattern_type.44a178.1) = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @A.as.I.impl.F.%pattern_type.loc13_12 (%pattern_type.44a178.1) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @A.as.I.impl.F.%pattern_type.loc13_22 (%pattern_type.4f4b84.2) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @A.as.I.impl.F.%pattern_type.loc13_22 (%pattern_type.4f4b84.2) = return_slot_pattern %return.param_patt, %ptr.loc13_22.2 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %V.ref: type = name_ref V, @A.as.I.impl.%V.loc12_15.2 [symbolic = %V (constants.%V.67d)] -// CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type %V.ref [symbolic = %ptr.loc13_30.1 (constants.%ptr.e8f8f9.2)] -// CHECK:STDOUT: %.loc13_30.2: Core.Form = init_form %ptr.loc13_30.2 [symbolic = %.loc13_30.1 (constants.%.cb6cb9.2)] +// CHECK:STDOUT: %ptr.loc13_22.2: type = ptr_type %V.ref [symbolic = %ptr.loc13_22.1 (constants.%ptr.e8f8f9.2)] +// CHECK:STDOUT: %.loc13_22.2: Core.Form = init_form %ptr.loc13_22.2 [symbolic = %.loc13_22.1 (constants.%.cb6cb9.2)] // CHECK:STDOUT: %self.param: ref @A.as.I.impl.F.%A (%A.47a1de.2) = ref_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @A.as.I.impl.%A.loc12_27.2 [symbolic = %A (constants.%A.47a1de.2)] // CHECK:STDOUT: %self: ref @A.as.I.impl.F.%A (%A.47a1de.2) = ref_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.e8f8f9.2) = out_param call_param1 -// CHECK:STDOUT: %return: ref @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.e8f8f9.2) = return_slot %return.param +// CHECK:STDOUT: %return.param: ref @A.as.I.impl.F.%ptr.loc13_22.1 (%ptr.e8f8f9.2) = out_param call_param1 +// CHECK:STDOUT: %return: ref @A.as.I.impl.F.%ptr.loc13_22.1 (%ptr.e8f8f9.2) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%A.as.I.impl.F.decl), @A.as.I.impl [concrete] // CHECK:STDOUT: %I.impl_witness.loc12_37.1: = impl_witness %I.impl_witness_table, @A.as.I.impl(constants.%V.67d) [symbolic = %I.impl_witness.loc12_37.2 (constants.%I.impl_witness.25d8bb.1)] @@ -197,34 +198,36 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: generic fn @A.as.I.impl.F(@A.as.I.impl.%V.loc12_15.2: type) { // CHECK:STDOUT: %V: type = symbolic_binding V, 0 [symbolic = %V (constants.%V.67d)] // CHECK:STDOUT: %A: type = class_type @A, @A(%V) [symbolic = %A (constants.%A.47a1de.2)] -// CHECK:STDOUT: %pattern_type.loc13_16: type = pattern_type %A [symbolic = %pattern_type.loc13_16 (constants.%pattern_type.44a178.1)] -// CHECK:STDOUT: %ptr.loc13_30.1: type = ptr_type %V [symbolic = %ptr.loc13_30.1 (constants.%ptr.e8f8f9.2)] -// CHECK:STDOUT: %.loc13_30.1: Core.Form = init_form %ptr.loc13_30.1 [symbolic = %.loc13_30.1 (constants.%.cb6cb9.2)] -// CHECK:STDOUT: %pattern_type.loc13_30: type = pattern_type %ptr.loc13_30.1 [symbolic = %pattern_type.loc13_30 (constants.%pattern_type.4f4b84.2)] +// CHECK:STDOUT: %pattern_type.loc13_12: type = pattern_type %A [symbolic = %pattern_type.loc13_12 (constants.%pattern_type.44a178.1)] +// CHECK:STDOUT: %ptr.loc13_22.1: type = ptr_type %V [symbolic = %ptr.loc13_22.1 (constants.%ptr.e8f8f9.2)] +// CHECK:STDOUT: %.loc13_22.1: Core.Form = init_form %ptr.loc13_22.1 [symbolic = %.loc13_22.1 (constants.%.cb6cb9.2)] +// CHECK:STDOUT: %pattern_type.loc13_22: type = pattern_type %ptr.loc13_22.1 [symbolic = %pattern_type.loc13_22 (constants.%pattern_type.4f4b84.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc13_16: = require_complete_type %A [symbolic = %require_complete.loc13_16 (constants.%require_complete.c7a)] -// CHECK:STDOUT: %require_complete.loc13_26: = require_complete_type %ptr.loc13_30.1 [symbolic = %require_complete.loc13_26 (constants.%require_complete.ef162c.1)] +// CHECK:STDOUT: %require_complete.loc13_12: = require_complete_type %A [symbolic = %require_complete.loc13_12 (constants.%require_complete.c7a)] +// CHECK:STDOUT: %require_complete.loc13_18: = require_complete_type %ptr.loc13_22.1 [symbolic = %require_complete.loc13_18 (constants.%require_complete.ef162c.1)] // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %V [symbolic = %A.elem (constants.%A.elem.d41ac1.2)] -// CHECK:STDOUT: %.loc14_12.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%V) [symbolic = %.loc14_12.1 (constants.%.0e9)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc13_30.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc13_30.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.302)] -// 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: %.loc14_12.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc14_12.2 (constants.%.be5)] -// CHECK:STDOUT: %impl.elem0.loc14_12.2: @A.as.I.impl.F.%.loc14_12.2 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.484)] -// CHECK:STDOUT: %specific_impl_fn.loc14_12.2: = specific_impl_function %impl.elem0.loc14_12.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc14_12.2 (constants.%specific_impl_fn.a76)] +// CHECK:STDOUT: %.loc14_12.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%V) [symbolic = %.loc14_12.2 (constants.%.0e9)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc13_22.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] +// CHECK:STDOUT: %Copy.facet.loc14_12.2: %Copy.type = facet_value %ptr.loc13_22.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc14_12.2 (constants.%Copy.facet.302)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc14_12.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)] +// CHECK:STDOUT: %.loc14_12.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc14_12.2 [symbolic = %.loc14_12.3 (constants.%.be5)] +// CHECK:STDOUT: %impl.elem0.loc14_12.2: @A.as.I.impl.F.%.loc14_12.3 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %specific_impl_fn.loc14_12.2: = specific_impl_function %impl.elem0.loc14_12.2, @Copy.WithSelf.Op(%Copy.facet.loc14_12.2) [symbolic = %specific_impl_fn.loc14_12.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: ref @A.as.I.impl.F.%A (%A.47a1de.2)) -> out %return.param: @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.e8f8f9.2) { +// CHECK:STDOUT: fn(%self.param: ref @A.as.I.impl.F.%A (%A.47a1de.2)) -> out %return.param: @A.as.I.impl.F.%ptr.loc13_22.1 (%ptr.e8f8f9.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: ref @A.as.I.impl.F.%A (%A.47a1de.2) = name_ref self, %self // CHECK:STDOUT: %n.ref: @A.as.I.impl.F.%A.elem (%A.elem.d41ac1.2) = name_ref n, @A.%.loc4 [concrete = @A.%.loc4] // CHECK:STDOUT: %.loc14_17: ref @A.as.I.impl.F.%V (%V.67d) = class_element_access %self.ref, element0 -// CHECK:STDOUT: %addr: @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.e8f8f9.2) = addr_of %.loc14_17 -// CHECK:STDOUT: %impl.elem0.loc14_12.1: @A.as.I.impl.F.%.loc14_12.2 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %addr: @A.as.I.impl.F.%ptr.loc13_22.1 (%ptr.e8f8f9.2) = addr_of %.loc14_17 +// CHECK:STDOUT: %impl.elem0.loc14_12.1: @A.as.I.impl.F.%.loc14_12.3 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc14_12.2 (constants.%impl.elem0.484)] // CHECK:STDOUT: %bound_method.loc14_12.1: = bound_method %addr, %impl.elem0.loc14_12.1 +// CHECK:STDOUT: %Copy.facet.loc14_12.1: %Copy.type = facet_value constants.%ptr.e8f8f9.2, (constants.%Copy.lookup_impl_witness.1da) [symbolic = %Copy.facet.loc14_12.2 (constants.%Copy.facet.302)] +// CHECK:STDOUT: %.loc14_12.1: %Copy.type = converted constants.%ptr.e8f8f9.2, %Copy.facet.loc14_12.1 [symbolic = %Copy.facet.loc14_12.2 (constants.%Copy.facet.302)] // CHECK:STDOUT: %specific_impl_fn.loc14_12.1: = specific_impl_function %impl.elem0.loc14_12.1, @Copy.WithSelf.Op(constants.%Copy.facet.302) [symbolic = %specific_impl_fn.loc14_12.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: %bound_method.loc14_12.2: = bound_method %addr, %specific_impl_fn.loc14_12.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @A.as.I.impl.F.%ptr.loc13_30.1 (%ptr.e8f8f9.2) = call %bound_method.loc14_12.2(%addr) +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @A.as.I.impl.F.%ptr.loc13_22.1 (%ptr.e8f8f9.2) = call %bound_method.loc14_12.2(%addr) // CHECK:STDOUT: return %Copy.WithSelf.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -252,7 +255,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %I.ref: %I.type.335 = name_ref I, file.%I.decl [concrete = constants.%I.generic] // CHECK:STDOUT: %W.ref.loc21: type = name_ref W, %W.loc19_17.2 [symbolic = %W.loc19_17.1 (constants.%W)] // CHECK:STDOUT: %I.type.loc21_17.1: type = facet_type <@I, @I(constants.%W)> [symbolic = %I.type.loc21_17.2 (constants.%I.type.3fe556.3)] -// CHECK:STDOUT: %.loc21_18: @TestGeneric.%I.assoc_type (%I.assoc_type.b71f2b.3) = specific_constant @I.WithSelf.%assoc0.loc8_31.1, @I.WithSelf(constants.%W, constants.%Self.1916c4.1) [symbolic = %assoc0 (constants.%assoc0.13b5f8.3)] +// CHECK:STDOUT: %.loc21_18: @TestGeneric.%I.assoc_type (%I.assoc_type.b71f2b.3) = specific_constant @I.WithSelf.%assoc0.loc8_23.1, @I.WithSelf(constants.%W, constants.%Self.1916c4.1) [symbolic = %assoc0 (constants.%assoc0.13b5f8.3)] // CHECK:STDOUT: %F.ref: @TestGeneric.%I.assoc_type (%I.assoc_type.b71f2b.3) = name_ref F, %.loc21_18 [symbolic = %assoc0 (constants.%assoc0.13b5f8.3)] // CHECK:STDOUT: %.loc21_11.1: ref @TestGeneric.%A.loc19_32.1 (%A.47a1de.3) = deref %a.ref // CHECK:STDOUT: %impl.elem0.loc21_11.1: @TestGeneric.%.loc21_11.3 (%.72b) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_11.2 (constants.%impl.elem0.089)] @@ -271,7 +274,7 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: %.loc27_17: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc27_18: type = converted %.loc27_17, constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%empty_struct_type)> [concrete = constants.%I.type.81d] -// CHECK:STDOUT: %.loc27_19: %I.assoc_type.cd3 = specific_constant @I.WithSelf.%assoc0.loc8_31.1, @I.WithSelf(constants.%empty_struct_type, constants.%Self.1916c4.1) [concrete = constants.%assoc0.a4c] +// CHECK:STDOUT: %.loc27_19: %I.assoc_type.cd3 = specific_constant @I.WithSelf.%assoc0.loc8_23.1, @I.WithSelf(constants.%empty_struct_type, constants.%Self.1916c4.1) [concrete = constants.%assoc0.a4c] // CHECK:STDOUT: %F.ref: %I.assoc_type.cd3 = name_ref F, %.loc27_19 [concrete = constants.%assoc0.a4c] // CHECK:STDOUT: %.loc27_11: ref %A.940 = deref %a.ref // CHECK:STDOUT: %impl.elem0: %.6b2 = impl_witness_access constants.%I.impl_witness.e69, element0 [concrete = constants.%A.as.I.impl.F.837] @@ -297,10 +300,10 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: specific @A.as.I.impl.F(constants.%V.67d) { // CHECK:STDOUT: %V => constants.%V.67d // CHECK:STDOUT: %A => constants.%A.47a1de.2 -// CHECK:STDOUT: %pattern_type.loc13_16 => constants.%pattern_type.44a178.1 -// CHECK:STDOUT: %ptr.loc13_30.1 => constants.%ptr.e8f8f9.2 -// CHECK:STDOUT: %.loc13_30.1 => constants.%.cb6cb9.2 -// CHECK:STDOUT: %pattern_type.loc13_30 => constants.%pattern_type.4f4b84.2 +// CHECK:STDOUT: %pattern_type.loc13_12 => constants.%pattern_type.44a178.1 +// CHECK:STDOUT: %ptr.loc13_22.1 => constants.%ptr.e8f8f9.2 +// CHECK:STDOUT: %.loc13_22.1 => constants.%.cb6cb9.2 +// CHECK:STDOUT: %pattern_type.loc13_22 => constants.%pattern_type.4f4b84.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TestGeneric(constants.%W) { @@ -340,20 +343,20 @@ fn TestSpecific(a: A({})*) -> {}* { // CHECK:STDOUT: specific @A.as.I.impl.F(constants.%empty_struct_type) { // CHECK:STDOUT: %V => constants.%empty_struct_type // CHECK:STDOUT: %A => constants.%A.940 -// CHECK:STDOUT: %pattern_type.loc13_16 => constants.%pattern_type.1ff -// CHECK:STDOUT: %ptr.loc13_30.1 => constants.%ptr.c28 -// CHECK:STDOUT: %.loc13_30.1 => constants.%.9ba -// CHECK:STDOUT: %pattern_type.loc13_30 => constants.%pattern_type.1cc +// CHECK:STDOUT: %pattern_type.loc13_12 => constants.%pattern_type.1ff +// CHECK:STDOUT: %ptr.loc13_22.1 => constants.%ptr.c28 +// CHECK:STDOUT: %.loc13_22.1 => constants.%.9ba +// CHECK:STDOUT: %pattern_type.loc13_22 => constants.%pattern_type.1cc // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc13_16 => constants.%complete_type.0a6 -// CHECK:STDOUT: %require_complete.loc13_26 => constants.%complete_type.38e +// CHECK:STDOUT: %require_complete.loc13_12 => constants.%complete_type.0a6 +// CHECK:STDOUT: %require_complete.loc13_18 => constants.%complete_type.38e // CHECK:STDOUT: %A.elem => constants.%A.elem.339 -// CHECK:STDOUT: %.loc14_12.1 => constants.%.a81 +// CHECK:STDOUT: %.loc14_12.2 => constants.%.a81 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.1c2 -// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.80f +// CHECK:STDOUT: %Copy.facet.loc14_12.2 => constants.%Copy.facet.80f // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.8a4 -// CHECK:STDOUT: %.loc14_12.2 => constants.%.523 +// CHECK:STDOUT: %.loc14_12.3 => constants.%.523 // CHECK:STDOUT: %impl.elem0.loc14_12.2 => constants.%ptr.as.Copy.impl.Op.9ed // CHECK:STDOUT: %specific_impl_fn.loc14_12.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index d27ce8fdefe9..c76921dc7f9a 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -17,14 +17,14 @@ package PackageA; interface HasF { - fn F[self: Self](); + fn F(self); } class C {} // Same library as the class and interface. impl C as HasF { - fn F[unused self: Self]() {} + fn F(unused self) {} } // --- package_b.carbon @@ -34,24 +34,24 @@ package PackageB; import PackageA; interface HasG { - fn G[self: Self](); + fn G(self); } class D {} // Same library as the interface. impl PackageA.C as HasG { - fn G[unused self: Self]() {} + fn G(unused self) {} } // Same library as the class. impl D as PackageA.HasF { - fn F[unused self: Self]() {} + fn F(unused self) {} } // Same library as the class and interface. impl D as HasG { - fn G[unused self: Self]() {} + fn G(unused self) {} } // --- use_cf.carbon @@ -102,11 +102,11 @@ fn TestDG(d: PackageB.D) { package PackageAssociatedInterface; interface Z { - fn H[self: Self](); + fn H(self); } impl () as Z { - fn H[unused self: Self]() {} + fn H(unused self) {} } // --- import_associated_interface.carbon @@ -126,7 +126,7 @@ package PackageHasParam; class AnyParam[T:! type](X:! T) {} interface Y { - fn K[unused self: Self]() {} + fn K(unused self) {} } // --- has_generic_interface.carbon @@ -138,7 +138,7 @@ import PackageHasParam; interface GenericInterface(U:! type) {} impl PackageHasParam.AnyParam(GenericInterface) as PackageHasParam.Y { - fn K[unused self: Self]() {} + fn K(unused self) {} } fn L() { @@ -168,7 +168,7 @@ import PackageHasParam; class GenericClass(U:! type) {} impl PackageHasParam.AnyParam(GenericClass) as PackageHasParam.Y { - fn K[unused self: Self]() {} + fn K(unused self) {} } fn L() { @@ -202,10 +202,10 @@ interface Extra7 {} interface Extra8 {} class C(T:! type) {} -interface I { fn F[self: Self](); } +interface I { fn F(self); } impl C((Extra1, Extra2, Extra3, Extra4, Extra5, Extra6, Extra7, Extra8)) as I { - fn F[unused self: Self]() {} + fn F(unused self) {} } // --- fail_use_has_extra_interfaces.carbon @@ -223,6 +223,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { c.(HasExtraInterfaces.I.F)(); } + // CHECK:STDOUT: --- package_a.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -277,13 +278,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.param_patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.f71) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @HasF.WithSelf.F.%pattern_type (%pattern_type.f71) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %HasF.type = name_ref Self, @HasF.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.2: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasF.assoc_type = assoc_entity element0, %HasF.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -323,10 +324,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasF.WithSelf.F(@HasF.%Self: %HasF.type) { // CHECK:STDOUT: %Self: %HasF.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.f71)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.f71)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @HasF.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.HasF.impl.F(%self.param: %C) { @@ -343,7 +344,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f71 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -356,7 +357,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasF.WithSelf.F(constants.%HasF.facet) { // CHECK:STDOUT: %Self => constants.%HasF.facet -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%C +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%C // CHECK:STDOUT: %pattern_type => constants.%pattern_type.866 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -417,7 +418,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageA.import_ref.8f2: = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %PackageA.import_ref.ce9 = import_ref PackageA//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageA.HasF: type = import_ref PackageA//default, HasF, loaded [concrete = constants.%HasF.type] -// CHECK:STDOUT: %PackageA.import_ref.a23 = import_ref PackageA//default, loc5_21, unloaded +// CHECK:STDOUT: %PackageA.import_ref.a23 = import_ref PackageA//default, loc5_13, unloaded // CHECK:STDOUT: %PackageA.F: @HasF.WithSelf.%HasF.WithSelf.F.type (%HasF.WithSelf.F.type.c4f) = import_ref PackageA//default, F, loaded [symbolic = @HasF.WithSelf.%HasF.WithSelf.F (constants.%HasF.WithSelf.F.c56)] // CHECK:STDOUT: %PackageA.import_ref.b7072f.2: %HasF.type = import_ref PackageA//default, loc4_16, loaded [symbolic = constants.%Self.4dc] // CHECK:STDOUT: %PackageA.import_ref.15c = import_ref PackageA//default, loc4_16, unloaded @@ -459,13 +460,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.param_patt: @HasG.WithSelf.G.%pattern_type (%pattern_type.bfc) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @HasG.WithSelf.G.%pattern_type (%pattern_type.bfc) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @HasG.WithSelf.G.%Self.as_type.loc7_14.1 (%Self.as_type.dd3) = value_param call_param0 -// CHECK:STDOUT: %.loc7_14.1: type = splice_block %.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.dd3)] { +// CHECK:STDOUT: %self.param: @HasG.WithSelf.G.%Self.as_type.loc7_8.1 (%Self.as_type.dd3) = value_param call_param0 +// CHECK:STDOUT: %.loc7_8.1: type = splice_block %.loc7_8.2 [symbolic = %Self.as_type.loc7_8.1 (constants.%Self.as_type.dd3)] { // CHECK:STDOUT: %Self.ref: %HasG.type = name_ref Self, @HasG.%Self [symbolic = %Self (constants.%Self.150)] -// CHECK:STDOUT: %Self.as_type.loc7_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.dd3)] -// CHECK:STDOUT: %.loc7_14.2: type = converted %Self.ref, %Self.as_type.loc7_14.2 [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.dd3)] +// CHECK:STDOUT: %Self.as_type.loc7_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_8.1 (constants.%Self.as_type.dd3)] +// CHECK:STDOUT: %.loc7_8.2: type = converted %Self.ref, %Self.as_type.loc7_8.2 [symbolic = %Self.as_type.loc7_8.1 (constants.%Self.as_type.dd3)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @HasG.WithSelf.G.%Self.as_type.loc7_14.1 (%Self.as_type.dd3) = value_binding self, %self.param +// CHECK:STDOUT: %self: @HasG.WithSelf.G.%Self.as_type.loc7_8.1 (%Self.as_type.dd3) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %HasG.assoc_type = assoc_entity element0, %HasG.WithSelf.G.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -557,10 +558,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @HasG.WithSelf.G(@HasG.%Self: %HasG.type) { // CHECK:STDOUT: %Self: %HasG.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.150)] -// CHECK:STDOUT: %Self.as_type.loc7_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc7_14.1 (constants.%Self.as_type.dd3)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_14.1 [symbolic = %pattern_type (constants.%pattern_type.bfc)] +// CHECK:STDOUT: %Self.as_type.loc7_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc7_8.1 (constants.%Self.as_type.dd3)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_8.1 [symbolic = %pattern_type (constants.%pattern_type.bfc)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @HasG.WithSelf.G.%Self.as_type.loc7_14.1 (%Self.as_type.dd3)); +// CHECK:STDOUT: fn(%self.param: @HasG.WithSelf.G.%Self.as_type.loc7_8.1 (%Self.as_type.dd3)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.HasG.impl.G(%self.param: %C) { @@ -595,7 +596,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasG.WithSelf.G(constants.%Self.150) { // CHECK:STDOUT: %Self => constants.%Self.150 -// CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%Self.as_type.dd3 +// CHECK:STDOUT: %Self.as_type.loc7_8.1 => constants.%Self.as_type.dd3 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.bfc // CHECK:STDOUT: } // CHECK:STDOUT: @@ -608,7 +609,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasG.WithSelf.G(constants.%HasG.facet.fa2) { // CHECK:STDOUT: %Self => constants.%HasG.facet.fa2 -// CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%C +// CHECK:STDOUT: %Self.as_type.loc7_8.1 => constants.%C // CHECK:STDOUT: %pattern_type => constants.%pattern_type.866 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -647,7 +648,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @HasG.WithSelf.G(constants.%HasG.facet.16a) { // CHECK:STDOUT: %Self => constants.%HasG.facet.16a -// CHECK:STDOUT: %Self.as_type.loc7_14.1 => constants.%D +// CHECK:STDOUT: %Self.as_type.loc7_8.1 => constants.%D // CHECK:STDOUT: %pattern_type => constants.%pattern_type.709 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -692,15 +693,15 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageA.import_ref.8f2: = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %PackageA.import_ref.ce9 = import_ref PackageA//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageA.HasF: type = import_ref PackageA//default, HasF, loaded [concrete = constants.%HasF.type] -// CHECK:STDOUT: %PackageA.import_ref.dff: %HasF.assoc_type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %PackageA.import_ref.dff: %HasF.assoc_type = import_ref PackageA//default, loc5_13, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageA.F = import_ref PackageA//default, F, unloaded // CHECK:STDOUT: %PackageA.import_ref.b7072f.2: %HasF.type = import_ref PackageA//default, loc4_16, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %PackageA.import_ref.15c = import_ref PackageA//default, loc4_16, unloaded -// CHECK:STDOUT: %PackageA.import_ref.91e: @HasF.WithSelf.%HasF.WithSelf.F.type (%HasF.WithSelf.F.type.c4f) = import_ref PackageA//default, loc5_21, loaded [symbolic = @HasF.WithSelf.%HasF.WithSelf.F (constants.%HasF.WithSelf.F.c56)] +// CHECK:STDOUT: %PackageA.import_ref.91e: @HasF.WithSelf.%HasF.WithSelf.F.type (%HasF.WithSelf.F.type.c4f) = import_ref PackageA//default, loc5_13, loaded [symbolic = @HasF.WithSelf.%HasF.WithSelf.F (constants.%HasF.WithSelf.F.c56)] // CHECK:STDOUT: %PackageA.import_ref.7b8: = import_ref PackageA//default, loc11_16, loaded [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: %PackageA.import_ref.364: type = import_ref PackageA//default, loc11_6, loaded [concrete = constants.%C] // CHECK:STDOUT: %PackageA.import_ref.e71: type = import_ref PackageA//default, loc11_11, loaded [concrete = constants.%HasF.type] -// CHECK:STDOUT: %PackageA.import_ref.448: %C.as.HasF.impl.F.type = import_ref PackageA//default, loc12_29, loaded [concrete = constants.%C.as.HasF.impl.F] +// CHECK:STDOUT: %PackageA.import_ref.448: %C.as.HasF.impl.F.type = import_ref PackageA//default, loc12_21, loaded [concrete = constants.%C.as.HasF.impl.F] // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageA.import_ref.448), @C.as.HasF.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -833,11 +834,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.8f2: = import_ref PackageB//default, loc10_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %PackageB.import_ref.26f = import_ref PackageB//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageA.HasF: type = import_ref PackageA//default, HasF, loaded [concrete = constants.%HasF.type] -// CHECK:STDOUT: %PackageA.import_ref.dff: %HasF.assoc_type = import_ref PackageA//default, loc5_21, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %PackageA.import_ref.dff: %HasF.assoc_type = import_ref PackageA//default, loc5_13, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageA.F = import_ref PackageA//default, F, unloaded // CHECK:STDOUT: %PackageA.import_ref.b7072f.2: %HasF.type = import_ref PackageA//default, loc4_16, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %PackageA.import_ref.15c = import_ref PackageA//default, loc4_16, unloaded -// CHECK:STDOUT: %PackageA.import_ref.91e: @HasF.WithSelf.%HasF.WithSelf.F.type (%HasF.WithSelf.F.type.c4f) = import_ref PackageA//default, loc5_21, loaded [symbolic = @HasF.WithSelf.%HasF.WithSelf.F (constants.%HasF.WithSelf.F.c56)] +// CHECK:STDOUT: %PackageA.import_ref.91e: @HasF.WithSelf.%HasF.WithSelf.F.type (%HasF.WithSelf.F.type.c4f) = import_ref PackageA//default, loc5_13, loaded [symbolic = @HasF.WithSelf.%HasF.WithSelf.F (constants.%HasF.WithSelf.F.c56)] // CHECK:STDOUT: %PackageA.import_ref.b97 = import_ref PackageA//default, loc11_16, unloaded // CHECK:STDOUT: %PackageA.import_ref.8f2: = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %PackageA.import_ref.ce9 = import_ref PackageA//default, inst{{[0-9A-F]+}} [no loc], unloaded @@ -846,7 +847,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.b78: = import_ref PackageB//default, loc18_25, loaded [concrete = constants.%HasF.impl_witness] // CHECK:STDOUT: %PackageB.import_ref.624: type = import_ref PackageB//default, loc18_6, loaded [concrete = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.876: type = import_ref PackageB//default, loc18_19, loaded [concrete = constants.%HasF.type] -// CHECK:STDOUT: %PackageB.import_ref.2df: %D.as.HasF.impl.F.type = import_ref PackageB//default, loc19_29, loaded [concrete = constants.%D.as.HasF.impl.F] +// CHECK:STDOUT: %PackageB.import_ref.2df: %D.as.HasF.impl.F.type = import_ref PackageB//default, loc19_21, loaded [concrete = constants.%D.as.HasF.impl.F] // CHECK:STDOUT: %HasF.impl_witness_table = impl_witness_table (%PackageB.import_ref.2df), @D.as.HasF.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -993,11 +994,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageA.import_ref.8f2: = import_ref PackageA//default, loc8_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %PackageA.import_ref.ce9 = import_ref PackageA//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageB.HasG: type = import_ref PackageB//default, HasG, loaded [concrete = constants.%HasG.type] -// CHECK:STDOUT: %PackageB.import_ref.d25: %HasG.assoc_type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %PackageB.import_ref.d25: %HasG.assoc_type = import_ref PackageB//default, loc7_13, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageB.G = import_ref PackageB//default, G, unloaded // CHECK:STDOUT: %PackageB.import_ref.10cb76.2: %HasG.type = import_ref PackageB//default, loc6_16, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %PackageB.import_ref.d8d = import_ref PackageB//default, loc6_16, unloaded -// CHECK:STDOUT: %PackageB.import_ref.89b: @HasG.WithSelf.%HasG.WithSelf.G.type (%HasG.WithSelf.G.type.95e) = import_ref PackageB//default, loc7_21, loaded [symbolic = @HasG.WithSelf.%HasG.WithSelf.G (constants.%HasG.WithSelf.G.50a)] +// CHECK:STDOUT: %PackageB.import_ref.89b: @HasG.WithSelf.%HasG.WithSelf.G.type (%HasG.WithSelf.G.type.95e) = import_ref PackageB//default, loc7_13, loaded [symbolic = @HasG.WithSelf.%HasG.WithSelf.G (constants.%HasG.WithSelf.G.50a)] // CHECK:STDOUT: %PackageB.import_ref.588: = import_ref PackageB//default, loc13_25, loaded [concrete = constants.%HasG.impl_witness] // CHECK:STDOUT: %PackageB.import_ref.473: type = import_ref PackageB//default, loc13_14, loaded [concrete = constants.%C] // CHECK:STDOUT: %PackageB.import_ref.e35e93.1: type = import_ref PackageB//default, loc13_20, loaded [concrete = constants.%HasG.type] @@ -1006,7 +1007,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.26f = import_ref PackageB//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageB.import_ref.624: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.e35e93.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type] -// CHECK:STDOUT: %PackageB.import_ref.98c: %C.as.HasG.impl.G.type = import_ref PackageB//default, loc14_29, loaded [concrete = constants.%C.as.HasG.impl.G] +// CHECK:STDOUT: %PackageB.import_ref.98c: %C.as.HasG.impl.G.type = import_ref PackageB//default, loc14_21, loaded [concrete = constants.%C.as.HasG.impl.G] // CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.98c), @C.as.HasG.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1150,11 +1151,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.8f2: = import_ref PackageB//default, loc10_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %PackageB.import_ref.26f = import_ref PackageB//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageB.HasG: type = import_ref PackageB//default, HasG, loaded [concrete = constants.%HasG.type] -// CHECK:STDOUT: %PackageB.import_ref.d25: %HasG.assoc_type = import_ref PackageB//default, loc7_21, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %PackageB.import_ref.d25: %HasG.assoc_type = import_ref PackageB//default, loc7_13, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageB.G = import_ref PackageB//default, G, unloaded // CHECK:STDOUT: %PackageB.import_ref.10cb76.2: %HasG.type = import_ref PackageB//default, loc6_16, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %PackageB.import_ref.d8d = import_ref PackageB//default, loc6_16, unloaded -// CHECK:STDOUT: %PackageB.import_ref.89b: @HasG.WithSelf.%HasG.WithSelf.G.type (%HasG.WithSelf.G.type.95e) = import_ref PackageB//default, loc7_21, loaded [symbolic = @HasG.WithSelf.%HasG.WithSelf.G (constants.%HasG.WithSelf.G.50a)] +// CHECK:STDOUT: %PackageB.import_ref.89b: @HasG.WithSelf.%HasG.WithSelf.G.type (%HasG.WithSelf.G.type.95e) = import_ref PackageB//default, loc7_13, loaded [symbolic = @HasG.WithSelf.%HasG.WithSelf.G (constants.%HasG.WithSelf.G.50a)] // CHECK:STDOUT: %PackageB.import_ref.720 = import_ref PackageB//default, loc13_25, unloaded // CHECK:STDOUT: %PackageB.import_ref.8db: = import_ref PackageB//default, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %PackageB.import_ref.ded = import_ref PackageB//default, inst{{[0-9A-F]+}} [indirect], unloaded @@ -1163,7 +1164,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageB.import_ref.3cd: = import_ref PackageB//default, loc23_16, loaded [concrete = constants.%HasG.impl_witness] // CHECK:STDOUT: %PackageB.import_ref.624: type = import_ref PackageB//default, loc23_6, loaded [concrete = constants.%D] // CHECK:STDOUT: %PackageB.import_ref.e35e93.2: type = import_ref PackageB//default, loc23_11, loaded [concrete = constants.%HasG.type] -// CHECK:STDOUT: %PackageB.import_ref.98c: %D.as.HasG.impl.G.type = import_ref PackageB//default, loc24_29, loaded [concrete = constants.%D.as.HasG.impl.G] +// CHECK:STDOUT: %PackageB.import_ref.98c: %D.as.HasG.impl.G.type = import_ref PackageB//default, loc24_21, loaded [concrete = constants.%D.as.HasG.impl.G] // CHECK:STDOUT: %HasG.impl_witness_table = impl_witness_table (%PackageB.import_ref.98c), @D.as.HasG.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1315,13 +1316,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.param_patt: @Z.WithSelf.H.%pattern_type (%pattern_type.a8e) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Z.WithSelf.H.%pattern_type (%pattern_type.a8e) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Z.WithSelf.H.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @Z.WithSelf.H.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %Z.type = name_ref Self, @Z.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.2: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Z.WithSelf.H.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Z.WithSelf.H.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.WithSelf.H.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -1353,10 +1354,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Z.WithSelf.H(@Z.%Self: %Z.type) { // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.a8e)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.a8e)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Z.WithSelf.H.%Self.as_type.loc5_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @Z.WithSelf.H.%Self.as_type.loc5_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @empty_tuple.type.as.Z.impl.H(%self.param: %empty_tuple.type) { @@ -1373,7 +1374,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Z.WithSelf.H(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a8e // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1386,7 +1387,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Z.WithSelf.H(constants.%Z.facet) { // CHECK:STDOUT: %Self => constants.%Z.facet -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%empty_tuple.type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%empty_tuple.type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1425,15 +1426,15 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: import PackageAssociatedInterface//default // CHECK:STDOUT: } // CHECK:STDOUT: %PackageAssociatedInterface.Z: type = import_ref PackageAssociatedInterface//default, Z, loaded [concrete = constants.%Z.type] -// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.a7b: %Z.assoc_type = import_ref PackageAssociatedInterface//default, loc5_21, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.a7b: %Z.assoc_type = import_ref PackageAssociatedInterface//default, loc5_13, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageAssociatedInterface.H = import_ref PackageAssociatedInterface//default, H, unloaded // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.f4f417.2: %Z.type = import_ref PackageAssociatedInterface//default, loc4_13, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.503 = import_ref PackageAssociatedInterface//default, loc4_13, unloaded -// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.635: @Z.WithSelf.%Z.WithSelf.H.type (%Z.WithSelf.H.type.e28) = import_ref PackageAssociatedInterface//default, loc5_21, loaded [symbolic = @Z.WithSelf.%Z.WithSelf.H (constants.%Z.WithSelf.H.6ec)] +// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.635: @Z.WithSelf.%Z.WithSelf.H.type (%Z.WithSelf.H.type.e28) = import_ref PackageAssociatedInterface//default, loc5_13, loaded [symbolic = @Z.WithSelf.%Z.WithSelf.H (constants.%Z.WithSelf.H.6ec)] // CHECK:STDOUT: %PackageAssociatedInterface.import_ref.6bc: = 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.72a: type = import_ref PackageAssociatedInterface//default, loc8_12, loaded [concrete = constants.%Z.type] -// CHECK:STDOUT: %PackageAssociatedInterface.import_ref.7f2: %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: %PackageAssociatedInterface.import_ref.7f2: %empty_tuple.type.as.Z.impl.H.type = import_ref PackageAssociatedInterface//default, loc9_21, loaded [concrete = constants.%empty_tuple.type.as.Z.impl.H] // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (%PackageAssociatedInterface.import_ref.7f2), @empty_tuple.type.as.Z.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1572,13 +1573,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.param_patt: @Y.WithSelf.K.%pattern_type (%pattern_type.28b) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Y.WithSelf.K.%pattern_type (%pattern_type.28b) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Y.WithSelf.K.%Self.as_type.loc7_21.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc7_21.1: type = splice_block %.loc7_21.2 [symbolic = %Self.as_type.loc7_21.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @Y.WithSelf.K.%Self.as_type.loc7_15.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc7_15.1: type = splice_block %.loc7_15.2 [symbolic = %Self.as_type.loc7_15.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %Y.type = name_ref Self, @Y.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc7_21.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_21.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc7_21.2: type = converted %Self.ref, %Self.as_type.loc7_21.2 [symbolic = %Self.as_type.loc7_21.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc7_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc7_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc7_15.2: type = converted %Self.ref, %Self.as_type.loc7_15.2 [symbolic = %Self.as_type.loc7_15.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Y.WithSelf.K.%Self.as_type.loc7_21.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Y.WithSelf.K.%Self.as_type.loc7_15.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, %Y.WithSelf.K.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -1608,13 +1609,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Y.WithSelf.K(@Y.%Self: %Y.type) { // CHECK:STDOUT: %Self: %Y.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc7_21.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc7_21.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_21.1 [symbolic = %pattern_type (constants.%pattern_type.28b)] +// CHECK:STDOUT: %Self.as_type.loc7_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc7_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc7_15.1 [symbolic = %pattern_type (constants.%pattern_type.28b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc7_21.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc7_15.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Y.WithSelf.K.%Self.as_type.loc7_21.1 (%Self.as_type)) { +// CHECK:STDOUT: fn(%self.param: @Y.WithSelf.K.%Self.as_type.loc7_15.1 (%Self.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -1635,7 +1636,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Y.WithSelf.K(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc7_21.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc7_15.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.28b // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1703,11 +1704,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.import_ref.b3b: type = import_ref PackageHasParam//default, loc4_17, loaded [symbolic = @AnyParam.%T (constants.%T)] // CHECK:STDOUT: %PackageHasParam.import_ref.b42: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_27, 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.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0.970] // CHECK:STDOUT: %PackageHasParam.K: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, K, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] // CHECK:STDOUT: %PackageHasParam.import_ref.fa191b.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.aff] // CHECK:STDOUT: %PackageHasParam.import_ref.2ff = import_ref PackageHasParam//default, loc6_13, unloaded -// CHECK:STDOUT: %PackageHasParam.import_ref.ee7: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] +// CHECK:STDOUT: %PackageHasParam.import_ref.ee7: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, loc7_21, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1969,15 +1970,15 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageGenericInterface.import_ref.b00 = import_ref PackageGenericInterface//default, loc6_38, unloaded // CHECK:STDOUT: %PackageGenericInterface.import_ref.b3bc94.2: type = import_ref PackageGenericInterface//default, loc6_29, 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.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0.970] // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded // CHECK:STDOUT: %PackageHasParam.import_ref.fa191b.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.aff] // CHECK:STDOUT: %PackageHasParam.import_ref.2ff = import_ref PackageHasParam//default, loc6_13, unloaded -// CHECK:STDOUT: %PackageHasParam.import_ref.ee7: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] +// CHECK:STDOUT: %PackageHasParam.import_ref.ee7: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, loc7_21, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] // CHECK:STDOUT: %PackageGenericInterface.import_ref.b38: = import_ref PackageGenericInterface//default, loc8_70, loaded [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: %PackageGenericInterface.import_ref.82e: type = import_ref PackageGenericInterface//default, loc8_47, loaded [concrete = constants.%AnyParam.591] // CHECK:STDOUT: %PackageGenericInterface.import_ref.482: type = import_ref PackageGenericInterface//default, loc8_67, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageGenericInterface.import_ref.49f: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericInterface//default, loc9_29, loaded [concrete = constants.%AnyParam.as.Y.impl.K] +// CHECK:STDOUT: %PackageGenericInterface.import_ref.49f: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericInterface//default, loc9_21, loaded [concrete = constants.%AnyParam.as.Y.impl.K] // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericInterface.import_ref.49f), @AnyParam.as.Y.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } @@ -2195,11 +2196,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.import_ref.b3b: type = import_ref PackageHasParam//default, loc4_17, loaded [symbolic = @AnyParam.%T (constants.%T)] // CHECK:STDOUT: %PackageHasParam.import_ref.b42: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_27, 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.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0.970] // CHECK:STDOUT: %PackageHasParam.K: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, K, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] // CHECK:STDOUT: %PackageHasParam.import_ref.fa191b.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.aff] // CHECK:STDOUT: %PackageHasParam.import_ref.2ff = import_ref PackageHasParam//default, loc6_13, unloaded -// CHECK:STDOUT: %PackageHasParam.import_ref.ee7: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] +// CHECK:STDOUT: %PackageHasParam.import_ref.ee7: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, loc7_21, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2453,15 +2454,15 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageGenericClass.import_ref.772 = import_ref PackageGenericClass//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageGenericClass.import_ref.b3b: type = import_ref PackageGenericClass//default, loc6_21, 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.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_29, loaded [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0.970] // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded // CHECK:STDOUT: %PackageHasParam.import_ref.fa191b.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.aff] // CHECK:STDOUT: %PackageHasParam.import_ref.2ff = import_ref PackageHasParam//default, loc6_13, unloaded -// CHECK:STDOUT: %PackageHasParam.import_ref.ee7: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, loc7_29, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] +// CHECK:STDOUT: %PackageHasParam.import_ref.ee7: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, loc7_21, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] // CHECK:STDOUT: %PackageGenericClass.import_ref.28c: = import_ref PackageGenericClass//default, loc8_66, loaded [concrete = constants.%Y.impl_witness] // CHECK:STDOUT: %PackageGenericClass.import_ref.c77: type = import_ref PackageGenericClass//default, loc8_43, loaded [concrete = constants.%AnyParam.21c] // CHECK:STDOUT: %PackageGenericClass.import_ref.482: type = import_ref PackageGenericClass//default, loc8_63, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageGenericClass.import_ref.64c: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericClass//default, loc9_29, loaded [concrete = constants.%AnyParam.as.Y.impl.K] +// CHECK:STDOUT: %PackageGenericClass.import_ref.64c: %AnyParam.as.Y.impl.K.type = import_ref PackageGenericClass//default, loc9_21, loaded [concrete = constants.%AnyParam.as.Y.impl.K] // CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (%PackageGenericClass.import_ref.64c), @AnyParam.as.Y.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } @@ -2814,13 +2815,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type.919) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type (%pattern_type.919) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc14_26.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc14_26.1: type = splice_block %.loc14_26.2 [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc14_20.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.2 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.155)] -// CHECK:STDOUT: %Self.as_type.loc14_26.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc14_26.2: type = converted %Self.ref, %Self.as_type.loc14_26.2 [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc14_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc14_20.2: type = converted %Self.ref, %Self.as_type.loc14_20.2 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc14_26.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc14_20.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -2866,10 +2867,10 @@ fn Test(c: HasExtraInterfaces.C(type)) { // 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.155)] -// CHECK:STDOUT: %Self.as_type.loc14_26.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_26.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc14_26.1 [symbolic = %pattern_type (constants.%pattern_type.919)] +// CHECK:STDOUT: %Self.as_type.loc14_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc14_20.1 [symbolic = %pattern_type (constants.%pattern_type.919)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc14_26.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc14_20.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.I.impl.F(%self.param: %C.279) { @@ -2906,7 +2907,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self.155) { // CHECK:STDOUT: %Self => constants.%Self.155 -// CHECK:STDOUT: %Self.as_type.loc14_26.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.919 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2925,7 +2926,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) { // CHECK:STDOUT: %Self => constants.%I.facet -// CHECK:STDOUT: %Self.as_type.loc14_26.1 => constants.%C.279 +// CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%C.279 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.881 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2984,11 +2985,11 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %HasExtraInterfaces.import_ref.0f9 = import_ref HasExtraInterfaces//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %HasExtraInterfaces.import_ref.b3b: type = import_ref HasExtraInterfaces//default, loc13_10, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %HasExtraInterfaces.I: type = import_ref HasExtraInterfaces//default, I, loaded [concrete = constants.%I.type] -// CHECK:STDOUT: %HasExtraInterfaces.import_ref.8f6: %I.assoc_type = import_ref HasExtraInterfaces//default, loc14_33, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %HasExtraInterfaces.import_ref.8f6: %I.assoc_type = import_ref HasExtraInterfaces//default, loc14_25, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %HasExtraInterfaces.F = import_ref HasExtraInterfaces//default, F, unloaded // CHECK:STDOUT: %HasExtraInterfaces.import_ref.51a236.2: %I.type = import_ref HasExtraInterfaces//default, loc14_13, loaded [symbolic = constants.%Self.b29] // CHECK:STDOUT: %HasExtraInterfaces.import_ref.ca1 = import_ref HasExtraInterfaces//default, loc14_13, unloaded -// CHECK:STDOUT: %HasExtraInterfaces.import_ref.f85: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type) = import_ref HasExtraInterfaces//default, loc14_33, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F)] +// CHECK:STDOUT: %HasExtraInterfaces.import_ref.f85: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type) = import_ref HasExtraInterfaces//default, loc14_25, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F)] // CHECK:STDOUT: %HasExtraInterfaces.import_ref.16c = import_ref HasExtraInterfaces//default, loc16_79, unloaded // CHECK:STDOUT: %HasExtraInterfaces.import_ref.9a3 = import_ref HasExtraInterfaces//default, loc11_18, unloaded // CHECK:STDOUT: %HasExtraInterfaces.import_ref.c9e = import_ref HasExtraInterfaces//default, loc10_18, unloaded diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 74b60b529787..695cc10e9d6a 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -15,12 +15,12 @@ class C; interface I { - fn F[self: Self]() -> i32; + fn F(self) -> i32; } class C { extend impl as I { - fn F[self: Self]() -> i32; + fn F(self) -> i32; } } @@ -28,6 +28,7 @@ fn F(c: C) -> i32 { return c.F(); } + // CHECK:STDOUT: --- instance_method.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -112,14 +113,14 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc18_25: Core.Form = init_form %i32 [concrete = constants.%.795] -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc18_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc18_14.1: type = splice_block %.loc18_14.2 [symbolic = %Self.as_type.loc18_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc18_17: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc18_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc18_8.1: type = splice_block %.loc18_8.2 [symbolic = %Self.as_type.loc18_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc18_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc18_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc18_14.2: type = converted %Self.ref, %Self.as_type.loc18_14.2 [symbolic = %Self.as_type.loc18_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc18_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc18_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc18_8.2: type = converted %Self.ref, %Self.as_type.loc18_8.2 [symbolic = %Self.as_type.loc18_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc18_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc18_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -174,10 +175,10 @@ fn F(c: C) -> i32 { // 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)] -// CHECK:STDOUT: %Self.as_type.loc18_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc18_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc18_14.1 [symbolic = %pattern_type (constants.%pattern_type.c60)] +// CHECK:STDOUT: %Self.as_type.loc18_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc18_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc18_8.1 [symbolic = %pattern_type (constants.%pattern_type.c60)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc18_14.1 (%Self.as_type)) -> out %return.param: %i32; +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc18_8.1 (%Self.as_type)) -> out %return.param: %i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.I.impl.F(%self.param: %C) -> out %return.param: %i32; @@ -201,7 +202,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc18_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc18_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c60 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -214,7 +215,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) { // CHECK:STDOUT: %Self => constants.%I.facet -// CHECK:STDOUT: %Self.as_type.loc18_14.1 => constants.%C +// CHECK:STDOUT: %Self.as_type.loc18_8.1 => constants.%C // CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/specialization_poison.carbon b/toolchain/check/testdata/impl/lookup/specialization_poison.carbon index f62a4d7d90cb..ac41ebe20a8c 100644 --- a/toolchain/check/testdata/impl/lookup/specialization_poison.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization_poison.carbon @@ -15,11 +15,11 @@ library "[[@TEST_NAME]]"; interface I { let T:! type; - fn F[self: Self]() -> T; + fn F(self) -> T; } impl forall [U:! type] U as I where .T = () { - fn F[unused self: Self]() -> () { return (); } + fn F(unused 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] @@ -44,7 +44,7 @@ fn G(p: C*) -> () { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: impl C* as I where .T = C { - fn F[self: Self]() -> C { return *self; } + fn F(self) -> C { return *self; } } // --- fail_final_poisoned_concrete_query_in_generic.carbon @@ -80,13 +80,13 @@ library "[[@TEST_NAME]]"; interface I { let T:! type; - fn F[self: Self]() -> T; + fn F(self) -> T; } class C(U:! type) {} impl forall [U:! type] C(U) as I where .T = () { - fn F[unused self: Self]() -> () { return (); } + fn F(unused 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[unused self: Self]() -> {} { return {}; } + fn F(unused self) -> {} { return {}; } } // --- fail_final_poisoned_concrete_query_nested_type_in_interface.carbon @@ -113,11 +113,11 @@ library "[[@TEST_NAME]]"; interface I(U:! type) { let T:! type; - fn F[self: Self]() -> T; + fn F(self) -> T; } impl forall [U:! type] U as I(U) where .T = () { - fn F[unused self: Self]() -> () { return (); } + fn F(unused 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[unused self: Self]() -> {} { return {}; } + fn F(unused self) -> {} { return {}; } } // --- todo_fail_final_poisoned_by_generic_query.carbon @@ -146,11 +146,11 @@ library "[[@TEST_NAME]]"; interface I { let T:! type; - fn F[self: Self]() -> T; + fn F(self) -> T; } impl forall [U:! type] U as I where .T = () { - fn F[unused self: Self]() -> () { return (); } + fn F(unused self) -> () { return (); } } fn H[W:! type](v: W) -> W.(I.T) { @@ -166,7 +166,7 @@ fn G[X:! type](p: X*) -> (X*).(I.T) { // constant from the `impl` which was treated as a symbolic, but this would // change it to be a concrete type. final impl forall [V:! Core.Copy] V* as I where .T = V { - fn F[self: Self]() -> V { return *self; } + fn F(self) -> V { return *self; } } // --- fail_todo_poisoned_concrete_lookup_from_eval_fn.carbon diff --git a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon index 4e3dabea287f..d322366fbf2a 100644 --- a/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon +++ b/toolchain/check/testdata/impl/lookup/specialization_with_symbolic_rewrite.carbon @@ -94,6 +94,7 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { return &t; } + // CHECK:STDOUT: --- final_specialized_symbolic_rewrite.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1044,20 +1045,22 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_16: = require_complete_type %T.loc9_7.1 [symbolic = %require_complete.loc9_16 (constants.%require_complete.944)] // CHECK:STDOUT: %require_complete.loc9_26: = require_complete_type %ptr [symbolic = %require_complete.loc9_26 (constants.%require_complete.ef1)] -// CHECK:STDOUT: %.loc10_10.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc9_7.1) [symbolic = %.loc10_10.1 (constants.%.0e9)] +// CHECK:STDOUT: %.loc10_10.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc9_7.1) [symbolic = %.loc10_10.2 (constants.%.0e9)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr, (%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: %.loc10_10.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc10_10.2 (constants.%.be5)] -// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.2 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.484)] -// CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.a76)] +// CHECK:STDOUT: %Copy.facet.loc10_10.2: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc10_10.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)] +// CHECK:STDOUT: %.loc10_10.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc10_10.2 [symbolic = %.loc10_10.3 (constants.%.be5)] +// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.3 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.WithSelf.Op(%Copy.facet.loc10_10.2) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: ref @F.%T.loc9_7.1 (%T.67d)) -> out %return.param: @F.%ptr (%ptr.e8f8f9.2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: ref @F.%T.loc9_7.1 (%T.67d) = name_ref t, %t // CHECK:STDOUT: %addr: @F.%ptr (%ptr.e8f8f9.2) = addr_of %t.ref -// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.2 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.3 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.484)] // CHECK:STDOUT: %bound_method.loc10_10.1: = bound_method %addr, %impl.elem0.loc10_10.1 +// CHECK:STDOUT: %Copy.facet.loc10_10.1: %Copy.type = facet_value constants.%ptr.e8f8f9.2, (constants.%Copy.lookup_impl_witness.1da) [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %.loc10_10.1: %Copy.type = converted constants.%ptr.e8f8f9.2, %Copy.facet.loc10_10.1 [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] // CHECK:STDOUT: %specific_impl_fn.loc10_10.1: = specific_impl_function %impl.elem0.loc10_10.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: %bound_method.loc10_10.2: = bound_method %addr, %specific_impl_fn.loc10_10.1 // CHECK:STDOUT: %Copy.WithSelf.Op.call: init @F.%ptr (%ptr.e8f8f9.2) = call %bound_method.loc10_10.2(%addr) @@ -1273,20 +1276,22 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_15: = require_complete_type %T.as_type.loc9_22.1 [symbolic = %require_complete.loc9_15 (constants.%require_complete.35c)] // CHECK:STDOUT: %require_complete.loc9_25: = require_complete_type %ptr [symbolic = %require_complete.loc9_25 (constants.%require_complete.841)] -// CHECK:STDOUT: %.loc10_10.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.as_type.loc9_22.1) [symbolic = %.loc10_10.1 (constants.%.ee9)] +// CHECK:STDOUT: %.loc10_10.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.as_type.loc9_22.1) [symbolic = %.loc10_10.2 (constants.%.ee9)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d90)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr, (%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.a39)] -// CHECK:STDOUT: %.loc10_10.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc10_10.2 (constants.%.229)] -// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.2 (%.229) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1f8)] -// CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.d80)] +// CHECK:STDOUT: %Copy.facet.loc10_10.2: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc10_10.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.a39)] +// CHECK:STDOUT: %.loc10_10.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc10_10.2 [symbolic = %.loc10_10.3 (constants.%.229)] +// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.3 (%.229) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1f8)] +// CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.WithSelf.Op(%Copy.facet.loc10_10.2) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.d80)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: ref @F.%T.as_type.loc9_22.1 (%T.as_type.468)) -> out %return.param: @F.%ptr (%ptr.ac4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: ref @F.%T.as_type.loc9_22.1 (%T.as_type.468) = name_ref t, %t // CHECK:STDOUT: %addr: @F.%ptr (%ptr.ac4) = addr_of %t.ref -// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.2 (%.229) = impl_witness_access constants.%Copy.lookup_impl_witness.d90, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1f8)] +// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.3 (%.229) = impl_witness_access constants.%Copy.lookup_impl_witness.d90, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1f8)] // CHECK:STDOUT: %bound_method.loc10_10.1: = bound_method %addr, %impl.elem0.loc10_10.1 +// CHECK:STDOUT: %Copy.facet.loc10_10.1: %Copy.type = facet_value constants.%ptr.ac4, (constants.%Copy.lookup_impl_witness.d90) [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %.loc10_10.1: %Copy.type = converted constants.%ptr.ac4, %Copy.facet.loc10_10.1 [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] // CHECK:STDOUT: %specific_impl_fn.loc10_10.1: = specific_impl_function %impl.elem0.loc10_10.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.d80)] // CHECK:STDOUT: %bound_method.loc10_10.2: = bound_method %addr, %specific_impl_fn.loc10_10.1 // CHECK:STDOUT: %Copy.WithSelf.Op.call: init @F.%ptr (%ptr.ac4) = call %bound_method.loc10_10.2(%addr) @@ -1500,20 +1505,22 @@ fn F[T:! Ptr](var t: T) -> T.(Ptr.Type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc9_15: = require_complete_type %T.as_type.loc9_22.1 [symbolic = %require_complete.loc9_15 (constants.%require_complete.35c)] // CHECK:STDOUT: %require_complete.loc9_25: = require_complete_type %ptr [symbolic = %require_complete.loc9_25 (constants.%require_complete.841)] -// CHECK:STDOUT: %.loc10_10.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.as_type.loc9_22.1) [symbolic = %.loc10_10.1 (constants.%.ee9)] +// CHECK:STDOUT: %.loc10_10.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.as_type.loc9_22.1) [symbolic = %.loc10_10.2 (constants.%.ee9)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.d90)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr, (%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.a39)] -// CHECK:STDOUT: %.loc10_10.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc10_10.2 (constants.%.229)] -// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.2 (%.229) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1f8)] -// CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.d80)] +// CHECK:STDOUT: %Copy.facet.loc10_10.2: %Copy.type = facet_value %ptr, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc10_10.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.a39)] +// CHECK:STDOUT: %.loc10_10.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc10_10.2 [symbolic = %.loc10_10.3 (constants.%.229)] +// CHECK:STDOUT: %impl.elem0.loc10_10.2: @F.%.loc10_10.3 (%.229) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1f8)] +// CHECK:STDOUT: %specific_impl_fn.loc10_10.2: = specific_impl_function %impl.elem0.loc10_10.2, @Copy.WithSelf.Op(%Copy.facet.loc10_10.2) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.d80)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: ref @F.%T.as_type.loc9_22.1 (%T.as_type.468)) -> out %return.param: @F.%ptr (%ptr.ac4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: ref @F.%T.as_type.loc9_22.1 (%T.as_type.468) = name_ref t, %t // CHECK:STDOUT: %addr: @F.%ptr (%ptr.ac4) = addr_of %t.ref -// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.2 (%.229) = impl_witness_access constants.%Copy.lookup_impl_witness.d90, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1f8)] +// CHECK:STDOUT: %impl.elem0.loc10_10.1: @F.%.loc10_10.3 (%.229) = impl_witness_access constants.%Copy.lookup_impl_witness.d90, element0 [symbolic = %impl.elem0.loc10_10.2 (constants.%impl.elem0.1f8)] // CHECK:STDOUT: %bound_method.loc10_10.1: = bound_method %addr, %impl.elem0.loc10_10.1 +// CHECK:STDOUT: %Copy.facet.loc10_10.1: %Copy.type = facet_value constants.%ptr.ac4, (constants.%Copy.lookup_impl_witness.d90) [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %.loc10_10.1: %Copy.type = converted constants.%ptr.ac4, %Copy.facet.loc10_10.1 [symbolic = %Copy.facet.loc10_10.2 (constants.%Copy.facet)] // CHECK:STDOUT: %specific_impl_fn.loc10_10.1: = specific_impl_function %impl.elem0.loc10_10.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc10_10.2 (constants.%specific_impl_fn.d80)] // CHECK:STDOUT: %bound_method.loc10_10.2: = bound_method %addr, %specific_impl_fn.loc10_10.1 // CHECK:STDOUT: %Copy.WithSelf.Op.call: init @F.%ptr (%ptr.ac4) = call %bound_method.loc10_10.2(%addr) diff --git a/toolchain/check/testdata/impl/lookup/specific_args.carbon b/toolchain/check/testdata/impl/lookup/specific_args.carbon index a600276bf57a..9862260aed1b 100644 --- a/toolchain/check/testdata/impl/lookup/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/specific_args.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; -interface I(T:! type) { fn F[self: Self](); } +interface I(T:! type) { fn F(self); } class C(T:! type) {} class X {} @@ -28,7 +28,7 @@ import library "types"; class InInterfaceArgs {} -impl X as I(InInterfaceArgs) { fn F[unused self: Self]() {} } +impl X as I(InInterfaceArgs) { fn F(unused self) {} } // --- use_impl_in_interface_args.carbon @@ -45,7 +45,7 @@ import library "types"; class InClassArgs {} -impl C(InClassArgs) as I(X) { fn F[unused self: Self]() {} } +impl C(InClassArgs) as I(X) { fn F(unused self) {} } // --- use_impl_in_class_args.carbon @@ -55,6 +55,7 @@ import library "impl_in_class_args"; fn H(c: C(InClassArgs)) { c.(I(X).F)(); } + // CHECK:STDOUT: --- types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -123,20 +124,20 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type.b82) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type (%pattern_type.b82) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc4_36.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc4_36.1: type = splice_block %.loc4_36.3 [symbolic = %Self.as_type.loc4_36.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc4_36.2: @I.WithSelf.F.%I.type (%I.type.3fe) = specific_constant @I.%Self.loc4_23.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @I.WithSelf.F.%I.type (%I.type.3fe) = name_ref Self, %.loc4_36.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_36.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_36.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc4_36.3: type = converted %Self.ref, %Self.as_type.loc4_36.2 [symbolic = %Self.as_type.loc4_36.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc4_30.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc4_30.1: type = splice_block %.loc4_30.3 [symbolic = %Self.as_type.loc4_30.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc4_30.2: @I.WithSelf.F.%I.type (%I.type.3fe) = specific_constant @I.%Self.loc4_23.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @I.WithSelf.F.%I.type (%I.type.3fe) = name_ref Self, %.loc4_30.2 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc4_30.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_30.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_30.3: type = converted %Self.ref, %Self.as_type.loc4_30.2 [symbolic = %Self.as_type.loc4_30.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc4_36.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc4_30.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc4_43.1: @I.WithSelf.%I.assoc_type (%I.assoc_type) = assoc_entity element0, %I.WithSelf.F.decl [symbolic = %assoc0.loc4_43.2 (constants.%assoc0)] +// CHECK:STDOUT: %assoc0.loc4_35.1: @I.WithSelf.%I.assoc_type (%I.assoc_type) = assoc_entity element0, %I.WithSelf.F.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc4_23.1 -// CHECK:STDOUT: .F = @I.WithSelf.%assoc0.loc4_43.1 +// CHECK:STDOUT: .F = @I.WithSelf.%assoc0.loc4_35.1 // CHECK:STDOUT: witness = (@I.WithSelf.%I.WithSelf.F.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: @@ -169,10 +170,10 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.3fe)] // CHECK:STDOUT: %Self: @I.WithSelf.F.%I.type (%I.type.3fe) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_36.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_36.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_36.1 [symbolic = %pattern_type (constants.%pattern_type.b82)] +// CHECK:STDOUT: %Self.as_type.loc4_30.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_30.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_30.1 [symbolic = %pattern_type (constants.%pattern_type.b82)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc4_36.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc4_30.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { @@ -185,7 +186,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %I.type => constants.%I.type.3fe // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc4_36.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc4_30.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b82 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -230,9 +231,9 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.X: type = import_ref Main//types, X, loaded [concrete = constants.%X] // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//types, loc7_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.9c8 = import_ref Main//types, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.5f6 = import_ref Main//types, loc4_43, unloaded +// CHECK:STDOUT: %Main.import_ref.5f6 = import_ref Main//types, loc4_35, unloaded // CHECK:STDOUT: %Main.F: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.0fc) = import_ref Main//types, F, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.a92)] -// CHECK:STDOUT: %Main.import_ref.35c = import_ref Main//types, loc4_43, unloaded +// CHECK:STDOUT: %Main.import_ref.35c = import_ref Main//types, loc4_35, unloaded // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//types, loc4_14, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.d08dda.2: @I.%I.type (%I.type.3fe) = import_ref Main//types, loc4_23, loaded [symbolic = @I.%Self (constants.%Self.a67)] // CHECK:STDOUT: %Main.import_ref.a43 = import_ref Main//types, loc4_23, unloaded @@ -417,20 +418,20 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.InInterfaceArgs: type = import_ref Main//impl_in_interface_args, InInterfaceArgs, loaded [concrete = constants.%InInterfaceArgs] // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//types, loc7_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.9c8 = import_ref Main//types, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.c60: @I.WithSelf.%I.assoc_type (%I.assoc_type.b71) = import_ref Main//types, loc4_43, loaded [symbolic = @I.WithSelf.%assoc0 (constants.%assoc0.341)] +// CHECK:STDOUT: %Main.import_ref.c60: @I.WithSelf.%I.assoc_type (%I.assoc_type.b71) = import_ref Main//types, loc4_35, loaded [symbolic = @I.WithSelf.%assoc0 (constants.%assoc0.341)] // CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded -// CHECK:STDOUT: %Main.import_ref.620: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.0fc) = import_ref Main//types, loc4_43, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.a92)] +// CHECK:STDOUT: %Main.import_ref.620: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.0fc) = import_ref Main//types, loc4_35, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.a92)] // CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//types, loc4_14, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.d08dda.2: @I.%I.type (%I.type.3fe) = import_ref Main//types, loc4_23, loaded [symbolic = @I.%Self (constants.%Self.a67)] // CHECK:STDOUT: %Main.import_ref.a43 = import_ref Main//types, loc4_23, unloaded // CHECK:STDOUT: %Main.import_ref.b3bc94.3: type = import_ref Main//types, loc4_14, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.8f24d3.2: = import_ref Main//impl_in_interface_args, loc5_24, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.9ad = import_ref Main//impl_in_interface_args, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.35c = import_ref Main//types, loc4_43, unloaded +// CHECK:STDOUT: %Main.import_ref.35c = import_ref Main//types, loc4_35, unloaded // CHECK:STDOUT: %Main.import_ref.743: = import_ref Main//impl_in_interface_args, loc7_30, loaded [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %Main.import_ref.57b: type = import_ref Main//impl_in_interface_args, loc7_6, loaded [concrete = constants.%X] // CHECK:STDOUT: %Main.import_ref.555: type = import_ref Main//impl_in_interface_args, loc7_28, loaded [concrete = constants.%I.type.ec4] -// CHECK:STDOUT: %Main.import_ref.0d0: %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: %Main.import_ref.0d0: %X.as.I.impl.F.type = import_ref Main//impl_in_interface_args, loc7_50, loaded [concrete = constants.%X.as.I.impl.F] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.0d0), @X.as.I.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -600,9 +601,9 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.import_ref.8f24d3.1: = import_ref Main//types, loc5_20, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.189 = import_ref Main//types, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.b3bc94.1: type = import_ref Main//types, loc5_10, loaded [symbolic = @C.%T (constants.%T)] -// CHECK:STDOUT: %Main.import_ref.5f6 = import_ref Main//types, loc4_43, unloaded +// CHECK:STDOUT: %Main.import_ref.5f6 = import_ref Main//types, loc4_35, unloaded // CHECK:STDOUT: %Main.F: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.0fc) = import_ref Main//types, F, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.a92)] -// CHECK:STDOUT: %Main.import_ref.35c = import_ref Main//types, loc4_43, unloaded +// CHECK:STDOUT: %Main.import_ref.35c = import_ref Main//types, loc4_35, unloaded // CHECK:STDOUT: %Main.import_ref.b3bc94.3: type = import_ref Main//types, loc4_14, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.d08dda.2: @I.%I.type (%I.type.3fe) = import_ref Main//types, loc4_23, loaded [symbolic = @I.%Self (constants.%Self.a67)] // CHECK:STDOUT: %Main.import_ref.a43 = import_ref Main//types, loc4_23, unloaded @@ -820,20 +821,20 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); } // CHECK:STDOUT: %Main.import_ref.b3bc94.1: type = import_ref Main//types, loc5_10, loaded [symbolic = @C.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.8f24d3.2: = import_ref Main//impl_in_class_args, loc5_20, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.195 = import_ref Main//impl_in_class_args, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.c60: @I.WithSelf.%I.assoc_type (%I.assoc_type.b71) = import_ref Main//types, loc4_43, loaded [symbolic = @I.WithSelf.%assoc0 (constants.%assoc0.341)] +// CHECK:STDOUT: %Main.import_ref.c60: @I.WithSelf.%I.assoc_type (%I.assoc_type.b71) = import_ref Main//types, loc4_35, loaded [symbolic = @I.WithSelf.%assoc0 (constants.%assoc0.341)] // CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded -// CHECK:STDOUT: %Main.import_ref.620: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.0fc) = import_ref Main//types, loc4_43, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.a92)] +// CHECK:STDOUT: %Main.import_ref.620: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.0fc) = import_ref Main//types, loc4_35, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.a92)] // CHECK:STDOUT: %Main.import_ref.b3bc94.3: type = import_ref Main//types, loc4_14, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.d08dda.2: @I.%I.type (%I.type.3fe) = import_ref Main//types, loc4_23, loaded [symbolic = @I.%Self (constants.%Self.a67)] // CHECK:STDOUT: %Main.import_ref.a43 = import_ref Main//types, loc4_23, unloaded // CHECK:STDOUT: %Main.import_ref.b3bc94.4: type = import_ref Main//types, loc4_14, loaded [symbolic = @I.%T (constants.%T)] // CHECK:STDOUT: %Main.import_ref.8f24d3.3: = import_ref Main//types, loc7_10, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.9c8 = import_ref Main//types, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.35c = import_ref Main//types, loc4_43, unloaded +// CHECK:STDOUT: %Main.import_ref.35c = import_ref Main//types, loc4_35, unloaded // CHECK:STDOUT: %Main.import_ref.d12: = import_ref Main//impl_in_class_args, loc7_29, loaded [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %Main.import_ref.312: type = import_ref Main//impl_in_class_args, loc7_19, loaded [concrete = constants.%C.165] // CHECK:STDOUT: %Main.import_ref.ae9: type = import_ref Main//impl_in_class_args, loc7_27, loaded [concrete = constants.%I.type.d91] -// CHECK:STDOUT: %Main.import_ref.0d0: %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: %Main.import_ref.0d0: %C.as.I.impl.F.type = import_ref Main//impl_in_class_args, loc7_49, loaded [concrete = constants.%C.as.I.impl.F] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.0d0), @C.as.I.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/transitive.carbon b/toolchain/check/testdata/impl/lookup/transitive.carbon index ca000b35017b..c3b8015e6c1f 100644 --- a/toolchain/check/testdata/impl/lookup/transitive.carbon +++ b/toolchain/check/testdata/impl/lookup/transitive.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; -interface I { fn F[self: Self](); } +interface I { fn F(self); } // --- c.carbon @@ -25,7 +25,7 @@ library "[[@TEST_NAME]]"; import library "i"; class C {} -impl C as I { fn F[unused self: Self]() {} } +impl C as I { fn F(unused self) {} } // --- get.carbon @@ -47,6 +47,7 @@ fn Call() { Get().(I.F)(); } + // CHECK:STDOUT: --- i.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -85,13 +86,13 @@ fn Call() { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type (%pattern_type) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc4_26.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.2 [symbolic = %Self.as_type.loc4_26.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc4_20.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.2 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_26.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_26.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc4_26.2: type = converted %Self.ref, %Self.as_type.loc4_26.2 [symbolic = %Self.as_type.loc4_26.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc4_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_20.2: type = converted %Self.ref, %Self.as_type.loc4_20.2 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc4_26.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc4_20.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -105,17 +106,17 @@ fn Call() { // 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)] -// CHECK:STDOUT: %Self.as_type.loc4_26.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_26.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_26.1 [symbolic = %pattern_type (constants.%pattern_type)] +// CHECK:STDOUT: %Self.as_type.loc4_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_20.1 [symbolic = %pattern_type (constants.%pattern_type)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc4_26.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc4_20.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc4_26.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc4_20.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -146,7 +147,7 @@ fn Call() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Main.import_ref.046 = import_ref Main//i, loc4_33, unloaded +// CHECK:STDOUT: %Main.import_ref.046 = import_ref Main//i, loc4_25, unloaded // CHECK:STDOUT: %Main.F: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.418) = import_ref Main//i, F, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.ca5)] // CHECK:STDOUT: %Main.import_ref.e59c42.2: %I.type = import_ref Main//i, loc4_13, loaded [symbolic = constants.%Self] // CHECK:STDOUT: %Main.import_ref.223 = import_ref Main//i, loc4_13, unloaded @@ -332,15 +333,15 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//get, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.0a8 = import_ref Main//get, inst{{[0-9A-F]+}} [indirect], unloaded -// CHECK:STDOUT: %Main.import_ref.1b3: %I.assoc_type = import_ref Main//i, loc4_33, loaded [concrete = constants.%assoc0.232] +// CHECK:STDOUT: %Main.import_ref.1b3: %I.assoc_type = import_ref Main//i, loc4_25, loaded [concrete = constants.%assoc0.232] // CHECK:STDOUT: %Main.F = import_ref Main//i, F, unloaded // CHECK:STDOUT: %Main.import_ref.e59c42.2: %I.type = import_ref Main//i, loc4_13, loaded [symbolic = constants.%Self.dda] // CHECK:STDOUT: %Main.import_ref.223 = import_ref Main//i, loc4_13, unloaded -// CHECK:STDOUT: %Main.import_ref.9f7: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.418) = import_ref Main//i, loc4_33, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.ca5)] +// CHECK:STDOUT: %Main.import_ref.9f7: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type.418) = import_ref Main//i, loc4_25, loaded [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.ca5)] // CHECK:STDOUT: %Main.import_ref.dbc: = import_ref Main//c, loc7_13, loaded [concrete = constants.%I.impl_witness] // CHECK:STDOUT: %Main.import_ref.335: type = import_ref Main//c, loc7_6, loaded [concrete = constants.%C] // CHECK:STDOUT: %Main.import_ref.e90: type = import_ref Main//c, loc7_11, loaded [concrete = constants.%I.type] -// CHECK:STDOUT: %Main.import_ref.0d0: %C.as.I.impl.F.type = import_ref Main//c, loc7_41, loaded [concrete = constants.%C.as.I.impl.F] +// CHECK:STDOUT: %Main.import_ref.0d0: %C.as.I.impl.F.type = import_ref Main//c, loc7_33, loaded [concrete = constants.%C.as.I.impl.F] // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.0d0), @C.as.I.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/self_in_signature.carbon b/toolchain/check/testdata/impl/self_in_signature.carbon index a9aef291ff2a..b1192264dab9 100644 --- a/toolchain/check/testdata/impl/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/self_in_signature.carbon @@ -13,7 +13,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/self_in_signature.carbon interface UseSelf { - fn F[self: Self](x: Self) -> Self; + fn F(self, x: Self) -> Self; } class C {} @@ -21,11 +21,11 @@ class C {} class D {} impl C as UseSelf { - fn F[unused self: C](unused x: C) -> C { return {}; } + fn F(unused self: C, unused x: C) -> C { return {}; } } impl D as UseSelf { - fn F[unused self: Self](unused x: Self) -> Self { return {}; } + fn F(unused self, unused x: Self) -> Self { return {}; } } interface SelfNested { @@ -40,6 +40,7 @@ impl D as SelfNested { fn F(x: (Self*, {.x: Self, .y: ()})); } + // CHECK:STDOUT: --- self_in_signature.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -154,28 +155,28 @@ impl D as SelfNested { // CHECK:STDOUT: %x.param_patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type.04e) = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type.04e) = at_binding_pattern x, %x.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type.04e) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type.04e) = return_slot_pattern %return.param_patt, %.loc16_32.2 [concrete] +// CHECK:STDOUT: %return.patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type.04e) = return_slot_pattern %return.param_patt, %.loc16_26.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc16_32: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.bde)] -// CHECK:STDOUT: %Self.as_type.loc16_32: type = facet_access_type %Self.ref.loc16_32 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.968)] -// CHECK:STDOUT: %.loc16_32.2: type = converted %Self.ref.loc16_32, %Self.as_type.loc16_32 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.968)] -// CHECK:STDOUT: %.loc16_32.3: Core.Form = init_form %.loc16_32.2 [symbolic = %.loc16_32.1 (constants.%.326)] -// CHECK:STDOUT: %self.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968) = 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.968)] { -// CHECK:STDOUT: %Self.ref.loc16_14: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.bde)] -// 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.968)] -// 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.968)] +// CHECK:STDOUT: %Self.ref.loc16_26: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.bde)] +// CHECK:STDOUT: %Self.as_type.loc16_26: type = facet_access_type %Self.ref.loc16_26 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.968)] +// CHECK:STDOUT: %.loc16_26.2: type = converted %Self.ref.loc16_26, %Self.as_type.loc16_26 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.968)] +// CHECK:STDOUT: %.loc16_26.3: Core.Form = init_form %.loc16_26.2 [symbolic = %.loc16_26.1 (constants.%.326)] +// CHECK:STDOUT: %self.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968) = 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.968)] { +// CHECK:STDOUT: %Self.ref.loc16_8: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.bde)] +// 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.968)] +// 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.968)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968) = value_binding self, %self.param -// CHECK:STDOUT: %x.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968) = value_param call_param1 -// CHECK:STDOUT: %.loc16_23.1: type = splice_block %.loc16_23.2 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.968)] { -// CHECK:STDOUT: %Self.ref.loc16_23: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.bde)] -// CHECK:STDOUT: %Self.as_type.loc16_23: type = facet_access_type %Self.ref.loc16_23 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.968)] -// CHECK:STDOUT: %.loc16_23.2: type = converted %Self.ref.loc16_23, %Self.as_type.loc16_23 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.968)] +// CHECK:STDOUT: %self: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968) = value_binding self, %self.param +// CHECK:STDOUT: %x.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968) = value_param call_param1 +// CHECK:STDOUT: %.loc16_17.1: type = splice_block %.loc16_17.2 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.968)] { +// CHECK:STDOUT: %Self.ref.loc16_17: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self.bde)] +// CHECK:STDOUT: %Self.as_type.loc16_17: type = facet_access_type %Self.ref.loc16_17 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.968)] +// CHECK:STDOUT: %.loc16_17.2: type = converted %Self.ref.loc16_17, %Self.as_type.loc16_17 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.968)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968) = value_binding x, %x.param -// CHECK:STDOUT: %return.param: ref @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968) = out_param call_param2 -// CHECK:STDOUT: %return: ref @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968) = return_slot %return.param +// CHECK:STDOUT: %x: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968) = value_binding x, %x.param +// CHECK:STDOUT: %return.param: ref @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968) = out_param call_param2 +// CHECK:STDOUT: %return: ref @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %UseSelf.assoc_type = assoc_entity element0, %UseSelf.WithSelf.F.decl [concrete = constants.%assoc0.f2e] // CHECK:STDOUT: @@ -262,15 +263,15 @@ impl D as SelfNested { // CHECK:STDOUT: %x.param_patt: %pattern_type.d8d = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt: %pattern_type.d8d = at_binding_pattern x, %x.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.d8d = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.d8d = return_slot_pattern %return.param_patt, %Self.ref.loc28_46 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.d8d = return_slot_pattern %return.param_patt, %Self.ref.loc28_40 [concrete] // CHECK:STDOUT: } { -// 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 [concrete = constants.%.592] +// CHECK:STDOUT: %Self.ref.loc28_40: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] +// CHECK:STDOUT: %.loc28_40: Core.Form = init_form %Self.ref.loc28_40 [concrete = constants.%.592] // CHECK:STDOUT: %self.param: %D = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc28_21: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] +// CHECK:STDOUT: %Self.ref.loc28_15: 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_37: type = name_ref Self, @D.as.UseSelf.impl.%D.ref [concrete = constants.%D] +// CHECK:STDOUT: %Self.ref.loc28_31: 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 @@ -357,11 +358,11 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @UseSelf.WithSelf.F(@UseSelf.%Self: %UseSelf.type) { // CHECK:STDOUT: %Self: %UseSelf.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.bde)] -// CHECK:STDOUT: %Self.as_type.loc16_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type.968)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_14.1 [symbolic = %pattern_type (constants.%pattern_type.04e)] -// CHECK:STDOUT: %.loc16_32.1: Core.Form = init_form %Self.as_type.loc16_14.1 [symbolic = %.loc16_32.1 (constants.%.326)] +// CHECK:STDOUT: %Self.as_type.loc16_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type.968)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_8.1 [symbolic = %pattern_type (constants.%pattern_type.04e)] +// CHECK:STDOUT: %.loc16_26.1: Core.Form = init_form %Self.as_type.loc16_8.1 [symbolic = %.loc16_26.1 (constants.%.326)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968), %x.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968)) -> out %return.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type.968); +// CHECK:STDOUT: fn(%self.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968), %x.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968)) -> out %return.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type.968); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.UseSelf.impl.F(%self.param: %C, %x.param: %C) -> out %return.param: %C { @@ -374,10 +375,10 @@ impl D as SelfNested { // 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_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: %.loc28_55.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc28_55.2: init %D to %return.param = class_init () [concrete = constants.%D.val] +// CHECK:STDOUT: %.loc28_56: init %D = converted %.loc28_55.1, %.loc28_55.2 [concrete = constants.%D.val] +// CHECK:STDOUT: return %.loc28_56 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @SelfNested.WithSelf.F(@SelfNested.%Self: %SelfNested.type) { @@ -405,9 +406,9 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: specific @UseSelf.WithSelf.F(constants.%Self.bde) { // CHECK:STDOUT: %Self => constants.%Self.bde -// CHECK:STDOUT: %Self.as_type.loc16_14.1 => constants.%Self.as_type.968 +// CHECK:STDOUT: %Self.as_type.loc16_8.1 => constants.%Self.as_type.968 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.04e -// CHECK:STDOUT: %.loc16_32.1 => constants.%.326 +// CHECK:STDOUT: %.loc16_26.1 => constants.%.326 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @UseSelf.WithSelf(constants.%UseSelf.facet.14b) { @@ -419,9 +420,9 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: specific @UseSelf.WithSelf.F(constants.%UseSelf.facet.14b) { // CHECK:STDOUT: %Self => constants.%UseSelf.facet.14b -// CHECK:STDOUT: %Self.as_type.loc16_14.1 => constants.%C +// CHECK:STDOUT: %Self.as_type.loc16_8.1 => constants.%C // CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b -// CHECK:STDOUT: %.loc16_32.1 => constants.%.a44 +// CHECK:STDOUT: %.loc16_26.1 => constants.%.a44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @UseSelf.WithSelf(constants.%UseSelf.facet.64f) { @@ -433,9 +434,9 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: specific @UseSelf.WithSelf.F(constants.%UseSelf.facet.64f) { // CHECK:STDOUT: %Self => constants.%UseSelf.facet.64f -// CHECK:STDOUT: %Self.as_type.loc16_14.1 => constants.%D +// CHECK:STDOUT: %Self.as_type.loc16_8.1 => constants.%D // CHECK:STDOUT: %pattern_type => constants.%pattern_type.d8d -// CHECK:STDOUT: %.loc16_32.1 => constants.%.592 +// CHECK:STDOUT: %.loc16_26.1 => constants.%.592 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SelfNested.WithSelf(constants.%Self.e81) { diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index 943f548cbe14..3636eb56c394 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -16,13 +16,13 @@ library "[[@TEST_NAME]]"; interface J { let U:! type; //@dump-sem-ir-begin - fn F[self: Self](u: U) -> U; + fn F(self, u: U) -> U; //@dump-sem-ir-end } impl () as J where .U = i32 { //@dump-sem-ir-begin - fn F[unused self: Self](u: i32) -> i32 { return -u; } + fn F(unused self, u: i32) -> i32 { return -u; } //@dump-sem-ir-end } @@ -39,7 +39,7 @@ class C { impl C as J where .U = C { //@dump-sem-ir-begin - fn F[self: Self](unused u: C) -> C { return self; } + fn F(self, unused u: C) -> C { return self; } //@dump-sem-ir-end } @@ -67,7 +67,7 @@ library "[[@TEST_NAME]]"; interface J { let U:! type; fn F(u: U) -> U; - fn G[self: Self](v: U) -> U; + fn G(self, v: U) -> U; } class E { @@ -75,7 +75,7 @@ class E { fn F(u: i32) -> i32 { return -u; } - fn G[unused self: Self](v: i32) -> i32 { + fn G(unused self, v: i32) -> i32 { return -v; } } @@ -103,7 +103,7 @@ fn CallGeneric(e: E) -> i32 { library "[[@TEST_NAME]]"; interface I { - fn Op[self: Self](b: Self) -> Self; + fn Op(self, b: Self) -> Self; } interface J { @@ -120,7 +120,7 @@ library "[[@TEST_NAME]]"; interface J { let U:! type; - fn G[self: Self](v: U) -> U; + fn G(self, v: U) -> U; } fn GenericCallInterfaceQualified[T:! J](t: T, u: T.U) -> T.U { @@ -197,15 +197,15 @@ class E { library "[[@TEST_NAME]]"; interface J { - fn F[self: Self](); + fn F(self); } class E { extend impl as J { - fn F[unused self: Self]() {} + fn F(unused self) {} } - fn G[self: Self]() { self.F(); } + fn G(self) { self.F(); } } // --- use_extend_constant.carbon @@ -363,25 +363,25 @@ library "[[@TEST_NAME]]"; interface J2 { let U2:! type; - // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+14]]:23: error: member access into facet of incomplete type `J2` [IncompleteTypeInMemberAccessOfFacet] - // CHECK:STDERR: fn F[self: Self](z: Self.U2) -> Self.U2; - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+14]]:17: error: member access into facet of incomplete type `J2` [IncompleteTypeInMemberAccessOfFacet] + // CHECK:STDERR: fn F(self, z: Self.U2) -> Self.U2; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE-5]]:1: note: interface is currently being defined [InterfaceIncompleteWithinDefinition] // CHECK:STDERR: interface J2 { // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+7]]:35: error: member access into facet of incomplete type `J2` [IncompleteTypeInMemberAccessOfFacet] - // CHECK:STDERR: fn F[self: Self](z: Self.U2) -> Self.U2; - // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE+7]]:29: error: member access into facet of incomplete type `J2` [IncompleteTypeInMemberAccessOfFacet] + // CHECK:STDERR: fn F(self, z: Self.U2) -> Self.U2; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_self_period_associated_type.carbon:[[@LINE-12]]:1: note: interface is currently being defined [InterfaceIncompleteWithinDefinition] // CHECK:STDERR: interface J2 { // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: - fn F[self: Self](z: Self.U2) -> Self.U2; + fn F(self, z: Self.U2) -> Self.U2; } impl () as J2 where .U2 = {} { - fn F[unused self: Self](z: {}) -> {} { return z; } + fn F(unused self, z: {}) -> {} { return z; } } class C2 { @@ -390,7 +390,7 @@ class C2 { } impl C2 as J2 where .U2 = C2 { - fn F[self: Self](unused z: C2) -> C2 { return self; } + fn F(self, unused z: C2) -> C2 { return self; } } // --- fail_associated_type_in_signature_mismatch.carbon @@ -398,28 +398,28 @@ library "[[@TEST_NAME]]"; interface K { let V:! type; - // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+3]]:20: error: cannot convert from struct type `{.a: ()}` to `{.x: ()}`: unexpected field `a` in source type [StructInitUnexpectedFieldInConversion] - // CHECK:STDERR: fn F[self: Self](v: V) -> V; - // CHECK:STDERR: ^~~~ - fn F[self: Self](v: V) -> V; + // CHECK:STDERR: fail_associated_type_in_signature_mismatch.carbon:[[@LINE+3]]:14: error: cannot convert from struct type `{.a: ()}` to `{.x: ()}`: unexpected field `a` in source type [StructInitUnexpectedFieldInConversion] + // CHECK:STDERR: fn F(self, v: V) -> V; + // CHECK:STDERR: ^~~~ + fn F(self, v: V) -> V; } impl () as K where .V = {.a: ()} { - // 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+14]]:21: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn F(unused 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: fn F(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: ()}`: unexpected field `x` in source type [StructInitUnexpectedFieldInConversion] - // CHECK:STDERR: fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; } - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F(unused 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, v: V) -> V; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - fn F[unused self: Self](v: {.x: ()}) -> {.x: ()} { return v; } + fn F(unused self, v: {.x: ()}) -> {.x: ()} { return v; } } // --- use_non-type_in_function.carbon @@ -465,11 +465,11 @@ library "[[@TEST_NAME]]"; interface I { let N:! i32; - fn F[self: Self]() -> array(bool, N); + fn F(self) -> array(bool, N); } impl () as I where .N = 2 { - fn F[unused self: Self]() -> array(bool, 2) { return (true, false); } + fn F(unused self) -> array(bool, 2) { return (true, false); } } // --- symbolic_associated_type_in_concrete_context.carbon @@ -488,6 +488,7 @@ fn F() { let unused a: D.(Z.X) = {} as C(D); } + // CHECK:STDOUT: --- associated_type_in_method_signature.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -573,31 +574,31 @@ fn F() { // CHECK:STDOUT: !with Self: // CHECK:STDOUT: // CHECK:STDOUT: %J.WithSelf.F.decl: @J.WithSelf.%J.WithSelf.F.type (%J.WithSelf.F.type.a0a) = fn_decl @J.WithSelf.F [symbolic = @J.WithSelf.%J.WithSelf.F (constants.%J.WithSelf.F.f69)] { -// CHECK:STDOUT: %self.param_patt: @J.WithSelf.F.%pattern_type.loc6_12 (%pattern_type.506) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @J.WithSelf.F.%pattern_type.loc6_12 (%pattern_type.506) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %u.param_patt: @J.WithSelf.F.%pattern_type.loc6_21 (%pattern_type.a39) = value_param_pattern [concrete] -// CHECK:STDOUT: %u.patt: @J.WithSelf.F.%pattern_type.loc6_21 (%pattern_type.a39) = at_binding_pattern u, %u.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @J.WithSelf.F.%pattern_type.loc6_21 (%pattern_type.a39) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @J.WithSelf.F.%pattern_type.loc6_21 (%pattern_type.a39) = return_slot_pattern %return.param_patt, %U.ref.loc6_29 [concrete] +// CHECK:STDOUT: %self.param_patt: @J.WithSelf.F.%pattern_type.loc6_8 (%pattern_type.506) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @J.WithSelf.F.%pattern_type.loc6_8 (%pattern_type.506) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %u.param_patt: @J.WithSelf.F.%pattern_type.loc6_15 (%pattern_type.a39) = value_param_pattern [concrete] +// CHECK:STDOUT: %u.patt: @J.WithSelf.F.%pattern_type.loc6_15 (%pattern_type.a39) = at_binding_pattern u, %u.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @J.WithSelf.F.%pattern_type.loc6_15 (%pattern_type.a39) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @J.WithSelf.F.%pattern_type.loc6_15 (%pattern_type.a39) = return_slot_pattern %return.param_patt, %U.ref.loc6_23 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %impl.elem0.loc6_29: type = impl_witness_access constants.%J.lookup_impl_witness.e57, element0 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.c15)] -// CHECK:STDOUT: %U.ref.loc6_29: type = name_ref U, %impl.elem0.loc6_29 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.c15)] -// CHECK:STDOUT: %.loc6_29.2: Core.Form = init_form %U.ref.loc6_29 [symbolic = %.loc6_29.1 (constants.%.eb9)] -// CHECK:STDOUT: %self.param: @J.WithSelf.F.%Self.as_type.loc6_14.1 (%Self.as_type.976) = value_param call_param0 -// CHECK:STDOUT: %.loc6_14.1: type = splice_block %.loc6_14.2 [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.976)] { +// CHECK:STDOUT: %impl.elem0.loc6_23: type = impl_witness_access constants.%J.lookup_impl_witness.e57, element0 [symbolic = %impl.elem0.loc6_17.1 (constants.%impl.elem0.c15)] +// CHECK:STDOUT: %U.ref.loc6_23: type = name_ref U, %impl.elem0.loc6_23 [symbolic = %impl.elem0.loc6_17.1 (constants.%impl.elem0.c15)] +// CHECK:STDOUT: %.loc6_23.2: Core.Form = init_form %U.ref.loc6_23 [symbolic = %.loc6_23.1 (constants.%.eb9)] +// CHECK:STDOUT: %self.param: @J.WithSelf.F.%Self.as_type.loc6_8.1 (%Self.as_type.976) = value_param call_param0 +// CHECK:STDOUT: %.loc6_8.1: type = splice_block %.loc6_8.2 [symbolic = %Self.as_type.loc6_8.1 (constants.%Self.as_type.976)] { // CHECK:STDOUT: %Self.ref: %J.type = name_ref Self, @J.%Self [symbolic = %Self (constants.%Self.653)] -// CHECK:STDOUT: %Self.as_type.loc6_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.976)] -// CHECK:STDOUT: %.loc6_14.2: type = converted %Self.ref, %Self.as_type.loc6_14.2 [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.976)] +// CHECK:STDOUT: %Self.as_type.loc6_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_8.1 (constants.%Self.as_type.976)] +// CHECK:STDOUT: %.loc6_8.2: type = converted %Self.ref, %Self.as_type.loc6_8.2 [symbolic = %Self.as_type.loc6_8.1 (constants.%Self.as_type.976)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @J.WithSelf.F.%Self.as_type.loc6_14.1 (%Self.as_type.976) = value_binding self, %self.param -// CHECK:STDOUT: %u.param: @J.WithSelf.F.%impl.elem0.loc6_23.1 (%impl.elem0.c15) = value_param call_param1 -// CHECK:STDOUT: %.loc6_23: type = splice_block %U.ref.loc6_23 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.c15)] { -// CHECK:STDOUT: %impl.elem0.loc6_23.2: type = impl_witness_access constants.%J.lookup_impl_witness.e57, element0 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.c15)] -// CHECK:STDOUT: %U.ref.loc6_23: type = name_ref U, %impl.elem0.loc6_23.2 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.c15)] +// CHECK:STDOUT: %self: @J.WithSelf.F.%Self.as_type.loc6_8.1 (%Self.as_type.976) = value_binding self, %self.param +// CHECK:STDOUT: %u.param: @J.WithSelf.F.%impl.elem0.loc6_17.1 (%impl.elem0.c15) = value_param call_param1 +// CHECK:STDOUT: %.loc6_17: type = splice_block %U.ref.loc6_17 [symbolic = %impl.elem0.loc6_17.1 (constants.%impl.elem0.c15)] { +// CHECK:STDOUT: %impl.elem0.loc6_17.2: type = impl_witness_access constants.%J.lookup_impl_witness.e57, element0 [symbolic = %impl.elem0.loc6_17.1 (constants.%impl.elem0.c15)] +// CHECK:STDOUT: %U.ref.loc6_17: type = name_ref U, %impl.elem0.loc6_17.2 [symbolic = %impl.elem0.loc6_17.1 (constants.%impl.elem0.c15)] // CHECK:STDOUT: } -// CHECK:STDOUT: %u: @J.WithSelf.F.%impl.elem0.loc6_23.1 (%impl.elem0.c15) = value_binding u, %u.param -// CHECK:STDOUT: %return.param: ref @J.WithSelf.F.%impl.elem0.loc6_23.1 (%impl.elem0.c15) = out_param call_param2 -// CHECK:STDOUT: %return: ref @J.WithSelf.F.%impl.elem0.loc6_23.1 (%impl.elem0.c15) = return_slot %return.param +// CHECK:STDOUT: %u: @J.WithSelf.F.%impl.elem0.loc6_17.1 (%impl.elem0.c15) = value_binding u, %u.param +// CHECK:STDOUT: %return.param: ref @J.WithSelf.F.%impl.elem0.loc6_17.1 (%impl.elem0.c15) = out_param call_param2 +// CHECK:STDOUT: %return: ref @J.WithSelf.F.%impl.elem0.loc6_17.1 (%impl.elem0.c15) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %J.WithSelf.F.decl [concrete = constants.%assoc1.413] // CHECK:STDOUT: @@ -618,15 +619,15 @@ fn F() { // CHECK:STDOUT: %u.param_patt: %pattern_type.6b6 = value_param_pattern [concrete] // CHECK:STDOUT: %u.patt: %pattern_type.6b6 = at_binding_pattern u, %u.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.6b6 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc12_38 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32.loc12_32 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %i32.loc12_38: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc12: Core.Form = init_form %i32.loc12_38 [concrete = constants.%.795] +// CHECK:STDOUT: %i32.loc12_32: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc12: Core.Form = init_form %i32.loc12_32 [concrete = constants.%.795] // 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.%.loc10_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: %i32.loc12_30: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %i32.loc12_24: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %u: %i32 = value_binding u, %u.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param @@ -646,15 +647,15 @@ fn F() { // CHECK:STDOUT: %u.param_patt: %pattern_type.98b = value_param_pattern [concrete] // CHECK:STDOUT: %u.patt: %pattern_type.98b = at_binding_pattern u, %u.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.98b = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %C.ref.loc29_36 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %C.ref.loc29_30 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref.loc29_36: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc29_36: Core.Form = init_form %C.ref.loc29_36 [concrete = constants.%.a44] +// CHECK:STDOUT: %C.ref.loc29_30: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc29_30: Core.Form = init_form %C.ref.loc29_30 [concrete = constants.%.a44] // CHECK:STDOUT: %self.param: %C = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.J.impl.%C.ref.loc27_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.loc29_30: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %C.ref.loc29_24: 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 @@ -670,24 +671,24 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @J.WithSelf.F(@J.%Self: %J.type) { // CHECK:STDOUT: %Self: %J.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.653)] -// CHECK:STDOUT: %Self.as_type.loc6_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_14.1 (constants.%Self.as_type.976)] -// CHECK:STDOUT: %pattern_type.loc6_12: type = pattern_type %Self.as_type.loc6_14.1 [symbolic = %pattern_type.loc6_12 (constants.%pattern_type.506)] +// CHECK:STDOUT: %Self.as_type.loc6_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_8.1 (constants.%Self.as_type.976)] +// CHECK:STDOUT: %pattern_type.loc6_8: type = pattern_type %Self.as_type.loc6_8.1 [symbolic = %pattern_type.loc6_8 (constants.%pattern_type.506)] // CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %Self, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.e57)] -// CHECK:STDOUT: %impl.elem0.loc6_23.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_23.1 (constants.%impl.elem0.c15)] -// CHECK:STDOUT: %pattern_type.loc6_21: type = pattern_type %impl.elem0.loc6_23.1 [symbolic = %pattern_type.loc6_21 (constants.%pattern_type.a39)] -// CHECK:STDOUT: %.loc6_29.1: Core.Form = init_form %impl.elem0.loc6_23.1 [symbolic = %.loc6_29.1 (constants.%.eb9)] +// CHECK:STDOUT: %impl.elem0.loc6_17.1: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_17.1 (constants.%impl.elem0.c15)] +// CHECK:STDOUT: %pattern_type.loc6_15: type = pattern_type %impl.elem0.loc6_17.1 [symbolic = %pattern_type.loc6_15 (constants.%pattern_type.a39)] +// CHECK:STDOUT: %.loc6_23.1: Core.Form = init_form %impl.elem0.loc6_17.1 [symbolic = %.loc6_23.1 (constants.%.eb9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @J.WithSelf.F.%Self.as_type.loc6_14.1 (%Self.as_type.976), %u.param: @J.WithSelf.F.%impl.elem0.loc6_23.1 (%impl.elem0.c15)) -> out %return.param: @J.WithSelf.F.%impl.elem0.loc6_23.1 (%impl.elem0.c15); +// CHECK:STDOUT: fn(%self.param: @J.WithSelf.F.%Self.as_type.loc6_8.1 (%Self.as_type.976), %u.param: @J.WithSelf.F.%impl.elem0.loc6_17.1 (%impl.elem0.c15)) -> out %return.param: @J.WithSelf.F.%impl.elem0.loc6_17.1 (%impl.elem0.c15); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @empty_tuple.type.as.J.impl.F(%self.param: %empty_tuple.type, %u.param: %i32) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u // CHECK:STDOUT: %impl.elem1: %.435 = impl_witness_access constants.%Negate.impl_witness.3c4, element1 [concrete = constants.%Int.as.Negate.impl.Op.246] -// CHECK:STDOUT: %bound_method.loc12_51.1: = bound_method %u.ref, %impl.elem1 +// CHECK:STDOUT: %bound_method.loc12_45.1: = bound_method %u.ref, %impl.elem1 // CHECK:STDOUT: %specific_fn: = 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.loc12_51.2: = bound_method %u.ref, %specific_fn -// CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc12_51.2(%u.ref) +// CHECK:STDOUT: %bound_method.loc12_45.2: = bound_method %u.ref, %specific_fn +// CHECK:STDOUT: %Int.as.Negate.impl.Op.call: init %i32 = call %bound_method.loc12_45.2(%u.ref) // CHECK:STDOUT: return %Int.as.Negate.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -713,11 +714,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: %.loc29_51.1: %empty_struct_type = as_compatible %self.ref -// CHECK:STDOUT: %.loc29_51.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc29_51.3: init %C = as_compatible %.loc29_51.2 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc29_51.4: init %C = converted %self.ref, %.loc29_51.3 [concrete = constants.%C.val] -// CHECK:STDOUT: return %.loc29_51.4 +// CHECK:STDOUT: %.loc29_45.1: %empty_struct_type = as_compatible %self.ref +// CHECK:STDOUT: %.loc29_45.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc29_45.3: init %C = as_compatible %.loc29_45.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc29_45.4: init %C = converted %self.ref, %.loc29_45.3 [concrete = constants.%C.val] +// CHECK:STDOUT: return %.loc29_45.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf(constants.%Self.653) { @@ -729,12 +730,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf.F(constants.%Self.653) { // CHECK:STDOUT: %Self => constants.%Self.653 -// CHECK:STDOUT: %Self.as_type.loc6_14.1 => constants.%Self.as_type.976 -// CHECK:STDOUT: %pattern_type.loc6_12 => constants.%pattern_type.506 +// CHECK:STDOUT: %Self.as_type.loc6_8.1 => constants.%Self.as_type.976 +// CHECK:STDOUT: %pattern_type.loc6_8 => constants.%pattern_type.506 // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.e57 -// CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%impl.elem0.c15 -// CHECK:STDOUT: %pattern_type.loc6_21 => constants.%pattern_type.a39 -// CHECK:STDOUT: %.loc6_29.1 => constants.%.eb9 +// CHECK:STDOUT: %impl.elem0.loc6_17.1 => constants.%impl.elem0.c15 +// CHECK:STDOUT: %pattern_type.loc6_15 => constants.%pattern_type.a39 +// CHECK:STDOUT: %.loc6_23.1 => constants.%.eb9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf(constants.%.Self.d2f) { @@ -753,12 +754,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet.7f4) { // CHECK:STDOUT: %Self => constants.%J.facet.7f4 -// CHECK:STDOUT: %Self.as_type.loc6_14.1 => constants.%empty_tuple.type -// CHECK:STDOUT: %pattern_type.loc6_12 => constants.%pattern_type.cb1 +// CHECK:STDOUT: %Self.as_type.loc6_8.1 => constants.%empty_tuple.type +// CHECK:STDOUT: %pattern_type.loc6_8 => constants.%pattern_type.cb1 // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness.a18 -// CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%i32 -// CHECK:STDOUT: %pattern_type.loc6_21 => constants.%pattern_type.6b6 -// CHECK:STDOUT: %.loc6_29.1 => constants.%.795 +// CHECK:STDOUT: %impl.elem0.loc6_17.1 => constants.%i32 +// CHECK:STDOUT: %pattern_type.loc6_15 => constants.%pattern_type.6b6 +// CHECK:STDOUT: %.loc6_23.1 => constants.%.795 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf(constants.%J.facet.9f1) { @@ -770,12 +771,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @J.WithSelf.F(constants.%J.facet.9f1) { // CHECK:STDOUT: %Self => constants.%J.facet.9f1 -// CHECK:STDOUT: %Self.as_type.loc6_14.1 => constants.%C -// CHECK:STDOUT: %pattern_type.loc6_12 => constants.%pattern_type.98b +// CHECK:STDOUT: %Self.as_type.loc6_8.1 => constants.%C +// CHECK:STDOUT: %pattern_type.loc6_8 => constants.%pattern_type.98b // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness.aa2 -// CHECK:STDOUT: %impl.elem0.loc6_23.1 => constants.%C -// CHECK:STDOUT: %pattern_type.loc6_21 => constants.%pattern_type.98b -// CHECK:STDOUT: %.loc6_29.1 => constants.%.a44 +// CHECK:STDOUT: %impl.elem0.loc6_17.1 => constants.%C +// CHECK:STDOUT: %pattern_type.loc6_15 => constants.%pattern_type.98b +// CHECK:STDOUT: %.loc6_23.1 => constants.%.a44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- extend_impl_with_associated_type_in_signature.carbon diff --git a/toolchain/check/testdata/impl/using_invalid_interface.carbon b/toolchain/check/testdata/impl/using_invalid_interface.carbon index b8ba53bf1748..728883071d49 100644 --- a/toolchain/check/testdata/impl/using_invalid_interface.carbon +++ b/toolchain/check/testdata/impl/using_invalid_interface.carbon @@ -19,14 +19,14 @@ class ArgToI(T:! I) {} interface IMisuse { let Arg:! type; - // CHECK:STDERR: fail_invalid_interface.carbon:[[@LINE+7]]:26: error: cannot convert type `Arg` into type implementing `I` [ConversionFailureTypeToFacet] - // CHECK:STDERR: fn Op[self: Self]() -> ArgToI(Arg); - // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: fail_invalid_interface.carbon:[[@LINE+7]]:18: error: cannot convert type `Arg` into type implementing `I` [ConversionFailureTypeToFacet] + // CHECK:STDERR: fn Op(self) -> ArgToI(Arg); + // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: fail_invalid_interface.carbon:[[@LINE-7]]:14: note: initializing generic parameter `T` declared here [InitializingGenericParam] // CHECK:STDERR: class ArgToI(T:! I) {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - fn Op[self: Self]() -> ArgToI(Arg); + fn Op(self) -> ArgToI(Arg); } // --- fail_misusing_invalid_interface.carbon @@ -40,23 +40,23 @@ class C { // CHECK:STDERR: ^ // CHECK:STDERR: impl as IMisuse where .Arg = T { - // 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: fail_misusing_invalid_interface.carbon:[[@LINE+4]]:34: error: name `T` not found [NameNotFound] + // CHECK:STDERR: fn Op(unused self) -> ArgToI(T) { + // CHECK:STDERR: ^ // CHECK:STDERR: - fn Op[unused self: Self]() -> ArgToI(T) { + fn Op(unused self) -> ArgToI(T) { return {}; } } } -// CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE+8]]:21: error: missing object argument in method call [MissingObjectInMethodCall] +// CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE+8]]:21: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: fn F(T:! IMisuse) { T.Op(); } // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE-21]]:1: in import [InImport] -// CHECK:STDERR: fail_invalid_interface.carbon:16:3: note: calling function declared here [InCallToFunction] -// CHECK:STDERR: fn Op[self: Self]() -> ArgToI(Arg); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_invalid_interface.carbon:16:3: note: calling function declared here [InCallToEntity] +// CHECK:STDERR: fn Op(self) -> ArgToI(Arg); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn F(T:! IMisuse) { T.Op(); } @@ -84,27 +84,27 @@ class ArgC {} class C { impl as IMisuse where .Arg = ArgC { - // 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+8]]:27: error: cannot convert type `ArgC` into type implementing `I` [ConversionFailureTypeToFacet] + // CHECK:STDERR: fn Op(unused 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[unused self: Self]() -> ArgToI(ArgC) { + fn Op(unused self) -> ArgToI(ArgC) { return {}; } } } -// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+8]]:21: error: missing object argument in method call [MissingObjectInMethodCall] +// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+8]]:21: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: fn F(T:! IMisuse) { T.Op(); } // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE-23]]:1: in import [InImport] -// CHECK:STDERR: fail_invalid_interface.carbon:16:3: note: calling function declared here [InCallToFunction] -// CHECK:STDERR: fn Op[self: Self]() -> ArgToI(Arg); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_invalid_interface.carbon:16:3: note: calling function declared here [InCallToEntity] +// CHECK:STDERR: fn Op(self) -> ArgToI(Arg); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn F(T:! IMisuse) { T.Op(); } diff --git a/toolchain/check/testdata/interface/as_type_of_type.carbon b/toolchain/check/testdata/interface/as_type_of_type.carbon index fe957067009b..81d2259030a6 100644 --- a/toolchain/check/testdata/interface/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/as_type_of_type.carbon @@ -22,6 +22,7 @@ fn F(T:! Empty) { var unused x: T*; } + // CHECK:STDOUT: --- as_type_of_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -140,11 +141,11 @@ fn F(T:! Empty) { // CHECK:STDOUT: %impl.elem0.loc22_19.2: @F.%.loc22_19.4 (%.ddb) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_19.2 (constants.%impl.elem0.98b)] // CHECK:STDOUT: %specific_impl_fn.loc22_19.2: = specific_impl_function %impl.elem0.loc22_19.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc22_19.2) [symbolic = %specific_impl_fn.loc22_19.2 (constants.%specific_impl_fn.f14)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr.loc22_18.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr.loc22_18.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.67a)] -// CHECK:STDOUT: %.loc22_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc22_3 (constants.%.0f5)] -// CHECK:STDOUT: %impl.elem0.loc22_3.2: @F.%.loc22_3 (%.0f5) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_3.2 (constants.%impl.elem0.584)] -// CHECK:STDOUT: %specific_impl_fn.loc22_3.2: = specific_impl_function %impl.elem0.loc22_3.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc22_3.2 (constants.%specific_impl_fn.e4d)] +// CHECK:STDOUT: %Destroy.facet.loc22_3.2: %Destroy.type = facet_value %ptr.loc22_18.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_3.2 (constants.%Destroy.facet)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc22_3.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.67a)] +// CHECK:STDOUT: %.loc22_3.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc22_3.2 [symbolic = %.loc22_3.2 (constants.%.0f5)] +// CHECK:STDOUT: %impl.elem0.loc22_3.2: @F.%.loc22_3.2 (%.0f5) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_3.2 (constants.%impl.elem0.584)] +// CHECK:STDOUT: %specific_impl_fn.loc22_3.2: = specific_impl_function %impl.elem0.loc22_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc22_3.2) [symbolic = %specific_impl_fn.loc22_3.2 (constants.%specific_impl_fn.e4d)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -168,8 +169,10 @@ fn F(T:! Empty) { // CHECK:STDOUT: %ptr.loc22_18.1: type = ptr_type %.loc22_18.2 [symbolic = %ptr.loc22_18.2 (constants.%ptr)] // CHECK:STDOUT: } // CHECK:STDOUT: %x: ref @F.%ptr.loc22_18.2 (%ptr) = ref_binding x, %x.var -// CHECK:STDOUT: %impl.elem0.loc22_3.1: @F.%.loc22_3 (%.0f5) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_3.2 (constants.%impl.elem0.584)] +// CHECK:STDOUT: %impl.elem0.loc22_3.1: @F.%.loc22_3.2 (%.0f5) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_3.2 (constants.%impl.elem0.584)] // CHECK:STDOUT: %bound_method.loc22_3.1: = bound_method %x.var, %impl.elem0.loc22_3.1 +// CHECK:STDOUT: %Destroy.facet.loc22_3.1: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_3.2 (constants.%Destroy.facet)] +// CHECK:STDOUT: %.loc22_3.1: %Destroy.type = converted constants.%ptr, %Destroy.facet.loc22_3.1 [symbolic = %Destroy.facet.loc22_3.2 (constants.%Destroy.facet)] // CHECK:STDOUT: %specific_impl_fn.loc22_3.1: = specific_impl_function %impl.elem0.loc22_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc22_3.2 (constants.%specific_impl_fn.e4d)] // CHECK:STDOUT: %bound_method.loc22_3.2: = bound_method %x.var, %specific_impl_fn.loc22_3.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc22_3.2(%x.var) diff --git a/toolchain/check/testdata/interface/compound_member_access.carbon b/toolchain/check/testdata/interface/compound_member_access.carbon index 1464e7e3d833..84a56d11ac97 100644 --- a/toolchain/check/testdata/interface/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/compound_member_access.carbon @@ -71,8 +71,8 @@ fn Compound3(V:! K2, y: V) { library "[[@TEST_NAME]]"; interface L1 { - fn R1[self: Self](); - fn S1[ref self: Self](); + fn R1(self); + fn S1(ref self); } // Simple member access. @@ -92,26 +92,26 @@ fn Compound4(V:! L1, y: V, p: V*) { library "[[@TEST_NAME]]"; interface L2 { - fn R2[self: Self](); - fn S2[ref self: Self](); + fn R2(self); + fn S2(ref self); } // Simple member access. Fails since calling an instance method without an object. fn Simple5(T:! L2) { - // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall] + // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: T.R2(); // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-9]]:3: note: calling function declared here [InCallToFunction] - // CHECK:STDERR: fn R2[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-9]]:3: note: calling function declared here [InCallToEntity] + // CHECK:STDERR: fn R2(self); + // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: T.R2(); - // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall] + // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: T.S2(); // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-16]]:3: note: calling function declared here [InCallToFunction] - // CHECK:STDERR: fn S2[ref self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_interface_instance_caller_not.carbon:[[@LINE-16]]:3: note: calling function declared here [InCallToEntity] + // CHECK:STDERR: fn S2(ref self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: T.S2(); } @@ -189,6 +189,7 @@ fn Works() { (C as (A & A)).(A.G)(); } + // CHECK:STDOUT: --- associated_constant.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -845,26 +846,26 @@ fn Works() { // CHECK:STDOUT: %self.param_patt: @L1.WithSelf.R1.%pattern_type (%pattern_type.63b) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @L1.WithSelf.R1.%pattern_type (%pattern_type.63b) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @L1.WithSelf.R1.%Self.as_type.loc4_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @L1.WithSelf.R1.%Self.as_type.loc4_9.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc4_9.1: type = splice_block %.loc4_9.2 [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc4_15.2: type = converted %Self.ref, %Self.as_type.loc4_15.2 [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc4_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc4_9.2: type = converted %Self.ref, %Self.as_type.loc4_9.2 [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @L1.WithSelf.R1.%Self.as_type.loc4_15.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @L1.WithSelf.R1.%Self.as_type.loc4_9.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %L1.assoc_type = assoc_entity element0, %L1.WithSelf.R1.decl [concrete = constants.%assoc0] // CHECK:STDOUT: %L1.WithSelf.S1.decl: @L1.WithSelf.%L1.WithSelf.S1.type (%L1.WithSelf.S1.type.ff3) = fn_decl @L1.WithSelf.S1 [symbolic = @L1.WithSelf.%L1.WithSelf.S1 (constants.%L1.WithSelf.S1.11f)] { // CHECK:STDOUT: %self.param_patt: @L1.WithSelf.S1.%pattern_type (%pattern_type.63b) = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @L1.WithSelf.S1.%pattern_type (%pattern_type.63b) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref @L1.WithSelf.S1.%Self.as_type.loc5_19.1 (%Self.as_type) = ref_param call_param0 -// CHECK:STDOUT: %.loc5_19.1: type = splice_block %.loc5_19.2 [symbolic = %Self.as_type.loc5_19.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: ref @L1.WithSelf.S1.%Self.as_type.loc5_13.1 (%Self.as_type) = ref_param call_param0 +// CHECK:STDOUT: %.loc5_13.1: type = splice_block %.loc5_13.2 [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %L1.type = name_ref Self, @L1.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_19.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_19.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_19.2: type = converted %Self.ref, %Self.as_type.loc5_19.2 [symbolic = %Self.as_type.loc5_19.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc5_13.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_13.2: type = converted %Self.ref, %Self.as_type.loc5_13.2 [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: ref @L1.WithSelf.S1.%Self.as_type.loc5_19.1 (%Self.as_type) = ref_binding self, %self.param +// CHECK:STDOUT: %self: ref @L1.WithSelf.S1.%Self.as_type.loc5_13.1 (%Self.as_type) = ref_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc1: %L1.assoc_type = assoc_entity element1, %L1.WithSelf.S1.decl [concrete = constants.%assoc1] // CHECK:STDOUT: @@ -879,18 +880,18 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @L1.WithSelf.R1(@L1.%Self: %L1.type) { // CHECK:STDOUT: %Self: %L1.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc4_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_15.1 [symbolic = %pattern_type (constants.%pattern_type.63b)] +// CHECK:STDOUT: %Self.as_type.loc4_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc4_9.1 [symbolic = %pattern_type (constants.%pattern_type.63b)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @L1.WithSelf.R1.%Self.as_type.loc4_15.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @L1.WithSelf.R1.%Self.as_type.loc4_9.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @L1.WithSelf.S1(@L1.%Self: %L1.type) { // CHECK:STDOUT: %Self: %L1.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_19.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_19.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_19.1 [symbolic = %pattern_type (constants.%pattern_type.63b)] +// CHECK:STDOUT: %Self.as_type.loc5_13.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_13.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_13.1 [symbolic = %pattern_type (constants.%pattern_type.63b)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: ref @L1.WithSelf.S1.%Self.as_type.loc5_19.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: ref @L1.WithSelf.S1.%Self.as_type.loc5_13.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Simple4(%T.loc9_13.2: %L1.type) { @@ -904,9 +905,9 @@ fn Works() { // CHECK:STDOUT: %require_complete.loc9_21: = require_complete_type %T.as_type.loc9_23.1 [symbolic = %require_complete.loc9_21 (constants.%require_complete.770490.1)] // CHECK:STDOUT: %require_complete.loc9_27: = require_complete_type %ptr.loc9_30.1 [symbolic = %require_complete.loc9_27 (constants.%require_complete.0d59a1.1)] // CHECK:STDOUT: %L1.WithSelf.R1.type: type = fn_type @L1.WithSelf.R1, @L1.WithSelf(%T.loc9_13.1) [symbolic = %L1.WithSelf.R1.type (constants.%L1.WithSelf.R1.type.62535e.1)] -// CHECK:STDOUT: %.loc10: type = fn_type_with_self_type %L1.WithSelf.R1.type, %T.loc9_13.1 [symbolic = %.loc10 (constants.%.56f6e0.1)] +// CHECK:STDOUT: %.loc10_4: type = fn_type_with_self_type %L1.WithSelf.R1.type, %T.loc9_13.1 [symbolic = %.loc10_4 (constants.%.56f6e0.1)] // CHECK:STDOUT: %L1.lookup_impl_witness: = lookup_impl_witness %T.loc9_13.1, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.cca206.1)] -// CHECK:STDOUT: %impl.elem0.loc10_4.2: @Simple4.%.loc10 (%.56f6e0.1) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.4e8926.1)] +// CHECK:STDOUT: %impl.elem0.loc10_4.2: @Simple4.%.loc10_4 (%.56f6e0.1) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.4e8926.1)] // CHECK:STDOUT: %specific_impl_fn.loc10_4.2: = specific_impl_function %impl.elem0.loc10_4.2, @L1.WithSelf.R1(%T.loc9_13.1) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.e046e8.1)] // CHECK:STDOUT: %L1.WithSelf.S1.type: type = fn_type @L1.WithSelf.S1, @L1.WithSelf(%T.loc9_13.1) [symbolic = %L1.WithSelf.S1.type (constants.%L1.WithSelf.S1.type.690082.1)] // CHECK:STDOUT: %.loc11_4.2: type = fn_type_with_self_type %L1.WithSelf.S1.type, %T.loc9_13.1 [symbolic = %.loc11_4.2 (constants.%.b63157.1)] @@ -917,8 +918,9 @@ fn Works() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @Simple4.%T.as_type.loc9_23.1 (%T.as_type) = name_ref x, %x // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.WithSelf.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc10_4.1: @Simple4.%.loc10 (%.56f6e0.1) = impl_witness_access constants.%L1.lookup_impl_witness.cca206.1, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.4e8926.1)] +// CHECK:STDOUT: %impl.elem0.loc10_4.1: @Simple4.%.loc10_4 (%.56f6e0.1) = impl_witness_access constants.%L1.lookup_impl_witness.cca206.1, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0.4e8926.1)] // CHECK:STDOUT: %bound_method.loc10_4: = bound_method %x.ref, %impl.elem0.loc10_4.1 +// CHECK:STDOUT: %.loc10_8: %L1.type = converted constants.%T.as_type, constants.%T [symbolic = %T.loc9_13.1 (constants.%T)] // CHECK:STDOUT: %specific_impl_fn.loc10_4.1: = specific_impl_function %impl.elem0.loc10_4.1, @L1.WithSelf.R1(constants.%T) [symbolic = %specific_impl_fn.loc10_4.2 (constants.%specific_impl_fn.e046e8.1)] // CHECK:STDOUT: %bound_method.loc10_8: = bound_method %x.ref, %specific_impl_fn.loc10_4.1 // CHECK:STDOUT: %L1.WithSelf.R1.call: init %empty_tuple.type = call %bound_method.loc10_8(%x.ref) @@ -927,6 +929,7 @@ fn Works() { // CHECK:STDOUT: %S1.ref: %L1.assoc_type = name_ref S1, @L1.WithSelf.%assoc1 [concrete = constants.%assoc1] // CHECK:STDOUT: %impl.elem1.loc11_4.1: @Simple4.%.loc11_4.2 (%.b63157.1) = impl_witness_access constants.%L1.lookup_impl_witness.cca206.1, element1 [symbolic = %impl.elem1.loc11_4.2 (constants.%impl.elem1.86bb43.1)] // CHECK:STDOUT: %bound_method.loc11_4: = bound_method %.loc11_4.1, %impl.elem1.loc11_4.1 +// CHECK:STDOUT: %.loc11_9: %L1.type = converted constants.%T.as_type, constants.%T [symbolic = %T.loc9_13.1 (constants.%T)] // CHECK:STDOUT: %specific_impl_fn.loc11_4.1: = specific_impl_function %impl.elem1.loc11_4.1, @L1.WithSelf.S1(constants.%T) [symbolic = %specific_impl_fn.loc11_4.2 (constants.%specific_impl_fn.340d61.1)] // CHECK:STDOUT: %bound_method.loc11_9: = bound_method %.loc11_4.1, %specific_impl_fn.loc11_4.1 // CHECK:STDOUT: %L1.WithSelf.S1.call: init %empty_tuple.type = call %bound_method.loc11_9(%.loc11_4.1) @@ -945,9 +948,9 @@ fn Works() { // CHECK:STDOUT: %require_complete.loc15_23: = require_complete_type %V.as_type.loc15_25.1 [symbolic = %require_complete.loc15_23 (constants.%require_complete.770490.2)] // CHECK:STDOUT: %require_complete.loc15_29: = require_complete_type %ptr.loc15_32.1 [symbolic = %require_complete.loc15_29 (constants.%require_complete.0d59a1.2)] // CHECK:STDOUT: %L1.WithSelf.R1.type: type = fn_type @L1.WithSelf.R1, @L1.WithSelf(%V.loc15_15.1) [symbolic = %L1.WithSelf.R1.type (constants.%L1.WithSelf.R1.type.62535e.2)] -// CHECK:STDOUT: %.loc16: type = fn_type_with_self_type %L1.WithSelf.R1.type, %V.loc15_15.1 [symbolic = %.loc16 (constants.%.56f6e0.2)] +// CHECK:STDOUT: %.loc16_4: type = fn_type_with_self_type %L1.WithSelf.R1.type, %V.loc15_15.1 [symbolic = %.loc16_4 (constants.%.56f6e0.2)] // CHECK:STDOUT: %L1.lookup_impl_witness: = lookup_impl_witness %V.loc15_15.1, @L1 [symbolic = %L1.lookup_impl_witness (constants.%L1.lookup_impl_witness.cca206.2)] -// CHECK:STDOUT: %impl.elem0.loc16_4.2: @Compound4.%.loc16 (%.56f6e0.2) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.4e8926.2)] +// CHECK:STDOUT: %impl.elem0.loc16_4.2: @Compound4.%.loc16_4 (%.56f6e0.2) = impl_witness_access %L1.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.4e8926.2)] // CHECK:STDOUT: %specific_impl_fn.loc16_4.2: = specific_impl_function %impl.elem0.loc16_4.2, @L1.WithSelf.R1(%V.loc15_15.1) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.e046e8.2)] // CHECK:STDOUT: %L1.WithSelf.S1.type: type = fn_type @L1.WithSelf.S1, @L1.WithSelf(%V.loc15_15.1) [symbolic = %L1.WithSelf.S1.type (constants.%L1.WithSelf.S1.type.690082.2)] // CHECK:STDOUT: %.loc17_4.2: type = fn_type_with_self_type %L1.WithSelf.S1.type, %V.loc15_15.1 [symbolic = %.loc17_4.2 (constants.%.b63157.2)] @@ -959,8 +962,9 @@ fn Works() { // CHECK:STDOUT: %y.ref: @Compound4.%V.as_type.loc15_25.1 (%V.as_type) = name_ref y, %y // CHECK:STDOUT: %L1.ref.loc16: type = name_ref L1, file.%L1.decl [concrete = constants.%L1.type] // CHECK:STDOUT: %R1.ref: %L1.assoc_type = name_ref R1, @L1.WithSelf.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc16_4.1: @Compound4.%.loc16 (%.56f6e0.2) = impl_witness_access constants.%L1.lookup_impl_witness.cca206.2, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.4e8926.2)] +// CHECK:STDOUT: %impl.elem0.loc16_4.1: @Compound4.%.loc16_4 (%.56f6e0.2) = impl_witness_access constants.%L1.lookup_impl_witness.cca206.2, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.4e8926.2)] // CHECK:STDOUT: %bound_method.loc16_4: = bound_method %y.ref, %impl.elem0.loc16_4.1 +// CHECK:STDOUT: %.loc16_13: %L1.type = converted constants.%V.as_type, constants.%V [symbolic = %V.loc15_15.1 (constants.%V)] // CHECK:STDOUT: %specific_impl_fn.loc16_4.1: = specific_impl_function %impl.elem0.loc16_4.1, @L1.WithSelf.R1(constants.%V) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.e046e8.2)] // CHECK:STDOUT: %bound_method.loc16_13: = bound_method %y.ref, %specific_impl_fn.loc16_4.1 // CHECK:STDOUT: %L1.WithSelf.R1.call: init %empty_tuple.type = call %bound_method.loc16_13(%y.ref) @@ -970,6 +974,7 @@ fn Works() { // CHECK:STDOUT: %.loc17_4.1: ref @Compound4.%V.as_type.loc15_25.1 (%V.as_type) = deref %p.ref // CHECK:STDOUT: %impl.elem1.loc17_4.1: @Compound4.%.loc17_4.2 (%.b63157.2) = impl_witness_access constants.%L1.lookup_impl_witness.cca206.2, element1 [symbolic = %impl.elem1.loc17_4.2 (constants.%impl.elem1.86bb43.2)] // CHECK:STDOUT: %bound_method.loc17_4: = bound_method %.loc17_4.1, %impl.elem1.loc17_4.1 +// CHECK:STDOUT: %.loc17_14: %L1.type = converted constants.%V.as_type, constants.%V [symbolic = %V.loc15_15.1 (constants.%V)] // CHECK:STDOUT: %specific_impl_fn.loc17_4.1: = specific_impl_function %impl.elem1.loc17_4.1, @L1.WithSelf.S1(constants.%V) [symbolic = %specific_impl_fn.loc17_4.2 (constants.%specific_impl_fn.340d61.2)] // CHECK:STDOUT: %bound_method.loc17_14: = bound_method %.loc17_4.1, %specific_impl_fn.loc17_4.1 // CHECK:STDOUT: %L1.WithSelf.S1.call: init %empty_tuple.type = call %bound_method.loc17_14(%.loc17_4.1) @@ -988,13 +993,13 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: specific @L1.WithSelf.R1(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc4_9.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.63b // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @L1.WithSelf.S1(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_19.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_13.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.63b // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1017,13 +1022,13 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: specific @L1.WithSelf.R1(constants.%T) { // CHECK:STDOUT: %Self => constants.%T -// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%T.as_type +// CHECK:STDOUT: %Self.as_type.loc4_9.1 => constants.%T.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.5697a7.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @L1.WithSelf.S1(constants.%T) { // CHECK:STDOUT: %Self => constants.%T -// CHECK:STDOUT: %Self.as_type.loc5_19.1 => constants.%T.as_type +// CHECK:STDOUT: %Self.as_type.loc5_13.1 => constants.%T.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.5697a7.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1046,13 +1051,13 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: specific @L1.WithSelf.R1(constants.%V) { // CHECK:STDOUT: %Self => constants.%V -// CHECK:STDOUT: %Self.as_type.loc4_15.1 => constants.%V.as_type +// CHECK:STDOUT: %Self.as_type.loc4_9.1 => constants.%V.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.5697a7.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @L1.WithSelf.S1(constants.%V) { // CHECK:STDOUT: %Self => constants.%V -// CHECK:STDOUT: %Self.as_type.loc5_19.1 => constants.%V.as_type +// CHECK:STDOUT: %Self.as_type.loc5_13.1 => constants.%V.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.5697a7.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1064,7 +1069,6 @@ fn Works() { // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] // CHECK:STDOUT: %pattern_type.b91: type = pattern_type %Self.as_type [symbolic] // CHECK:STDOUT: %L2.WithSelf.R2.type.bc0: type = fn_type @L2.WithSelf.R2, @L2.WithSelf(%Self) [symbolic] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %L2.WithSelf.R2.efd: %L2.WithSelf.R2.type.bc0 = struct_value () [symbolic] // CHECK:STDOUT: %L2.assoc_type: type = assoc_entity_type @L2 [concrete] // CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, @L2.WithSelf.%L2.WithSelf.R2.decl [concrete] @@ -1085,11 +1089,8 @@ fn Works() { // CHECK:STDOUT: %L2.lookup_impl_witness.d84: = lookup_impl_witness %T, @L2 [symbolic] // CHECK:STDOUT: %.244: type = fn_type_with_self_type %L2.WithSelf.R2.type.1a9, %T [symbolic] // CHECK:STDOUT: %impl.elem0: %.244 = impl_witness_access %L2.lookup_impl_witness.d84, element0 [symbolic] -// CHECK:STDOUT: %pattern_type.dc8: type = pattern_type %T.as_type [symbolic] -// CHECK:STDOUT: %specific_impl_fn.0a8: = specific_impl_function %impl.elem0, @L2.WithSelf.R2(%T) [symbolic] // CHECK:STDOUT: %.451: type = fn_type_with_self_type %L2.WithSelf.S2.type.937, %T [symbolic] // CHECK:STDOUT: %impl.elem1: %.451 = impl_witness_access %L2.lookup_impl_witness.d84, element1 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.aa5: = specific_impl_function %impl.elem1, @L2.WithSelf.S2(%T) [symbolic] // CHECK:STDOUT: %V: %L2.type = symbolic_binding V, 0 [symbolic] // CHECK:STDOUT: %Compound5.type: type = fn_type @Compound5 [concrete] // CHECK:STDOUT: %Compound5: %Compound5.type = struct_value () [concrete] @@ -1140,26 +1141,26 @@ fn Works() { // CHECK:STDOUT: %self.param_patt: @L2.WithSelf.R2.%pattern_type (%pattern_type.b91) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @L2.WithSelf.R2.%pattern_type (%pattern_type.b91) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @L2.WithSelf.R2.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @L2.WithSelf.R2.%Self.as_type.loc5_9.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_9.1: type = splice_block %.loc5_9.2 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %L2.type = name_ref Self, @L2.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc5_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_9.2: type = converted %Self.ref, %Self.as_type.loc5_9.2 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @L2.WithSelf.R2.%Self.as_type.loc5_15.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @L2.WithSelf.R2.%Self.as_type.loc5_9.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, %L2.WithSelf.R2.decl [concrete = constants.%assoc0] // CHECK:STDOUT: %L2.WithSelf.S2.decl: @L2.WithSelf.%L2.WithSelf.S2.type (%L2.WithSelf.S2.type.51d) = fn_decl @L2.WithSelf.S2 [symbolic = @L2.WithSelf.%L2.WithSelf.S2 (constants.%L2.WithSelf.S2.a11)] { // CHECK:STDOUT: %self.param_patt: @L2.WithSelf.S2.%pattern_type (%pattern_type.b91) = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @L2.WithSelf.S2.%pattern_type (%pattern_type.b91) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref @L2.WithSelf.S2.%Self.as_type.loc6_19.1 (%Self.as_type) = ref_param call_param0 -// CHECK:STDOUT: %.loc6_19.1: type = splice_block %.loc6_19.2 [symbolic = %Self.as_type.loc6_19.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: ref @L2.WithSelf.S2.%Self.as_type.loc6_13.1 (%Self.as_type) = ref_param call_param0 +// CHECK:STDOUT: %.loc6_13.1: type = splice_block %.loc6_13.2 [symbolic = %Self.as_type.loc6_13.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %L2.type = name_ref Self, @L2.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc6_19.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_19.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc6_19.2: type = converted %Self.ref, %Self.as_type.loc6_19.2 [symbolic = %Self.as_type.loc6_19.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc6_13.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_13.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc6_13.2: type = converted %Self.ref, %Self.as_type.loc6_13.2 [symbolic = %Self.as_type.loc6_13.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: ref @L2.WithSelf.S2.%Self.as_type.loc6_19.1 (%Self.as_type) = ref_binding self, %self.param +// CHECK:STDOUT: %self: ref @L2.WithSelf.S2.%Self.as_type.loc6_13.1 (%Self.as_type) = ref_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc1: %L2.assoc_type = assoc_entity element1, %L2.WithSelf.S2.decl [concrete = constants.%assoc1] // CHECK:STDOUT: @@ -1174,18 +1175,18 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @L2.WithSelf.R2(@L2.%Self: %L2.type) { // CHECK:STDOUT: %Self: %L2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type (constants.%pattern_type.b91)] +// CHECK:STDOUT: %Self.as_type.loc5_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_9.1 [symbolic = %pattern_type (constants.%pattern_type.b91)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @L2.WithSelf.R2.%Self.as_type.loc5_15.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @L2.WithSelf.R2.%Self.as_type.loc5_9.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @L2.WithSelf.S2(@L2.%Self: %L2.type) { // CHECK:STDOUT: %Self: %L2.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc6_19.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_19.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc6_19.1 [symbolic = %pattern_type (constants.%pattern_type.b91)] +// CHECK:STDOUT: %Self.as_type.loc6_13.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_13.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc6_13.1 [symbolic = %pattern_type (constants.%pattern_type.b91)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: ref @L2.WithSelf.S2.%Self.as_type.loc6_19.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: ref @L2.WithSelf.S2.%Self.as_type.loc6_13.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Simple5(%T.loc10_13.2: %L2.type) { @@ -1197,11 +1198,9 @@ fn Works() { // CHECK:STDOUT: %.loc18_4.2: type = fn_type_with_self_type %L2.WithSelf.R2.type, %T.loc10_13.1 [symbolic = %.loc18_4.2 (constants.%.244)] // CHECK:STDOUT: %L2.lookup_impl_witness: = lookup_impl_witness %T.loc10_13.1, @L2 [symbolic = %L2.lookup_impl_witness (constants.%L2.lookup_impl_witness.d84)] // CHECK:STDOUT: %impl.elem0.loc18_4.2: @Simple5.%.loc18_4.2 (%.244) = impl_witness_access %L2.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc18_4.2: = specific_impl_function %impl.elem0.loc18_4.2, @L2.WithSelf.R2(%T.loc10_13.1) [symbolic = %specific_impl_fn.loc18_4.2 (constants.%specific_impl_fn.0a8)] // CHECK:STDOUT: %L2.WithSelf.S2.type: type = fn_type @L2.WithSelf.S2, @L2.WithSelf(%T.loc10_13.1) [symbolic = %L2.WithSelf.S2.type (constants.%L2.WithSelf.S2.type.937)] // CHECK:STDOUT: %.loc26_4.2: type = fn_type_with_self_type %L2.WithSelf.S2.type, %T.loc10_13.1 [symbolic = %.loc26_4.2 (constants.%.451)] // CHECK:STDOUT: %impl.elem1.loc26_4.2: @Simple5.%.loc26_4.2 (%.451) = impl_witness_access %L2.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_impl_fn.loc26_4.2: = specific_impl_function %impl.elem1.loc26_4.2, @L2.WithSelf.S2(%T.loc10_13.1) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.aa5)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -1210,15 +1209,11 @@ fn Works() { // CHECK:STDOUT: %.loc18_4.1: type = converted %T.ref.loc18, %T.as_type.loc18_4.1 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] // CHECK:STDOUT: %R2.ref: %L2.assoc_type = name_ref R2, @L2.WithSelf.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0.loc18_4.1: @Simple5.%.loc18_4.2 (%.244) = impl_witness_access constants.%L2.lookup_impl_witness.d84, element0 [symbolic = %impl.elem0.loc18_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc18_4.1: = specific_impl_function %impl.elem0.loc18_4.1, @L2.WithSelf.R2(constants.%T) [symbolic = %specific_impl_fn.loc18_4.2 (constants.%specific_impl_fn.0a8)] -// CHECK:STDOUT: %L2.WithSelf.R2.call: init %empty_tuple.type = call %specific_impl_fn.loc18_4.1() // CHECK:STDOUT: %T.ref.loc26: %L2.type = name_ref T, %T.loc10_13.2 [symbolic = %T.loc10_13.1 (constants.%T)] // CHECK:STDOUT: %T.as_type.loc26: type = facet_access_type %T.ref.loc26 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] // CHECK:STDOUT: %.loc26_4.1: type = converted %T.ref.loc26, %T.as_type.loc26 [symbolic = %T.as_type.loc18_4.2 (constants.%T.as_type)] // CHECK:STDOUT: %S2.ref: %L2.assoc_type = name_ref S2, @L2.WithSelf.%assoc1 [concrete = constants.%assoc1] // CHECK:STDOUT: %impl.elem1.loc26_4.1: @Simple5.%.loc26_4.2 (%.451) = impl_witness_access constants.%L2.lookup_impl_witness.d84, element1 [symbolic = %impl.elem1.loc26_4.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_impl_fn.loc26_4.1: = specific_impl_function %impl.elem1.loc26_4.1, @L2.WithSelf.S2(constants.%T) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn.aa5)] -// CHECK:STDOUT: %L2.WithSelf.S2.call: init %empty_tuple.type = call %specific_impl_fn.loc26_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1251,13 +1246,13 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: specific @L2.WithSelf.R2(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_9.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @L2.WithSelf.S2(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc6_19.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc6_13.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b91 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1274,18 +1269,6 @@ fn Works() { // CHECK:STDOUT: %L2.WithSelf.S2 => constants.%L2.WithSelf.S2.c68 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @L2.WithSelf.R2(constants.%T) { -// CHECK:STDOUT: %Self => constants.%T -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%T.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc8 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @L2.WithSelf.S2(constants.%T) { -// CHECK:STDOUT: %Self => constants.%T -// CHECK:STDOUT: %Self.as_type.loc6_19.1 => constants.%T.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc8 -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: specific @Compound5(constants.%V) { // CHECK:STDOUT: %V.loc30_15.1 => constants.%V // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/default_fn.carbon b/toolchain/check/testdata/interface/default_fn.carbon index 76cabb5c24a0..584eaef2e1a0 100644 --- a/toolchain/check/testdata/interface/default_fn.carbon +++ b/toolchain/check/testdata/interface/default_fn.carbon @@ -15,7 +15,7 @@ class C { interface I { // TODO: Use `default` here. - fn F[unused self: Self]() { + fn F(unused self) { // I and F are both complete here, and the impl below is in scope. var c: C = {}; c.(I.F)(); @@ -23,10 +23,11 @@ class C { } impl C as I { - fn F[unused self: Self]() {} + fn F(unused self) {} } } + // CHECK:STDOUT: --- default_fn.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -85,13 +86,13 @@ class C { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type.492) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type (%pattern_type.492) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc18_23.1 (%Self.as_type.0fa) = value_param call_param0 -// CHECK:STDOUT: %.loc18_23.1: type = splice_block %.loc18_23.2 [symbolic = %Self.as_type.loc18_23.1 (constants.%Self.as_type.0fa)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc18_17.1 (%Self.as_type.0fa) = value_param call_param0 +// CHECK:STDOUT: %.loc18_17.1: type = splice_block %.loc18_17.2 [symbolic = %Self.as_type.loc18_17.1 (constants.%Self.as_type.0fa)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.4e9)] -// CHECK:STDOUT: %Self.as_type.loc18_23.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc18_23.1 (constants.%Self.as_type.0fa)] -// CHECK:STDOUT: %.loc18_23.2: type = converted %Self.ref, %Self.as_type.loc18_23.2 [symbolic = %Self.as_type.loc18_23.1 (constants.%Self.as_type.0fa)] +// CHECK:STDOUT: %Self.as_type.loc18_17.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc18_17.1 (constants.%Self.as_type.0fa)] +// CHECK:STDOUT: %.loc18_17.2: type = converted %Self.ref, %Self.as_type.loc18_17.2 [symbolic = %Self.as_type.loc18_17.1 (constants.%Self.as_type.0fa)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc18_23.1 (%Self.as_type.0fa) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc18_17.1 (%Self.as_type.0fa) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0.08d] // CHECK:STDOUT: @@ -142,13 +143,13 @@ class C { // 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.4e9)] -// CHECK:STDOUT: %Self.as_type.loc18_23.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc18_23.1 (constants.%Self.as_type.0fa)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc18_23.1 [symbolic = %pattern_type (constants.%pattern_type.492)] +// CHECK:STDOUT: %Self.as_type.loc18_17.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc18_17.1 (constants.%Self.as_type.0fa)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc18_17.1 [symbolic = %pattern_type (constants.%pattern_type.492)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc18_23.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc18_17.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc18_23.1 (%Self.as_type.0fa)) { +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc18_17.1 (%Self.as_type.0fa)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete] @@ -195,7 +196,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self.4e9) { // CHECK:STDOUT: %Self => constants.%Self.4e9 -// CHECK:STDOUT: %Self.as_type.loc18_23.1 => constants.%Self.as_type.0fa +// CHECK:STDOUT: %Self.as_type.loc18_17.1 => constants.%Self.as_type.0fa // CHECK:STDOUT: %pattern_type => constants.%pattern_type.492 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -208,7 +209,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet) { // CHECK:STDOUT: %Self => constants.%I.facet -// CHECK:STDOUT: %Self.as_type.loc18_23.1 => constants.%C +// CHECK:STDOUT: %Self.as_type.loc18_17.1 => constants.%C // CHECK:STDOUT: %pattern_type => constants.%pattern_type.98b // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon index 0a6b88db2acb..016a52e42952 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon @@ -48,7 +48,7 @@ interface J2 { library "[[@TEST_NAME]]"; interface A { - fn F[self: Self]() -> type; + fn F(self) -> type; } interface B { alias F = A.F; @@ -63,9 +63,9 @@ interface B { library "[[@TEST_NAME]]"; interface C { - fn F[self: Self](); + fn F(self); // TODO: Add `default` once supported. - fn G[self: Self]() { + fn G(self) { //@dump-sem-ir-begin self.F(); self.(F)(); @@ -73,6 +73,7 @@ interface C { } } + // CHECK:STDOUT: --- alias_to_different_interface_with_requires.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -199,24 +200,26 @@ interface C { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %C.WithSelf.F.type: type = fn_type @C.WithSelf.F, @C.WithSelf(%Self) [symbolic = %C.WithSelf.F.type (constants.%C.WithSelf.F.type)] -// CHECK:STDOUT: %.loc8: type = fn_type_with_self_type %C.WithSelf.F.type, %Self [symbolic = %.loc8 (constants.%.b5a)] +// CHECK:STDOUT: %.loc8_9: type = fn_type_with_self_type %C.WithSelf.F.type, %Self [symbolic = %.loc8_9 (constants.%.b5a)] // CHECK:STDOUT: %C.lookup_impl_witness: = lookup_impl_witness %Self, @C [symbolic = %C.lookup_impl_witness (constants.%C.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc8_9.2: @C.WithSelf.G.%.loc8 (%.b5a) = impl_witness_access %C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_9.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc8_9.2: @C.WithSelf.G.%.loc8_9 (%.b5a) = impl_witness_access %C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_9.2 (constants.%impl.elem0)] // CHECK:STDOUT: %specific_impl_fn.loc8_9.2: = specific_impl_function %impl.elem0.loc8_9.2, @C.WithSelf.F(%Self) [symbolic = %specific_impl_fn.loc8_9.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @C.WithSelf.G.%Self.as_type.loc6_14.1 (%Self.as_type)) { +// CHECK:STDOUT: fn(%self.param: @C.WithSelf.G.%Self.as_type.loc6_8.1 (%Self.as_type)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref.loc8: @C.WithSelf.G.%Self.as_type.loc6_14.1 (%Self.as_type) = name_ref self, %self +// CHECK:STDOUT: %self.ref.loc8: @C.WithSelf.G.%Self.as_type.loc6_8.1 (%Self.as_type) = name_ref self, %self // CHECK:STDOUT: %F.ref.loc8: %C.assoc_type = name_ref F, @C.WithSelf.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc8_9.1: @C.WithSelf.G.%.loc8 (%.b5a) = impl_witness_access constants.%C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_9.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc8_9.1: @C.WithSelf.G.%.loc8_9 (%.b5a) = impl_witness_access constants.%C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_9.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc8_9: = bound_method %self.ref.loc8, %impl.elem0.loc8_9.1 +// CHECK:STDOUT: %.loc8_12: %C.type = converted constants.%Self.as_type, constants.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %specific_impl_fn.loc8_9.1: = specific_impl_function %impl.elem0.loc8_9.1, @C.WithSelf.F(constants.%Self) [symbolic = %specific_impl_fn.loc8_9.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc8_12: = bound_method %self.ref.loc8, %specific_impl_fn.loc8_9.1 // CHECK:STDOUT: %C.WithSelf.F.call.loc8: init %empty_tuple.type = call %bound_method.loc8_12(%self.ref.loc8) -// CHECK:STDOUT: %self.ref.loc9: @C.WithSelf.G.%Self.as_type.loc6_14.1 (%Self.as_type) = name_ref self, %self -// CHECK:STDOUT: %impl.elem0.loc9: @C.WithSelf.G.%.loc8 (%.b5a) = impl_witness_access constants.%C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_9.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %F.ref.loc9: @C.WithSelf.G.%.loc8 (%.b5a) = name_ref F, %impl.elem0.loc9 [symbolic = %impl.elem0.loc8_9.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %self.ref.loc9: @C.WithSelf.G.%Self.as_type.loc6_8.1 (%Self.as_type) = name_ref self, %self +// CHECK:STDOUT: %impl.elem0.loc9: @C.WithSelf.G.%.loc8_9 (%.b5a) = impl_witness_access constants.%C.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc8_9.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %F.ref.loc9: @C.WithSelf.G.%.loc8_9 (%.b5a) = name_ref F, %impl.elem0.loc9 [symbolic = %impl.elem0.loc8_9.2 (constants.%impl.elem0)] // CHECK:STDOUT: %bound_method.loc9_9: = bound_method %self.ref.loc9, %F.ref.loc9 +// CHECK:STDOUT: %.loc9: %C.type = converted constants.%Self.as_type, constants.%Self [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: %specific_impl_fn.loc9: = specific_impl_function %F.ref.loc9, @C.WithSelf.F(constants.%Self) [symbolic = %specific_impl_fn.loc8_9.2 (constants.%specific_impl_fn)] // CHECK:STDOUT: %bound_method.loc9_14: = bound_method %self.ref.loc9, %specific_impl_fn.loc9 // CHECK:STDOUT: %C.WithSelf.F.call.loc9: init %empty_tuple.type = call %bound_method.loc9_14(%self.ref.loc9) @@ -235,7 +238,7 @@ interface C { // CHECK:STDOUT: // CHECK:STDOUT: specific @C.WithSelf.G(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc6_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc6_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon b/toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon index e15217a70fb8..cff5801c5aa2 100644 --- a/toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; interface I { - fn F[self: Self](); + fn F(self); } fn Use(T:! I) { @@ -28,6 +28,7 @@ fn Use(T:! I) { T.F.member; } + // CHECK:STDOUT: --- fail_member_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -80,13 +81,13 @@ fn Use(T:! I) { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type.c60) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type (%pattern_type.c60) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_14.1: type = splice_block %.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_8.1: type = splice_block %.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_14.2: type = converted %Self.ref, %Self.as_type.loc5_14.2 [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc5_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_8.2: type = converted %Self.ref, %Self.as_type.loc5_8.2 [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -100,10 +101,10 @@ fn Use(T:! I) { // 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)] -// CHECK:STDOUT: %Self.as_type.loc5_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_14.1 [symbolic = %pattern_type (constants.%pattern_type.c60)] +// CHECK:STDOUT: %Self.as_type.loc5_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_8.1 [symbolic = %pattern_type (constants.%pattern_type.c60)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc5_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc5_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Use(%T.loc8_9.2: %I.type) { @@ -137,7 +138,7 @@ fn Use(T:! I) { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc5_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c60 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_duplicate.carbon b/toolchain/check/testdata/interface/fail_duplicate.carbon index 9fff10d356a4..a289f55b54ba 100644 --- a/toolchain/check/testdata/interface/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/fail_duplicate.carbon @@ -43,7 +43,7 @@ interface Interface {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: interface Interface { - fn F[self: Self](); + fn F(self); } // --- fail_name_conflict_with_fn.carbon @@ -74,6 +74,7 @@ class Class; // CHECK:STDERR: interface Class { } + // CHECK:STDOUT: --- fail_redefine_without_dependents.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -175,13 +176,13 @@ interface Class { } // CHECK:STDOUT: %self.param_patt: @Interface.WithSelf.F.%pattern_type (%pattern_type) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @Interface.WithSelf.F.%pattern_type (%pattern_type) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @Interface.WithSelf.F.%Self.as_type.loc14_14.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc14_14.1: type = splice_block %.loc14_14.2 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @Interface.WithSelf.F.%Self.as_type.loc14_8.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc14_8.1: type = splice_block %.loc14_8.2 [symbolic = %Self.as_type.loc14_8.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %Interface.type.283524.2 = name_ref Self, @Interface.loc13.%Self [symbolic = %Self (constants.%Self.3ce02d.2)] -// CHECK:STDOUT: %Self.as_type.loc14_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc14_14.2: type = converted %Self.ref, %Self.as_type.loc14_14.2 [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc14_8.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc14_8.2: type = converted %Self.ref, %Self.as_type.loc14_8.2 [symbolic = %Self.as_type.loc14_8.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Interface.WithSelf.F.%Self.as_type.loc14_14.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @Interface.WithSelf.F.%Self.as_type.loc14_8.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %Interface.assoc_type = assoc_entity element0, %Interface.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -195,10 +196,10 @@ interface Class { } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Interface.WithSelf.F(@Interface.loc13.%Self: %Interface.type.283524.2) { // CHECK:STDOUT: %Self: %Interface.type.283524.2 = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3ce02d.2)] -// CHECK:STDOUT: %Self.as_type.loc14_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc14_14.1 [symbolic = %pattern_type (constants.%pattern_type)] +// CHECK:STDOUT: %Self.as_type.loc14_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc14_8.1 [symbolic = %pattern_type (constants.%pattern_type)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Interface.WithSelf.F.%Self.as_type.loc14_14.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @Interface.WithSelf.F.%Self.as_type.loc14_8.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Interface.WithSelf.loc4(constants.%Self.3ce02d.1) {} @@ -207,7 +208,7 @@ interface Class { } // CHECK:STDOUT: // CHECK:STDOUT: specific @Interface.WithSelf.F(constants.%Self.3ce02d.2) { // CHECK:STDOUT: %Self => constants.%Self.3ce02d.2 -// CHECK:STDOUT: %Self.as_type.loc14_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc14_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_modifiers.carbon b/toolchain/check/testdata/interface/fail_modifiers.carbon index 84bcf89ca3b6..1cafa2acd926 100644 --- a/toolchain/check/testdata/interface/fail_modifiers.carbon +++ b/toolchain/check/testdata/interface/fail_modifiers.carbon @@ -60,10 +60,10 @@ library "[[@TEST_NAME]]"; interface I { // CHECK:STDERR: fail_private_member.carbon:[[@LINE+4]]:3: error: `private` not allowed; requires class or file scope [ModifierPrivateNotAllowed] - // CHECK:STDERR: private fn F[self: Self](); + // CHECK:STDERR: private fn F(self); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - private fn F[self: Self](); + private fn F(self); } // --- fail_protected_member.carbon @@ -72,10 +72,10 @@ library "[[@TEST_NAME]]"; interface I { // CHECK:STDERR: fail_protected_member.carbon:[[@LINE+4]]:3: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] - // CHECK:STDERR: protected fn F[self: Self](); + // CHECK:STDERR: protected fn F(self); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: - protected fn F[self: Self](); + protected fn F(self); } // CHECK:STDOUT: --- fail_abstract.carbon @@ -191,13 +191,13 @@ interface I { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type (%pattern_type) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc9_22.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_22.1: type = splice_block %.loc9_22.2 [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc9_16.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc9_16.1: type = splice_block %.loc9_16.2 [symbolic = %Self.as_type.loc9_16.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc9_22.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc9_22.2: type = converted %Self.ref, %Self.as_type.loc9_22.2 [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc9_16.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc9_16.2: type = converted %Self.ref, %Self.as_type.loc9_16.2 [symbolic = %Self.as_type.loc9_16.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc9_22.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc9_16.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -211,17 +211,17 @@ interface I { // 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)] -// CHECK:STDOUT: %Self.as_type.loc9_22.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_22.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc9_22.1 [symbolic = %pattern_type (constants.%pattern_type)] +// CHECK:STDOUT: %Self.as_type.loc9_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc9_16.1 [symbolic = %pattern_type (constants.%pattern_type)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc9_22.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc9_16.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc9_22.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc9_16.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type // CHECK:STDOUT: } // CHECK:STDOUT: @@ -254,13 +254,13 @@ interface I { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.F.%pattern_type (%pattern_type) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.F.%pattern_type (%pattern_type) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc9_24.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_24.1: type = splice_block %.loc9_24.2 [symbolic = %Self.as_type.loc9_24.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.F.%Self.as_type.loc9_18.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc9_18.1: type = splice_block %.loc9_18.2 [symbolic = %Self.as_type.loc9_18.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc9_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_24.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc9_24.2: type = converted %Self.ref, %Self.as_type.loc9_24.2 [symbolic = %Self.as_type.loc9_24.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc9_18.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_18.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc9_18.2: type = converted %Self.ref, %Self.as_type.loc9_18.2 [symbolic = %Self.as_type.loc9_18.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc9_24.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc9_18.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -274,17 +274,17 @@ interface I { // 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)] -// CHECK:STDOUT: %Self.as_type.loc9_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_24.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc9_24.1 [symbolic = %pattern_type (constants.%pattern_type)] +// CHECK:STDOUT: %Self.as_type.loc9_18.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_18.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc9_18.1 [symbolic = %pattern_type (constants.%pattern_type)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc9_24.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc9_18.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc9_24.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc9_18.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 0f6cc599b51b..851503e1e68f 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -42,17 +42,18 @@ library "dependent_return_type.carbon"; interface Interface { // TODO: This should be - // default fn F[self: Self](U:! type, u: U*) -> U*; + // default fn F(self, U:! type, u: U*) -> U*; // rather than a class member, but we don't currently accept that due to the // TODOs above. class C { - fn F[self: Self](U:! type, u: U*) -> U*; + fn F(self, U:! type, u: U*) -> U*; } } // TODO: This should be -// fn Interface.F[self: Self](U:! type, u: U*) -> U* { return u; } -fn Interface.C.F[unused self: Self](U:! type, u: U*) -> U* { return u; } +// fn Interface.F(self, U:! type, u: U*) -> U* { return u; } +fn Interface.C.F(unused self, U:! type, u: U*) -> U* { return u; } + // CHECK:STDOUT: --- fail_todo_define_default_fn_out_of_line.carbon // CHECK:STDOUT: @@ -217,36 +218,36 @@ fn Interface.C.F[unused self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [concrete = constants.%Interface.type] {} {} // CHECK:STDOUT: %C.F.decl: %C.F.type = fn_decl @C.F [symbolic = constants.%C.F] { -// CHECK:STDOUT: %self.param_patt: @C.F.%pattern_type.loc14_14 (%pattern_type.f25) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @C.F.%pattern_type.loc14_14 (%pattern_type.f25) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @C.F.%pattern_type.loc14_10 (%pattern_type.f25) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @C.F.%pattern_type.loc14_10 (%pattern_type.f25) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 1 [concrete] -// CHECK:STDOUT: %u.param_patt: @C.F.%pattern_type.loc14_33 (%pattern_type.423) = value_param_pattern [concrete] -// CHECK:STDOUT: %u.patt: @C.F.%pattern_type.loc14_33 (%pattern_type.423) = at_binding_pattern u, %u.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @C.F.%pattern_type.loc14_33 (%pattern_type.423) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @C.F.%pattern_type.loc14_33 (%pattern_type.423) = return_slot_pattern %return.param_patt, %ptr.loc20_58 [concrete] +// CHECK:STDOUT: %u.param_patt: @C.F.%pattern_type.loc14_27 (%pattern_type.423) = value_param_pattern [concrete] +// CHECK:STDOUT: %u.patt: @C.F.%pattern_type.loc14_27 (%pattern_type.423) = at_binding_pattern u, %u.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @C.F.%pattern_type.loc14_27 (%pattern_type.423) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @C.F.%pattern_type.loc14_27 (%pattern_type.423) = return_slot_pattern %return.param_patt, %ptr.loc20_52 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.ref.loc20_57: type = name_ref U, %U.loc20 [symbolic = %U.loc14_23.1 (constants.%U.091)] -// CHECK:STDOUT: %ptr.loc20_58: type = ptr_type %U.ref.loc20_57 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] -// CHECK:STDOUT: %.loc20_58: Core.Form = init_form %ptr.loc20_58 [symbolic = %.loc14_43.1 (constants.%.6d8)] +// CHECK:STDOUT: %U.ref.loc20_51: type = name_ref U, %U.loc20 [symbolic = %U.loc14_17.1 (constants.%U.091)] +// CHECK:STDOUT: %ptr.loc20_52: type = ptr_type %U.ref.loc20_51 [symbolic = %ptr.loc14_30.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %.loc20_52: Core.Form = init_form %ptr.loc20_52 [symbolic = %.loc14_37.1 (constants.%.6d8)] // CHECK:STDOUT: %self.param.loc20: @C.F.%C (%C) = value_param call_param0 -// CHECK:STDOUT: %.loc20_31.1: type = splice_block %Self.ref.loc20 [symbolic = %C (constants.%C)] { -// CHECK:STDOUT: %.loc20_31.2: type = specific_constant constants.%C, @C(constants.%Self.3ce) [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_31.2 [symbolic = %C (constants.%C)] +// CHECK:STDOUT: %.loc20_25.1: type = splice_block %Self.ref.loc20 [symbolic = %C (constants.%C)] { +// CHECK:STDOUT: %.loc20_25.2: type = specific_constant constants.%C, @C(constants.%Self.3ce) [symbolic = %C (constants.%C)] +// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, %.loc20_25.2 [symbolic = %C (constants.%C)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc20: @C.F.%C (%C) = value_binding self, %self.param.loc20 -// CHECK:STDOUT: %.loc20_41.1: type = splice_block %.loc20_41.2 [concrete = type] { +// CHECK:STDOUT: %.loc20_35.1: type = splice_block %.loc20_35.2 [concrete = type] { // CHECK:STDOUT: %.Self.loc20: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.loc20_41.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc20_35.2: type = type_literal type [concrete = type] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc20: type = symbolic_binding U, 1 [symbolic = %U.loc14_23.1 (constants.%U.091)] -// CHECK:STDOUT: %u.param.loc20: @C.F.%ptr.loc14_36.1 (%ptr.18e) = value_param call_param1 -// CHECK:STDOUT: %.loc20_51: type = splice_block %ptr.loc20_51 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] { -// CHECK:STDOUT: %U.ref.loc20_50: type = name_ref U, %U.loc20 [symbolic = %U.loc14_23.1 (constants.%U.091)] -// CHECK:STDOUT: %ptr.loc20_51: type = ptr_type %U.ref.loc20_50 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %U.loc20: type = symbolic_binding U, 1 [symbolic = %U.loc14_17.1 (constants.%U.091)] +// CHECK:STDOUT: %u.param.loc20: @C.F.%ptr.loc14_30.1 (%ptr.18e) = value_param call_param1 +// CHECK:STDOUT: %.loc20_45: type = splice_block %ptr.loc20_45 [symbolic = %ptr.loc14_30.1 (constants.%ptr.18e)] { +// CHECK:STDOUT: %U.ref.loc20_44: type = name_ref U, %U.loc20 [symbolic = %U.loc14_17.1 (constants.%U.091)] +// CHECK:STDOUT: %ptr.loc20_45: type = ptr_type %U.ref.loc20_44 [symbolic = %ptr.loc14_30.1 (constants.%ptr.18e)] // CHECK:STDOUT: } -// CHECK:STDOUT: %u.loc20: @C.F.%ptr.loc14_36.1 (%ptr.18e) = value_binding u, %u.param.loc20 -// CHECK:STDOUT: %return.param.loc20: ref @C.F.%ptr.loc14_36.1 (%ptr.18e) = out_param call_param2 -// CHECK:STDOUT: %return.loc20: ref @C.F.%ptr.loc14_36.1 (%ptr.18e) = return_slot %return.param.loc20 +// CHECK:STDOUT: %u.loc20: @C.F.%ptr.loc14_30.1 (%ptr.18e) = value_binding u, %u.param.loc20 +// CHECK:STDOUT: %return.param.loc20: ref @C.F.%ptr.loc14_30.1 (%ptr.18e) = out_param call_param2 +// CHECK:STDOUT: %return.loc20: ref @C.F.%ptr.loc14_30.1 (%ptr.18e) = return_slot %return.param.loc20 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -273,36 +274,36 @@ fn Interface.C.F[unused self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %C.F.decl: @C.%C.F.type (%C.F.type) = fn_decl @C.F [symbolic = @C.%C.F (constants.%C.F)] { -// CHECK:STDOUT: %self.param_patt: @C.F.%pattern_type.loc14_14 (%pattern_type.f25) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @C.F.%pattern_type.loc14_14 (%pattern_type.f25) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %self.param_patt: @C.F.%pattern_type.loc14_10 (%pattern_type.f25) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @C.F.%pattern_type.loc14_10 (%pattern_type.f25) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 1 [concrete] -// CHECK:STDOUT: %u.param_patt: @C.F.%pattern_type.loc14_33 (%pattern_type.423) = value_param_pattern [concrete] -// CHECK:STDOUT: %u.patt: @C.F.%pattern_type.loc14_33 (%pattern_type.423) = at_binding_pattern u, %u.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @C.F.%pattern_type.loc14_33 (%pattern_type.423) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @C.F.%pattern_type.loc14_33 (%pattern_type.423) = return_slot_pattern %return.param_patt, %ptr.loc20_58 [concrete] +// CHECK:STDOUT: %u.param_patt: @C.F.%pattern_type.loc14_27 (%pattern_type.423) = value_param_pattern [concrete] +// CHECK:STDOUT: %u.patt: @C.F.%pattern_type.loc14_27 (%pattern_type.423) = at_binding_pattern u, %u.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @C.F.%pattern_type.loc14_27 (%pattern_type.423) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @C.F.%pattern_type.loc14_27 (%pattern_type.423) = return_slot_pattern %return.param_patt, %ptr.loc20_52 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.ref.loc14_42: type = name_ref U, %U.loc14_23.2 [symbolic = %U.loc14_23.1 (constants.%U.091)] -// CHECK:STDOUT: %ptr.loc14_43: type = ptr_type %U.ref.loc14_42 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] -// CHECK:STDOUT: %.loc14_43.2: Core.Form = init_form %ptr.loc14_43 [symbolic = %.loc14_43.1 (constants.%.6d8)] +// CHECK:STDOUT: %U.ref.loc14_36: type = name_ref U, %U.loc14_17.2 [symbolic = %U.loc14_17.1 (constants.%U.091)] +// CHECK:STDOUT: %ptr.loc14_37: type = ptr_type %U.ref.loc14_36 [symbolic = %ptr.loc14_30.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %.loc14_37.2: Core.Form = init_form %ptr.loc14_37 [symbolic = %.loc14_37.1 (constants.%.6d8)] // CHECK:STDOUT: %self.param.loc14: @C.F.%C (%C) = value_param call_param0 -// CHECK:STDOUT: %.loc14_16.1: type = splice_block %Self.ref.loc14 [symbolic = %C (constants.%C)] { -// CHECK:STDOUT: %.loc14_16.2: type = specific_constant constants.%C, @C(constants.%Self.3ce) [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, %.loc14_16.2 [symbolic = %C (constants.%C)] +// CHECK:STDOUT: %.loc14_10.1: type = splice_block %Self.ref.loc14 [symbolic = %C (constants.%C)] { +// CHECK:STDOUT: %.loc14_10.2: type = specific_constant constants.%C, @C(constants.%Self.3ce) [symbolic = %C (constants.%C)] +// CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, %.loc14_10.2 [symbolic = %C (constants.%C)] // CHECK:STDOUT: } // CHECK:STDOUT: %self.loc14: @C.F.%C (%C) = value_binding self, %self.param.loc14 -// CHECK:STDOUT: %.loc14_26.1: type = splice_block %.loc14_26.2 [concrete = type] { +// CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.2 [concrete = type] { // CHECK:STDOUT: %.Self.loc14: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.loc14_26.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc14_20.2: type = type_literal type [concrete = type] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc14_23.2: type = symbolic_binding U, 1 [symbolic = %U.loc14_23.1 (constants.%U.091)] -// CHECK:STDOUT: %u.param.loc14: @C.F.%ptr.loc14_36.1 (%ptr.18e) = value_param call_param1 -// CHECK:STDOUT: %.loc14_36: type = splice_block %ptr.loc14_36.2 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] { -// CHECK:STDOUT: %U.ref.loc14_35: type = name_ref U, %U.loc14_23.2 [symbolic = %U.loc14_23.1 (constants.%U.091)] -// CHECK:STDOUT: %ptr.loc14_36.2: type = ptr_type %U.ref.loc14_35 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %U.loc14_17.2: type = symbolic_binding U, 1 [symbolic = %U.loc14_17.1 (constants.%U.091)] +// CHECK:STDOUT: %u.param.loc14: @C.F.%ptr.loc14_30.1 (%ptr.18e) = value_param call_param1 +// CHECK:STDOUT: %.loc14_30: type = splice_block %ptr.loc14_30.2 [symbolic = %ptr.loc14_30.1 (constants.%ptr.18e)] { +// CHECK:STDOUT: %U.ref.loc14_29: type = name_ref U, %U.loc14_17.2 [symbolic = %U.loc14_17.1 (constants.%U.091)] +// CHECK:STDOUT: %ptr.loc14_30.2: type = ptr_type %U.ref.loc14_29 [symbolic = %ptr.loc14_30.1 (constants.%ptr.18e)] // CHECK:STDOUT: } -// CHECK:STDOUT: %u.loc14: @C.F.%ptr.loc14_36.1 (%ptr.18e) = value_binding u, %u.param.loc14 -// CHECK:STDOUT: %return.param.loc14: ref @C.F.%ptr.loc14_36.1 (%ptr.18e) = out_param call_param2 -// CHECK:STDOUT: %return.loc14: ref @C.F.%ptr.loc14_36.1 (%ptr.18e) = return_slot %return.param.loc14 +// CHECK:STDOUT: %u.loc14: @C.F.%ptr.loc14_30.1 (%ptr.18e) = value_binding u, %u.param.loc14 +// CHECK:STDOUT: %return.param.loc14: ref @C.F.%ptr.loc14_30.1 (%ptr.18e) = out_param call_param2 +// CHECK:STDOUT: %return.loc14: ref @C.F.%ptr.loc14_30.1 (%ptr.18e) = return_slot %return.param.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type @@ -313,34 +314,36 @@ fn Interface.C.F[unused self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @C.F(@Interface.%Self: %Interface.type, %U.loc14_23.2: type) { +// CHECK:STDOUT: generic fn @C.F(@Interface.%Self: %Interface.type, %U.loc14_17.2: type) { // CHECK:STDOUT: %Self: %Interface.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.3ce)] // CHECK:STDOUT: %C: type = class_type @C, @C(%Self) [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %pattern_type.loc14_14: type = pattern_type %C [symbolic = %pattern_type.loc14_14 (constants.%pattern_type.f25)] -// CHECK:STDOUT: %U.loc14_23.1: type = symbolic_binding U, 1 [symbolic = %U.loc14_23.1 (constants.%U.091)] -// CHECK:STDOUT: %ptr.loc14_36.1: type = ptr_type %U.loc14_23.1 [symbolic = %ptr.loc14_36.1 (constants.%ptr.18e)] -// CHECK:STDOUT: %pattern_type.loc14_33: type = pattern_type %ptr.loc14_36.1 [symbolic = %pattern_type.loc14_33 (constants.%pattern_type.423)] -// CHECK:STDOUT: %.loc14_43.1: Core.Form = init_form %ptr.loc14_36.1 [symbolic = %.loc14_43.1 (constants.%.6d8)] +// CHECK:STDOUT: %pattern_type.loc14_10: type = pattern_type %C [symbolic = %pattern_type.loc14_10 (constants.%pattern_type.f25)] +// CHECK:STDOUT: %U.loc14_17.1: type = symbolic_binding U, 1 [symbolic = %U.loc14_17.1 (constants.%U.091)] +// CHECK:STDOUT: %ptr.loc14_30.1: type = ptr_type %U.loc14_17.1 [symbolic = %ptr.loc14_30.1 (constants.%ptr.18e)] +// CHECK:STDOUT: %pattern_type.loc14_27: type = pattern_type %ptr.loc14_30.1 [symbolic = %pattern_type.loc14_27 (constants.%pattern_type.423)] +// CHECK:STDOUT: %.loc14_37.1: Core.Form = init_form %ptr.loc14_30.1 [symbolic = %.loc14_37.1 (constants.%.6d8)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc20_29: = require_complete_type %C [symbolic = %require_complete.loc20_29 (constants.%require_complete.f37)] -// CHECK:STDOUT: %require_complete.loc20_48: = require_complete_type %ptr.loc14_36.1 [symbolic = %require_complete.loc20_48 (constants.%require_complete.56d)] -// CHECK:STDOUT: %.loc20_69.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.loc14_23.1) [symbolic = %.loc20_69.1 (constants.%.ddf)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc14_36.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.088)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc14_36.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.da6)] -// CHECK:STDOUT: %.loc20_69.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc20_69.2 (constants.%.a56)] -// CHECK:STDOUT: %impl.elem0.loc20_69.2: @C.F.%.loc20_69.2 (%.a56) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_69.2 (constants.%impl.elem0.fbe)] -// CHECK:STDOUT: %specific_impl_fn.loc20_69.2: = specific_impl_function %impl.elem0.loc20_69.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc20_69.2 (constants.%specific_impl_fn.16d)] +// CHECK:STDOUT: %require_complete.loc20_25: = require_complete_type %C [symbolic = %require_complete.loc20_25 (constants.%require_complete.f37)] +// CHECK:STDOUT: %require_complete.loc20_42: = require_complete_type %ptr.loc14_30.1 [symbolic = %require_complete.loc20_42 (constants.%require_complete.56d)] +// CHECK:STDOUT: %.loc20_63.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.loc14_17.1) [symbolic = %.loc20_63.2 (constants.%.ddf)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc14_30.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.088)] +// CHECK:STDOUT: %Copy.facet.loc20_63.2: %Copy.type = facet_value %ptr.loc14_30.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc20_63.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc20_63.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.da6)] +// CHECK:STDOUT: %.loc20_63.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc20_63.2 [symbolic = %.loc20_63.3 (constants.%.a56)] +// CHECK:STDOUT: %impl.elem0.loc20_63.2: @C.F.%.loc20_63.3 (%.a56) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_63.2 (constants.%impl.elem0.fbe)] +// CHECK:STDOUT: %specific_impl_fn.loc20_63.2: = specific_impl_function %impl.elem0.loc20_63.2, @Copy.WithSelf.Op(%Copy.facet.loc20_63.2) [symbolic = %specific_impl_fn.loc20_63.2 (constants.%specific_impl_fn.16d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param.loc20: @C.F.%C (%C), %u.param.loc20: @C.F.%ptr.loc14_36.1 (%ptr.18e)) -> out %return.param.loc20: @C.F.%ptr.loc14_36.1 (%ptr.18e) { +// CHECK:STDOUT: fn(%self.param.loc20: @C.F.%C (%C), %u.param.loc20: @C.F.%ptr.loc14_30.1 (%ptr.18e)) -> out %return.param.loc20: @C.F.%ptr.loc14_30.1 (%ptr.18e) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %u.ref: @C.F.%ptr.loc14_36.1 (%ptr.18e) = name_ref u, %u.loc20 -// CHECK:STDOUT: %impl.elem0.loc20_69.1: @C.F.%.loc20_69.2 (%.a56) = impl_witness_access constants.%Copy.lookup_impl_witness.088, element0 [symbolic = %impl.elem0.loc20_69.2 (constants.%impl.elem0.fbe)] -// CHECK:STDOUT: %bound_method.loc20_69.1: = bound_method %u.ref, %impl.elem0.loc20_69.1 -// CHECK:STDOUT: %specific_impl_fn.loc20_69.1: = specific_impl_function %impl.elem0.loc20_69.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc20_69.2 (constants.%specific_impl_fn.16d)] -// CHECK:STDOUT: %bound_method.loc20_69.2: = bound_method %u.ref, %specific_impl_fn.loc20_69.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @C.F.%ptr.loc14_36.1 (%ptr.18e) = call %bound_method.loc20_69.2(%u.ref) +// CHECK:STDOUT: %u.ref: @C.F.%ptr.loc14_30.1 (%ptr.18e) = name_ref u, %u.loc20 +// CHECK:STDOUT: %impl.elem0.loc20_63.1: @C.F.%.loc20_63.3 (%.a56) = impl_witness_access constants.%Copy.lookup_impl_witness.088, element0 [symbolic = %impl.elem0.loc20_63.2 (constants.%impl.elem0.fbe)] +// CHECK:STDOUT: %bound_method.loc20_63.1: = bound_method %u.ref, %impl.elem0.loc20_63.1 +// CHECK:STDOUT: %Copy.facet.loc20_63.1: %Copy.type = facet_value constants.%ptr.18e, (constants.%Copy.lookup_impl_witness.088) [symbolic = %Copy.facet.loc20_63.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %.loc20_63.1: %Copy.type = converted constants.%ptr.18e, %Copy.facet.loc20_63.1 [symbolic = %Copy.facet.loc20_63.2 (constants.%Copy.facet)] +// CHECK:STDOUT: %specific_impl_fn.loc20_63.1: = specific_impl_function %impl.elem0.loc20_63.1, @Copy.WithSelf.Op(constants.%Copy.facet) [symbolic = %specific_impl_fn.loc20_63.2 (constants.%specific_impl_fn.16d)] +// CHECK:STDOUT: %bound_method.loc20_63.2: = bound_method %u.ref, %specific_impl_fn.loc20_63.1 +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @C.F.%ptr.loc14_30.1 (%ptr.18e) = call %bound_method.loc20_63.2(%u.ref) // CHECK:STDOUT: return %Copy.WithSelf.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -357,10 +360,10 @@ fn Interface.C.F[unused self: Self](U:! type, u: U*) -> U* { return u; } // CHECK:STDOUT: specific @C.F(constants.%Self.3ce, constants.%U.091) { // CHECK:STDOUT: %Self => constants.%Self.3ce // CHECK:STDOUT: %C => constants.%C -// CHECK:STDOUT: %pattern_type.loc14_14 => constants.%pattern_type.f25 -// CHECK:STDOUT: %U.loc14_23.1 => constants.%U.091 -// CHECK:STDOUT: %ptr.loc14_36.1 => constants.%ptr.18e -// CHECK:STDOUT: %pattern_type.loc14_33 => constants.%pattern_type.423 -// CHECK:STDOUT: %.loc14_43.1 => constants.%.6d8 +// CHECK:STDOUT: %pattern_type.loc14_10 => constants.%pattern_type.f25 +// CHECK:STDOUT: %U.loc14_17.1 => constants.%U.091 +// CHECK:STDOUT: %ptr.loc14_30.1 => constants.%ptr.18e +// CHECK:STDOUT: %pattern_type.loc14_27 => constants.%pattern_type.423 +// CHECK:STDOUT: %.loc14_37.1 => constants.%.6d8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/generic_default_fn.carbon b/toolchain/check/testdata/interface/generic_default_fn.carbon index f2bdccf1a109..75ee76d6e0c9 100644 --- a/toolchain/check/testdata/interface/generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/generic_default_fn.carbon @@ -12,9 +12,9 @@ interface I(_:! type) { // TODO: Use `default` here. - fn F[ref self: Self]() -> Self*; + fn F(ref self) -> Self*; } -fn I(_:! type).F[ref self: Self]() -> Self* { +fn I(_:! type).F(ref self) -> Self* { return &self; } diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index e150711c8c36..50f7a4fc9f09 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -83,6 +83,7 @@ fn CallIndirect() { CallGeneric((Y1, Y2) as type); } + // CHECK:STDOUT: --- generic_method_fewer_params.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -461,13 +462,13 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete.loc16_19: = require_complete_type %ptr.loc16_22.1 [symbolic = %require_complete.loc16_19 (constants.%require_complete.ef162c.1)] // CHECK:STDOUT: %require_complete.loc16_25: = require_complete_type %tuple.type.loc16 [symbolic = %require_complete.loc16_25 (constants.%require_complete.44f)] // CHECK:STDOUT: %tuple.type.loc17: type = tuple_type (constants.%empty_struct_type, constants.%empty_struct_type, %ptr.loc16_22.1) [symbolic = %tuple.type.loc17 (constants.%tuple.type.dd2)] -// CHECK:STDOUT: %.loc17_21.1: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.loc16_9.1) [symbolic = %.loc17_21.1 (constants.%.0e9)] +// CHECK:STDOUT: %.loc17_21.2: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%U.loc16_9.1) [symbolic = %.loc17_21.2 (constants.%.0e9)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc16_22.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc16_22.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.302b)] -// 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: %.loc17_21.2: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc17_21.2 (constants.%.be5)] -// CHECK:STDOUT: %impl.elem0.loc17_21.2: @Y.as.A.impl.F.%.loc17_21.2 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.484)] -// CHECK:STDOUT: %specific_impl_fn.loc17_21.2: = specific_impl_function %impl.elem0.loc17_21.2, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc17_21.2 (constants.%specific_impl_fn.a76)] +// CHECK:STDOUT: %Copy.facet.loc17_21.2: %Copy.type = facet_value %ptr.loc16_22.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc17_21.2 (constants.%Copy.facet.302b)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc17_21.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)] +// CHECK:STDOUT: %.loc17_21.3: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc17_21.2 [symbolic = %.loc17_21.3 (constants.%.be5)] +// CHECK:STDOUT: %impl.elem0.loc17_21.2: @Y.as.A.impl.F.%.loc17_21.3 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %specific_impl_fn.loc17_21.2: = specific_impl_function %impl.elem0.loc17_21.2, @Copy.WithSelf.Op(%Copy.facet.loc17_21.2) [symbolic = %specific_impl_fn.loc17_21.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%u.param: @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.e8f8f9.1)) -> out %return.param: @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.316) { // CHECK:STDOUT: !entry: @@ -481,8 +482,10 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.elem1: ref %Y = tuple_access %return.param, element1 // CHECK:STDOUT: %.loc17_18.2: init %Y to %tuple.elem1 = class_init () [concrete = constants.%Y.val] // CHECK:STDOUT: %.loc17_22.3: init %Y = converted %.loc17_18.1, %.loc17_18.2 [concrete = constants.%Y.val] -// CHECK:STDOUT: %impl.elem0.loc17_21.1: @Y.as.A.impl.F.%.loc17_21.2 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %impl.elem0.loc17_21.1: @Y.as.A.impl.F.%.loc17_21.3 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc17_21.2 (constants.%impl.elem0.484)] // CHECK:STDOUT: %bound_method.loc17_21.1: = bound_method %u.ref, %impl.elem0.loc17_21.1 +// CHECK:STDOUT: %Copy.facet.loc17_21.1: %Copy.type = facet_value constants.%ptr.e8f8f9.1, (constants.%Copy.lookup_impl_witness.1da) [symbolic = %Copy.facet.loc17_21.2 (constants.%Copy.facet.302b)] +// CHECK:STDOUT: %.loc17_21.1: %Copy.type = converted constants.%ptr.e8f8f9.1, %Copy.facet.loc17_21.1 [symbolic = %Copy.facet.loc17_21.2 (constants.%Copy.facet.302b)] // CHECK:STDOUT: %specific_impl_fn.loc17_21.1: = specific_impl_function %impl.elem0.loc17_21.1, @Copy.WithSelf.Op(constants.%Copy.facet.302b) [symbolic = %specific_impl_fn.loc17_21.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: %bound_method.loc17_21.2: = bound_method %u.ref, %specific_impl_fn.loc17_21.1 // CHECK:STDOUT: %Copy.WithSelf.Op.call: init @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.e8f8f9.1) = call %bound_method.loc17_21.2(%u.ref) @@ -574,11 +577,11 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.as_type.loc28_4.2, constants.%ptr.415) [symbolic = %tuple.type (constants.%tuple.type.c2a)] // CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.d14)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.a02)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.2f8)] -// 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.2ac)] -// CHECK:STDOUT: %.loc28_12.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc28_12.3 (constants.%.89c)] -// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.3 (%.89c) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.a1a)] -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.65e)] +// CHECK:STDOUT: %Destroy.facet.loc28_12.2: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc28_12.2 (constants.%Destroy.facet.2f8)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc28_12.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.2ac)] +// CHECK:STDOUT: %.loc28_12.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc28_12.2 [symbolic = %.loc28_12.4 (constants.%.89c)] +// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.4 (%.89c) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.a1a)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op(%Destroy.facet.loc28_12.2) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.65e)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -610,8 +613,10 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.c2a) = temporary_storage // CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.c2a) to %.loc28_12.1 = call %specific_impl_fn.loc28_4.1(%addr) // CHECK:STDOUT: %.loc28_12.2: ref @CallGeneric.%tuple.type (%tuple.type.c2a) = temporary %.loc28_12.1, %A.WithSelf.F.call -// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.3 (%.89c) = impl_witness_access constants.%Destroy.lookup_impl_witness.a02, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.a1a)] +// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.4 (%.89c) = impl_witness_access constants.%Destroy.lookup_impl_witness.a02, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.a1a)] // CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.2, %impl.elem0.loc28_12.1 +// CHECK:STDOUT: %Destroy.facet.loc28_12.1: %Destroy.type = facet_value constants.%tuple.type.c2a, (constants.%Destroy.lookup_impl_witness.a02) [symbolic = %Destroy.facet.loc28_12.2 (constants.%Destroy.facet.2f8)] +// CHECK:STDOUT: %.loc28_12.3: %Destroy.type = converted constants.%tuple.type.c2a, %Destroy.facet.loc28_12.1 [symbolic = %Destroy.facet.loc28_12.2 (constants.%Destroy.facet.2f8)] // CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.2f8) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.65e)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.2, %specific_impl_fn.loc28_12.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) @@ -721,11 +726,11 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete.loc16_19 => constants.%complete_type.458 // CHECK:STDOUT: %require_complete.loc16_25 => constants.%complete_type.dec // CHECK:STDOUT: %tuple.type.loc17 => constants.%tuple.type.2c5 -// CHECK:STDOUT: %.loc17_21.1 => constants.%.072 +// CHECK:STDOUT: %.loc17_21.2 => constants.%.072 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.d9a -// CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.302f +// CHECK:STDOUT: %Copy.facet.loc17_21.2 => constants.%Copy.facet.302f // CHECK:STDOUT: %Copy.WithSelf.Op.type => constants.%Copy.WithSelf.Op.type.b68 -// CHECK:STDOUT: %.loc17_21.2 => constants.%.6df +// CHECK:STDOUT: %.loc17_21.3 => constants.%.6df // CHECK:STDOUT: %impl.elem0.loc17_21.2 => constants.%ptr.as.Copy.impl.Op.ebe // CHECK:STDOUT: %specific_impl_fn.loc17_21.2 => constants.%ptr.as.Copy.impl.Op.specific_fn // CHECK:STDOUT: } @@ -785,9 +790,9 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2cd // CHECK:STDOUT: %require_complete => constants.%complete_type.dec // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.5 -// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.e95 +// CHECK:STDOUT: %Destroy.facet.loc28_12.2 => constants.%Destroy.facet.e95 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.964 -// CHECK:STDOUT: %.loc28_12.3 => constants.%.41a +// CHECK:STDOUT: %.loc28_12.4 => constants.%.41a // CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%Destroy.Op.1a2547.5 // CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.Op.1a2547.5 // CHECK:STDOUT: } @@ -1313,11 +1318,11 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.as_type.loc28_4.2, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.036)] // CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.4e1)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.8dc)] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.fef)] -// 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.937)] -// CHECK:STDOUT: %.loc28_12.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc28_12.3 (constants.%.93b)] -// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.3 (%.93b) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.743)] -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.618)] +// CHECK:STDOUT: %Destroy.facet.loc28_12.2: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc28_12.2 (constants.%Destroy.facet.fef)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc28_12.2) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.937)] +// CHECK:STDOUT: %.loc28_12.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc28_12.2 [symbolic = %.loc28_12.4 (constants.%.93b)] +// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.4 (%.93b) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.743)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op(%Destroy.facet.loc28_12.2) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.618)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -1338,8 +1343,10 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc28_11.6: %Z = acquire_value %.loc28_11.5 [concrete = constants.%Z.val] // CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.036) to %.loc28_12.1 = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) // CHECK:STDOUT: %.loc28_12.2: ref @CallGeneric.%tuple.type (%tuple.type.036) = temporary %.loc28_12.1, %A.WithSelf.F.call -// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.3 (%.93b) = impl_witness_access constants.%Destroy.lookup_impl_witness.8dc, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.743)] +// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.4 (%.93b) = impl_witness_access constants.%Destroy.lookup_impl_witness.8dc, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.743)] // CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.2, %impl.elem0.loc28_12.1 +// CHECK:STDOUT: %Destroy.facet.loc28_12.1: %Destroy.type = facet_value constants.%tuple.type.036, (constants.%Destroy.lookup_impl_witness.8dc) [symbolic = %Destroy.facet.loc28_12.2 (constants.%Destroy.facet.fef)] +// CHECK:STDOUT: %.loc28_12.3: %Destroy.type = converted constants.%tuple.type.036, %Destroy.facet.loc28_12.1 [symbolic = %Destroy.facet.loc28_12.2 (constants.%Destroy.facet.fef)] // CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.fef) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.618)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.2, %specific_impl_fn.loc28_12.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) @@ -1583,9 +1590,9 @@ fn CallIndirect() { // CHECK:STDOUT: %tuple.type => constants.%tuple.type.d40 // CHECK:STDOUT: %require_complete => constants.%complete_type.8f6 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.7 -// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.50b +// CHECK:STDOUT: %Destroy.facet.loc28_12.2 => constants.%Destroy.facet.50b // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.43f -// CHECK:STDOUT: %.loc28_12.3 => constants.%.3d3 +// CHECK:STDOUT: %.loc28_12.4 => constants.%.3d3 // CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%Destroy.Op.1a2547.7 // CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.Op.1a2547.7 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/local.carbon b/toolchain/check/testdata/interface/local.carbon index ef771de1cc90..cfe675625a27 100644 --- a/toolchain/check/testdata/interface/local.carbon +++ b/toolchain/check/testdata/interface/local.carbon @@ -14,10 +14,10 @@ fn F() { interface I { - fn G[self: Self](); + fn G(self); } impl () as I { - fn G[unused self: Self]() {} + fn G(unused self) {} } ().(I.G)(); } @@ -64,13 +64,13 @@ fn F() { // CHECK:STDOUT: %self.param_patt: @I.WithSelf.G.%pattern_type (%pattern_type.4d0) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @I.WithSelf.G.%pattern_type (%pattern_type.4d0) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @I.WithSelf.G.%Self.as_type.loc17_16.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc17_16.1: type = splice_block %.loc17_16.2 [symbolic = %Self.as_type.loc17_16.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @I.WithSelf.G.%Self.as_type.loc17_10.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc17_10.1: type = splice_block %.loc17_10.2 [symbolic = %Self.as_type.loc17_10.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc17_16.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc17_16.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc17_16.2: type = converted %Self.ref, %Self.as_type.loc17_16.2 [symbolic = %Self.as_type.loc17_16.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc17_10.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc17_10.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc17_10.2: type = converted %Self.ref, %Self.as_type.loc17_10.2 [symbolic = %Self.as_type.loc17_10.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @I.WithSelf.G.%Self.as_type.loc17_16.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @I.WithSelf.G.%Self.as_type.loc17_10.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.G.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -121,10 +121,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @I.WithSelf.G(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc17_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc17_16.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc17_16.1 [symbolic = %pattern_type (constants.%pattern_type.4d0)] +// CHECK:STDOUT: %Self.as_type.loc17_10.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc17_10.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc17_10.1 [symbolic = %pattern_type (constants.%pattern_type.4d0)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @I.WithSelf.G.%Self.as_type.loc17_16.1 (%Self.as_type)); +// CHECK:STDOUT: fn(%self.param: @I.WithSelf.G.%Self.as_type.loc17_10.1 (%Self.as_type)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @empty_tuple.type.as.I.impl.G(%self.param: %empty_tuple.type) { @@ -141,7 +141,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.G(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc17_16.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc17_10.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4d0 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -154,7 +154,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.G(constants.%I.facet) { // CHECK:STDOUT: %Self => constants.%I.facet -// CHECK:STDOUT: %Self.as_type.loc17_16.1 => constants.%empty_tuple.type +// CHECK:STDOUT: %Self.as_type.loc17_10.1 => constants.%empty_tuple.type // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cb1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index 76ce337962cc..9bc7f1fd704b 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -52,6 +52,7 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { return I.nonesuch; } + // CHECK:STDOUT: --- member_access.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -236,14 +237,14 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %assoc0: @AccessGeneric.%Interface.assoc_type (%Interface.assoc_type.61f) = assoc_entity element0, @Interface.WithSelf.%X [symbolic = %assoc0 (constants.%assoc0.199)] // CHECK:STDOUT: %Interface.lookup_impl_witness: = lookup_impl_witness %I.loc8_29.1, @Interface, @Interface(%T.loc8_19.1) [symbolic = %Interface.lookup_impl_witness (constants.%Interface.lookup_impl_witness.ffe)] // CHECK:STDOUT: %impl.elem0.loc9_11.3: @AccessGeneric.%ptr.loc8_50.1 (%ptr.e8f) = impl_witness_access %Interface.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_11.3 (constants.%impl.elem0.602)] -// CHECK:STDOUT: %.loc9_11.3: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc8_19.1) [symbolic = %.loc9_11.3 (constants.%.0e9)] +// CHECK:STDOUT: %.loc9_11.4: require_specific_def_type = require_specific_def @ptr.as.Copy.impl(%T.loc8_19.1) [symbolic = %.loc9_11.4 (constants.%.0e9)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %ptr.loc8_50.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.1da)] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.loc8_50.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.302)] -// 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: %.loc9_11.4: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet [symbolic = %.loc9_11.4 (constants.%.be5)] -// CHECK:STDOUT: %impl.elem0.loc9_11.4: @AccessGeneric.%.loc9_11.4 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_11.4 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %Copy.facet.loc9_11.2: %Copy.type = facet_value %ptr.loc8_50.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc9_11.2 (constants.%Copy.facet.302)] +// CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc9_11.2) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.884)] +// CHECK:STDOUT: %.loc9_11.5: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc9_11.2 [symbolic = %.loc9_11.5 (constants.%.be5)] +// CHECK:STDOUT: %impl.elem0.loc9_11.4: @AccessGeneric.%.loc9_11.5 (%.be5) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_11.4 (constants.%impl.elem0.484)] // CHECK:STDOUT: %bound_method.loc9_11.3: = bound_method %impl.elem0.loc9_11.3, %impl.elem0.loc9_11.4 [symbolic = %bound_method.loc9_11.3 (constants.%bound_method.602)] -// CHECK:STDOUT: %specific_impl_fn.loc9_11.2: = specific_impl_function %impl.elem0.loc9_11.4, @Copy.WithSelf.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.a76)] +// CHECK:STDOUT: %specific_impl_fn.loc9_11.2: = specific_impl_function %impl.elem0.loc9_11.4, @Copy.WithSelf.Op(%Copy.facet.loc9_11.2) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: %bound_method.loc9_11.4: = bound_method %impl.elem0.loc9_11.3, %specific_impl_fn.loc9_11.2 [symbolic = %bound_method.loc9_11.4 (constants.%bound_method.060)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> out %return.param: @AccessGeneric.%ptr.loc8_50.1 (%ptr.e8f) { @@ -254,8 +255,10 @@ fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { // CHECK:STDOUT: %.loc9_11.2: @AccessGeneric.%Interface.assoc_type (%Interface.assoc_type.61f) = specific_constant @X.%assoc0, @Interface.WithSelf(constants.%T.67d, constants.%I.63c) [symbolic = %assoc0 (constants.%assoc0.199)] // CHECK:STDOUT: %X.ref: @AccessGeneric.%Interface.assoc_type (%Interface.assoc_type.61f) = name_ref X, %.loc9_11.2 [symbolic = %assoc0 (constants.%assoc0.199)] // CHECK:STDOUT: %impl.elem0.loc9_11.1: @AccessGeneric.%ptr.loc8_50.1 (%ptr.e8f) = impl_witness_access constants.%Interface.lookup_impl_witness.ffe, element0 [symbolic = %impl.elem0.loc9_11.3 (constants.%impl.elem0.602)] -// CHECK:STDOUT: %impl.elem0.loc9_11.2: @AccessGeneric.%.loc9_11.4 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc9_11.4 (constants.%impl.elem0.484)] +// CHECK:STDOUT: %impl.elem0.loc9_11.2: @AccessGeneric.%.loc9_11.5 (%.be5) = impl_witness_access constants.%Copy.lookup_impl_witness.1da, element0 [symbolic = %impl.elem0.loc9_11.4 (constants.%impl.elem0.484)] // CHECK:STDOUT: %bound_method.loc9_11.1: = bound_method %impl.elem0.loc9_11.1, %impl.elem0.loc9_11.2 [symbolic = %bound_method.loc9_11.3 (constants.%bound_method.602)] +// CHECK:STDOUT: %Copy.facet.loc9_11.1: %Copy.type = facet_value constants.%ptr.e8f, (constants.%Copy.lookup_impl_witness.1da) [symbolic = %Copy.facet.loc9_11.2 (constants.%Copy.facet.302)] +// CHECK:STDOUT: %.loc9_11.3: %Copy.type = converted constants.%ptr.e8f, %Copy.facet.loc9_11.1 [symbolic = %Copy.facet.loc9_11.2 (constants.%Copy.facet.302)] // CHECK:STDOUT: %specific_impl_fn.loc9_11.1: = specific_impl_function %impl.elem0.loc9_11.2, @Copy.WithSelf.Op(constants.%Copy.facet.302) [symbolic = %specific_impl_fn.loc9_11.2 (constants.%specific_impl_fn.a76)] // CHECK:STDOUT: %bound_method.loc9_11.2: = bound_method %impl.elem0.loc9_11.1, %specific_impl_fn.loc9_11.1 [symbolic = %bound_method.loc9_11.4 (constants.%bound_method.060)] // CHECK:STDOUT: %Copy.WithSelf.Op.call: init @AccessGeneric.%ptr.loc8_50.1 (%ptr.e8f) = call %bound_method.loc9_11.2(%impl.elem0.loc9_11.1) diff --git a/toolchain/check/testdata/interface/self.carbon b/toolchain/check/testdata/interface/self.carbon index 92d334bac363..ec869e55987e 100644 --- a/toolchain/check/testdata/interface/self.carbon +++ b/toolchain/check/testdata/interface/self.carbon @@ -13,9 +13,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/self.carbon interface UseSelf { - fn F[self: Self]() -> Self; + fn F(self) -> Self; } + // CHECK:STDOUT: --- self.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -46,21 +47,21 @@ interface UseSelf { // CHECK:STDOUT: %self.param_patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type) = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type) = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type) = return_slot_pattern %return.param_patt, %.loc16_25.2 [concrete] +// CHECK:STDOUT: %return.patt: @UseSelf.WithSelf.F.%pattern_type (%pattern_type) = return_slot_pattern %return.param_patt, %.loc16_17.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc16_25: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc16_25: type = facet_access_type %Self.ref.loc16_25 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc16_25.2: type = converted %Self.ref.loc16_25, %Self.as_type.loc16_25 [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc16_25.3: Core.Form = init_form %.loc16_25.2 [symbolic = %.loc16_25.1 (constants.%.326)] -// CHECK:STDOUT: %self.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type) = 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)] { -// CHECK:STDOUT: %Self.ref.loc16_14: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] -// 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)] -// 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)] +// CHECK:STDOUT: %Self.ref.loc16_17: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc16_17: type = facet_access_type %Self.ref.loc16_17 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc16_17.2: type = converted %Self.ref.loc16_17, %Self.as_type.loc16_17 [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc16_17.3: Core.Form = init_form %.loc16_17.2 [symbolic = %.loc16_17.1 (constants.%.326)] +// CHECK:STDOUT: %self.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type) = 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)] { +// CHECK:STDOUT: %Self.ref.loc16_8: %UseSelf.type = name_ref Self, @UseSelf.%Self [symbolic = %Self (constants.%Self)] +// 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)] +// 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)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type) = value_binding self, %self.param -// CHECK:STDOUT: %return.param: ref @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type) = out_param call_param1 -// CHECK:STDOUT: %return: ref @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type) = return_slot %return.param +// CHECK:STDOUT: %self: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %return.param: ref @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type) = out_param call_param1 +// CHECK:STDOUT: %return: ref @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %UseSelf.assoc_type = assoc_entity element0, %UseSelf.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: @@ -74,19 +75,19 @@ interface UseSelf { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @UseSelf.WithSelf.F(@UseSelf.%Self: %UseSelf.type) { // CHECK:STDOUT: %Self: %UseSelf.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc16_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_14.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_14.1 [symbolic = %pattern_type (constants.%pattern_type)] -// CHECK:STDOUT: %.loc16_25.1: Core.Form = init_form %Self.as_type.loc16_14.1 [symbolic = %.loc16_25.1 (constants.%.326)] +// CHECK:STDOUT: %Self.as_type.loc16_8.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_8.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc16_8.1 [symbolic = %pattern_type (constants.%pattern_type)] +// CHECK:STDOUT: %.loc16_17.1: Core.Form = init_form %Self.as_type.loc16_8.1 [symbolic = %.loc16_17.1 (constants.%.326)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type)) -> out %return.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_14.1 (%Self.as_type); +// CHECK:STDOUT: fn(%self.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type)) -> out %return.param: @UseSelf.WithSelf.F.%Self.as_type.loc16_8.1 (%Self.as_type); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @UseSelf.WithSelf(constants.%Self) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @UseSelf.WithSelf.F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc16_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc16_8.1 => constants.%Self.as_type // CHECK:STDOUT: %pattern_type => constants.%pattern_type -// CHECK:STDOUT: %.loc16_25.1 => constants.%.326 +// CHECK:STDOUT: %.loc16_17.1 => constants.%.326 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/export/base.carbon b/toolchain/check/testdata/interop/cpp/class/export/base.carbon index d28a56cf51ee..75e0cabd238a 100644 --- a/toolchain/check/testdata/interop/cpp/class/export/base.carbon +++ b/toolchain/check/testdata/interop/cpp/class/export/base.carbon @@ -134,16 +134,16 @@ import Cpp; // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor_but_virtual_fns.carbon:[[@LINE+10]]:3: error: initialization of abstract type `Abstract` [AbstractTypeInInit] - // CHECK:STDERR: abstract fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: abstract fn F(self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor_but_virtual_fns.carbon:[[@LINE-4]]:1: note: class was declared abstract here [ClassAbstractHere] // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor_but_virtual_fns.carbon:[[@LINE+4]]:17: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: abstract fn F[self: Self](); - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: abstract fn F(self); + // CHECK:STDERR: ^~~~ // CHECK:STDERR: - abstract fn F[self: Self](); + abstract fn F(self); } inline Cpp ''' diff --git a/toolchain/check/testdata/interop/cpp/class/export/method.carbon b/toolchain/check/testdata/interop/cpp/class/export/method.carbon index 68cf7d32f324..cc84879dcf70 100644 --- a/toolchain/check/testdata/interop/cpp/class/export/method.carbon +++ b/toolchain/check/testdata/interop/cpp/class/export/method.carbon @@ -29,7 +29,7 @@ library "[[@TEST_NAME]]"; import Cpp; class C { - fn M[self: Self](); + fn M(self); } inline Cpp ''' @@ -44,7 +44,7 @@ library "[[@TEST_NAME]]"; import Cpp; class C { - fn M[self: Self](); + fn M(self); } inline Cpp ''' @@ -58,7 +58,7 @@ library "[[@TEST_NAME]]"; import Cpp; class C { - fn M[ref self: Self](); + fn M(ref self); } inline Cpp ''' @@ -73,7 +73,7 @@ library "[[@TEST_NAME]]"; import Cpp; class C { - fn M[ref self: Self](); + fn M(ref self); } inline Cpp ''' @@ -81,9 +81,9 @@ void F() { // CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE+7]]:3: error: 'this' argument to member function 'M' is an rvalue, but function has non-const lvalue ref-qualifier [CppInteropParseError] // CHECK:STDERR: 17 | Carbon::C().M(); // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE-8]]:25: note: 'M' declared here [CppInteropParseNote] - // CHECK:STDERR: 5 | fn M[ref self: Self](); - // CHECK:STDERR: | ^ + // CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE-8]]:17: note: 'M' declared here [CppInteropParseNote] + // CHECK:STDERR: 5 | fn M(ref self); + // CHECK:STDERR: | ^ // CHECK:STDERR: Carbon::C().M(); } diff --git a/toolchain/check/testdata/interop/cpp/class/import/abstract.carbon b/toolchain/check/testdata/interop/cpp/class/import/abstract.carbon index 454a04c3a06f..8dd9ad9ab799 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/abstract.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/abstract.carbon @@ -46,7 +46,7 @@ import Cpp library "abstract.h"; class C { extend base: Cpp.A; - override fn f[unused ref self: Self]() {} + override fn f(unused ref self) {} } // --- fail_impl_mismatch_member.carbon @@ -58,10 +58,10 @@ import Cpp library "abstract.h"; class C { extend base: Cpp.A; // CHECK:STDERR: fail_impl_mismatch_member.carbon:[[@LINE+4]]:3: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase] - // CHECK:STDERR: override fn invalid[unused ref self: Self]() {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: override fn invalid(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - override fn invalid[unused ref self: Self]() {} + override fn invalid(unused ref self) {} } // --- abstract_final.h diff --git a/toolchain/check/testdata/interop/cpp/class/import/access.carbon b/toolchain/check/testdata/interop/cpp/class/import/access.carbon index dfe6bb52b3df..0326d30babb5 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/access.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/access.carbon @@ -127,7 +127,7 @@ import Cpp library "non_function_member_protected.h"; class Derived { extend base: Cpp.C; - fn F[self: Self]() { + fn F(self) { //@dump-sem-ir-begin let unused instance_data: i32 = self.instance_data; let unused unqualified_static_data: i32 = static_data; @@ -182,7 +182,7 @@ import Cpp library "non_function_member_private.h"; class Derived { extend base: Cpp.C; - fn F[self: Self]() { + fn F(self) { // CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+8]]:37: error: cannot access private member `instance_data` of type `Cpp.C` [ClassInvalidMemberAccess] // CHECK:STDERR: let unused instance_data: i32 = self.instance_data; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ @@ -313,7 +313,7 @@ import Cpp library "function_member_protected.h"; class Derived { extend base: Cpp.C; - fn F[self: Self]() { + fn F(self) { //@dump-sem-ir-begin // TODO: It should be possible to call protected methods in the base class. // CHECK:STDERR: fail_todo_import_function_member_protected_extend_call_instance_in_member.carbon:[[@LINE+8]]:22: error: no matching function for call to 'instance_fn' [CppInteropParseError] @@ -337,7 +337,7 @@ import Cpp library "function_member_protected.h"; class Derived { extend base: Cpp.C; - fn F[unused self: Self]() { + fn F(unused self) { //@dump-sem-ir-begin static_fn(); Derived.static_fn(); @@ -366,7 +366,7 @@ import Cpp library "function_member_private.h"; class Derived { extend base: Cpp.C; - fn F[self: Self]() { + fn F(self) { // CHECK:STDERR: fail_import_function_member_private.carbon:[[@LINE+7]]:5: error: cannot access private member `instance_fn` of type `Cpp.C` [ClassInvalidMemberAccess] // CHECK:STDERR: self.instance_fn(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ diff --git a/toolchain/check/testdata/interop/cpp/class/import/dynamic.carbon b/toolchain/check/testdata/interop/cpp/class/import/dynamic.carbon index 5ec599da2d84..031beb328089 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/dynamic.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/dynamic.carbon @@ -39,7 +39,7 @@ auto Use(Base& b) -> int { base class Derived { extend base: Cpp.Base; - virtual fn other_func[unused self: Self]() -> i32 { + virtual fn other_func(unused self) -> i32 { return 3; } } diff --git a/toolchain/check/testdata/interop/cpp/operators/arithmetic_operators.carbon b/toolchain/check/testdata/interop/cpp/operators/arithmetic_operators.carbon index 53d1fc235b2a..d5e413e266a5 100644 --- a/toolchain/check/testdata/interop/cpp/operators/arithmetic_operators.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/arithmetic_operators.carbon @@ -305,6 +305,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { TestNegate(Cpp.Int32.Int32(), b); } + // CHECK:STDOUT: --- arithmetic_operators.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1378,13 +1379,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.lookup_impl_witness.loc126: = lookup_impl_witness %T.loc123_4.1, @AddWith.1, @AddWith.1(%U.as_type.loc123_36.1) [symbolic = %AddWith.lookup_impl_witness.loc126 (constants.%AddWith.lookup_impl_witness.8b3)] // CHECK:STDOUT: %AddWith.facet: @AddWith.loc124.%AddWith.type.loc123_36.1 (%AddWith.type.9da) = facet_value %T.as_type.loc124_29.1, (%AddWith.lookup_impl_witness.loc126) [symbolic = %AddWith.facet (constants.%AddWith.facet.fc9)] // CHECK:STDOUT: %AddWith.WithSelf.Op.type: type = fn_type @AddWith.WithSelf.Op, @AddWith.WithSelf(%U.as_type.loc123_36.1, %AddWith.facet) [symbolic = %AddWith.WithSelf.Op.type (constants.%AddWith.WithSelf.Op.type.eb7)] -// CHECK:STDOUT: %.loc126_5.4: type = fn_type_with_self_type %AddWith.WithSelf.Op.type, %AddWith.facet [symbolic = %.loc126_5.4 (constants.%.012e)] -// CHECK:STDOUT: %impl.elem1.loc126_5.2: @AddWith.loc124.%.loc126_5.4 (%.012e) = impl_witness_access %AddWith.lookup_impl_witness.loc126, element1 [symbolic = %impl.elem1.loc126_5.2 (constants.%impl.elem1.0c1)] +// CHECK:STDOUT: %.loc126_5.5: type = fn_type_with_self_type %AddWith.WithSelf.Op.type, %AddWith.facet [symbolic = %.loc126_5.5 (constants.%.012e)] +// CHECK:STDOUT: %impl.elem1.loc126_5.2: @AddWith.loc124.%.loc126_5.5 (%.012e) = impl_witness_access %AddWith.lookup_impl_witness.loc126, element1 [symbolic = %impl.elem1.loc126_5.2 (constants.%impl.elem1.0c1)] // CHECK:STDOUT: %specific_impl_fn.loc126_5.3: = specific_impl_function %impl.elem1.loc126_5.2, @AddWith.WithSelf.Op(%U.as_type.loc123_36.1, %AddWith.facet) [symbolic = %specific_impl_fn.loc126_5.3 (constants.%specific_impl_fn.95a)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Result.loc121_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc126_5.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc121_9.1 [symbolic = %.loc126_5.5 (constants.%.53a)] +// CHECK:STDOUT: %.loc126_5.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc121_9.1 [symbolic = %.loc126_5.6 (constants.%.53a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc121_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc126_5.2: @AddWith.loc124.%.loc126_5.5 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc126_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc126_5.2: @AddWith.loc124.%.loc126_5.6 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc126_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %specific_impl_fn.loc126_5.4: = specific_impl_function %impl.elem0.loc126_5.2, @Destroy.WithSelf.Op(%Result.loc121_9.1) [symbolic = %specific_impl_fn.loc126_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @AddWith.loc124.%Result.as_type.loc123_54.1 (%Result.as_type), %x.param: @AddWith.loc124.%T.as_type.loc124_29.1 (%T.as_type.606), %y.param: @AddWith.loc124.%U.as_type.loc123_36.1 (%U.as_type.b61)) { @@ -1394,15 +1395,16 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.type.loc126: type = facet_type <@AddWith.1, @AddWith.1(constants.%U.as_type.b61)> [symbolic = %AddWith.type.loc123_36.1 (constants.%AddWith.type.9da)] // CHECK:STDOUT: %.loc126_5.1: @AddWith.loc124.%AddWith.assoc_type (%AddWith.assoc_type.bc8) = specific_constant imports.%Core.import_ref.5a1, @AddWith.WithSelf(constants.%U.as_type.b61, constants.%Self.96a) [symbolic = %assoc1 (constants.%assoc1.13e)] // CHECK:STDOUT: %Op.ref: @AddWith.loc124.%AddWith.assoc_type (%AddWith.assoc_type.bc8) = name_ref Op, %.loc126_5.1 [symbolic = %assoc1 (constants.%assoc1.13e)] -// CHECK:STDOUT: %impl.elem1.loc126_5.1: @AddWith.loc124.%.loc126_5.4 (%.012e) = impl_witness_access constants.%AddWith.lookup_impl_witness.8b3, element1 [symbolic = %impl.elem1.loc126_5.2 (constants.%impl.elem1.0c1)] +// CHECK:STDOUT: %impl.elem1.loc126_5.1: @AddWith.loc124.%.loc126_5.5 (%.012e) = impl_witness_access constants.%AddWith.lookup_impl_witness.8b3, element1 [symbolic = %impl.elem1.loc126_5.2 (constants.%impl.elem1.0c1)] // CHECK:STDOUT: %bound_method.loc126_5.1: = bound_method %x.ref, %impl.elem1.loc126_5.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.1: = specific_impl_function %impl.elem1.loc126_5.1, @AddWith.WithSelf.Op(constants.%U.as_type.b61, constants.%AddWith.facet.fc9) [symbolic = %specific_impl_fn.loc126_5.3 (constants.%specific_impl_fn.95a)] // CHECK:STDOUT: %bound_method.loc126_5.2: = bound_method %x.ref, %specific_impl_fn.loc126_5.1 // CHECK:STDOUT: %.loc126_5.2: ref @AddWith.loc124.%Result.as_type.loc123_54.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %AddWith.WithSelf.Op.call: init @AddWith.loc124.%Result.as_type.loc123_54.1 (%Result.as_type) to %.loc126_5.2 = call %bound_method.loc126_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc126_5.3: ref @AddWith.loc124.%Result.as_type.loc123_54.1 (%Result.as_type) = temporary %.loc126_5.2, %AddWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc126_5.1: @AddWith.loc124.%.loc126_5.5 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc126_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc126_5.1: @AddWith.loc124.%.loc126_5.6 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc126_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %bound_method.loc126_5.3: = bound_method %.loc126_5.3, %impl.elem0.loc126_5.1 +// CHECK:STDOUT: %.loc126_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc121_9.1 (constants.%Result)] // CHECK:STDOUT: %specific_impl_fn.loc126_5.2: = specific_impl_function %impl.elem0.loc126_5.1, @Destroy.WithSelf.Op(constants.%Result) [symbolic = %specific_impl_fn.loc126_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: %bound_method.loc126_5.4: = bound_method %.loc126_5.3, %specific_impl_fn.loc126_5.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc126_5.4(%.loc126_5.3) @@ -1420,13 +1422,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.lookup_impl_witness.loc137: = lookup_impl_witness %T.loc134_4.1, @SubWith.1, @SubWith.1(%U.as_type.loc134_36.1) [symbolic = %SubWith.lookup_impl_witness.loc137 (constants.%SubWith.lookup_impl_witness.07c)] // CHECK:STDOUT: %SubWith.facet: @SubWith.loc135.%SubWith.type.loc134_36.1 (%SubWith.type.b5d) = facet_value %T.as_type.loc135_29.1, (%SubWith.lookup_impl_witness.loc137) [symbolic = %SubWith.facet (constants.%SubWith.facet.44a)] // CHECK:STDOUT: %SubWith.WithSelf.Op.type: type = fn_type @SubWith.WithSelf.Op, @SubWith.WithSelf(%U.as_type.loc134_36.1, %SubWith.facet) [symbolic = %SubWith.WithSelf.Op.type (constants.%SubWith.WithSelf.Op.type.1fe)] -// CHECK:STDOUT: %.loc137_5.4: type = fn_type_with_self_type %SubWith.WithSelf.Op.type, %SubWith.facet [symbolic = %.loc137_5.4 (constants.%.fa2)] -// CHECK:STDOUT: %impl.elem1.loc137_5.2: @SubWith.loc135.%.loc137_5.4 (%.fa2) = impl_witness_access %SubWith.lookup_impl_witness.loc137, element1 [symbolic = %impl.elem1.loc137_5.2 (constants.%impl.elem1.fc7)] +// CHECK:STDOUT: %.loc137_5.5: type = fn_type_with_self_type %SubWith.WithSelf.Op.type, %SubWith.facet [symbolic = %.loc137_5.5 (constants.%.fa2)] +// CHECK:STDOUT: %impl.elem1.loc137_5.2: @SubWith.loc135.%.loc137_5.5 (%.fa2) = impl_witness_access %SubWith.lookup_impl_witness.loc137, element1 [symbolic = %impl.elem1.loc137_5.2 (constants.%impl.elem1.fc7)] // CHECK:STDOUT: %specific_impl_fn.loc137_5.3: = specific_impl_function %impl.elem1.loc137_5.2, @SubWith.WithSelf.Op(%U.as_type.loc134_36.1, %SubWith.facet) [symbolic = %specific_impl_fn.loc137_5.3 (constants.%specific_impl_fn.3fc)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Result.loc132_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc137_5.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc132_9.1 [symbolic = %.loc137_5.5 (constants.%.53a)] +// CHECK:STDOUT: %.loc137_5.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc132_9.1 [symbolic = %.loc137_5.6 (constants.%.53a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc132_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc137_5.2: @SubWith.loc135.%.loc137_5.5 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc137_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc137_5.2: @SubWith.loc135.%.loc137_5.6 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc137_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %specific_impl_fn.loc137_5.4: = specific_impl_function %impl.elem0.loc137_5.2, @Destroy.WithSelf.Op(%Result.loc132_9.1) [symbolic = %specific_impl_fn.loc137_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @SubWith.loc135.%Result.as_type.loc134_54.1 (%Result.as_type), %x.param: @SubWith.loc135.%T.as_type.loc135_29.1 (%T.as_type.b22), %y.param: @SubWith.loc135.%U.as_type.loc134_36.1 (%U.as_type.b61)) { @@ -1436,15 +1438,16 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.type.loc137: type = facet_type <@SubWith.1, @SubWith.1(constants.%U.as_type.b61)> [symbolic = %SubWith.type.loc134_36.1 (constants.%SubWith.type.b5d)] // CHECK:STDOUT: %.loc137_5.1: @SubWith.loc135.%SubWith.assoc_type (%SubWith.assoc_type.3a1) = specific_constant imports.%Core.import_ref.0f3, @SubWith.WithSelf(constants.%U.as_type.b61, constants.%Self.d6b) [symbolic = %assoc1 (constants.%assoc1.8fd)] // CHECK:STDOUT: %Op.ref: @SubWith.loc135.%SubWith.assoc_type (%SubWith.assoc_type.3a1) = name_ref Op, %.loc137_5.1 [symbolic = %assoc1 (constants.%assoc1.8fd)] -// CHECK:STDOUT: %impl.elem1.loc137_5.1: @SubWith.loc135.%.loc137_5.4 (%.fa2) = impl_witness_access constants.%SubWith.lookup_impl_witness.07c, element1 [symbolic = %impl.elem1.loc137_5.2 (constants.%impl.elem1.fc7)] +// CHECK:STDOUT: %impl.elem1.loc137_5.1: @SubWith.loc135.%.loc137_5.5 (%.fa2) = impl_witness_access constants.%SubWith.lookup_impl_witness.07c, element1 [symbolic = %impl.elem1.loc137_5.2 (constants.%impl.elem1.fc7)] // CHECK:STDOUT: %bound_method.loc137_5.1: = bound_method %x.ref, %impl.elem1.loc137_5.1 // CHECK:STDOUT: %specific_impl_fn.loc137_5.1: = specific_impl_function %impl.elem1.loc137_5.1, @SubWith.WithSelf.Op(constants.%U.as_type.b61, constants.%SubWith.facet.44a) [symbolic = %specific_impl_fn.loc137_5.3 (constants.%specific_impl_fn.3fc)] // CHECK:STDOUT: %bound_method.loc137_5.2: = bound_method %x.ref, %specific_impl_fn.loc137_5.1 // CHECK:STDOUT: %.loc137_5.2: ref @SubWith.loc135.%Result.as_type.loc134_54.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %SubWith.WithSelf.Op.call: init @SubWith.loc135.%Result.as_type.loc134_54.1 (%Result.as_type) to %.loc137_5.2 = call %bound_method.loc137_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc137_5.3: ref @SubWith.loc135.%Result.as_type.loc134_54.1 (%Result.as_type) = temporary %.loc137_5.2, %SubWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc137_5.1: @SubWith.loc135.%.loc137_5.5 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc137_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc137_5.1: @SubWith.loc135.%.loc137_5.6 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc137_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %bound_method.loc137_5.3: = bound_method %.loc137_5.3, %impl.elem0.loc137_5.1 +// CHECK:STDOUT: %.loc137_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc132_9.1 (constants.%Result)] // CHECK:STDOUT: %specific_impl_fn.loc137_5.2: = specific_impl_function %impl.elem0.loc137_5.1, @Destroy.WithSelf.Op(constants.%Result) [symbolic = %specific_impl_fn.loc137_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: %bound_method.loc137_5.4: = bound_method %.loc137_5.3, %specific_impl_fn.loc137_5.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc137_5.4(%.loc137_5.3) @@ -1462,13 +1465,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.lookup_impl_witness.loc148: = lookup_impl_witness %T.loc145_4.1, @MulWith.1, @MulWith.1(%U.as_type.loc145_36.1) [symbolic = %MulWith.lookup_impl_witness.loc148 (constants.%MulWith.lookup_impl_witness.a55)] // CHECK:STDOUT: %MulWith.facet: @MulWith.loc146.%MulWith.type.loc145_36.1 (%MulWith.type.f02) = facet_value %T.as_type.loc146_29.1, (%MulWith.lookup_impl_witness.loc148) [symbolic = %MulWith.facet (constants.%MulWith.facet.5c8)] // CHECK:STDOUT: %MulWith.WithSelf.Op.type: type = fn_type @MulWith.WithSelf.Op, @MulWith.WithSelf(%U.as_type.loc145_36.1, %MulWith.facet) [symbolic = %MulWith.WithSelf.Op.type (constants.%MulWith.WithSelf.Op.type.7b0)] -// CHECK:STDOUT: %.loc148_5.4: type = fn_type_with_self_type %MulWith.WithSelf.Op.type, %MulWith.facet [symbolic = %.loc148_5.4 (constants.%.476)] -// CHECK:STDOUT: %impl.elem1.loc148_5.2: @MulWith.loc146.%.loc148_5.4 (%.476) = impl_witness_access %MulWith.lookup_impl_witness.loc148, element1 [symbolic = %impl.elem1.loc148_5.2 (constants.%impl.elem1.7c4)] +// CHECK:STDOUT: %.loc148_5.5: type = fn_type_with_self_type %MulWith.WithSelf.Op.type, %MulWith.facet [symbolic = %.loc148_5.5 (constants.%.476)] +// CHECK:STDOUT: %impl.elem1.loc148_5.2: @MulWith.loc146.%.loc148_5.5 (%.476) = impl_witness_access %MulWith.lookup_impl_witness.loc148, element1 [symbolic = %impl.elem1.loc148_5.2 (constants.%impl.elem1.7c4)] // CHECK:STDOUT: %specific_impl_fn.loc148_5.3: = specific_impl_function %impl.elem1.loc148_5.2, @MulWith.WithSelf.Op(%U.as_type.loc145_36.1, %MulWith.facet) [symbolic = %specific_impl_fn.loc148_5.3 (constants.%specific_impl_fn.57f)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Result.loc143_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc148_5.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc143_9.1 [symbolic = %.loc148_5.5 (constants.%.53a)] +// CHECK:STDOUT: %.loc148_5.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc143_9.1 [symbolic = %.loc148_5.6 (constants.%.53a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc143_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc148_5.2: @MulWith.loc146.%.loc148_5.5 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc148_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc148_5.2: @MulWith.loc146.%.loc148_5.6 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc148_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %specific_impl_fn.loc148_5.4: = specific_impl_function %impl.elem0.loc148_5.2, @Destroy.WithSelf.Op(%Result.loc143_9.1) [symbolic = %specific_impl_fn.loc148_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @MulWith.loc146.%Result.as_type.loc145_54.1 (%Result.as_type), %x.param: @MulWith.loc146.%T.as_type.loc146_29.1 (%T.as_type.427), %y.param: @MulWith.loc146.%U.as_type.loc145_36.1 (%U.as_type.b61)) { @@ -1478,15 +1481,16 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.type.loc148: type = facet_type <@MulWith.1, @MulWith.1(constants.%U.as_type.b61)> [symbolic = %MulWith.type.loc145_36.1 (constants.%MulWith.type.f02)] // CHECK:STDOUT: %.loc148_5.1: @MulWith.loc146.%MulWith.assoc_type (%MulWith.assoc_type.a12) = specific_constant imports.%Core.import_ref.8c1, @MulWith.WithSelf(constants.%U.as_type.b61, constants.%Self.941) [symbolic = %assoc1 (constants.%assoc1.a0f)] // CHECK:STDOUT: %Op.ref: @MulWith.loc146.%MulWith.assoc_type (%MulWith.assoc_type.a12) = name_ref Op, %.loc148_5.1 [symbolic = %assoc1 (constants.%assoc1.a0f)] -// CHECK:STDOUT: %impl.elem1.loc148_5.1: @MulWith.loc146.%.loc148_5.4 (%.476) = impl_witness_access constants.%MulWith.lookup_impl_witness.a55, element1 [symbolic = %impl.elem1.loc148_5.2 (constants.%impl.elem1.7c4)] +// CHECK:STDOUT: %impl.elem1.loc148_5.1: @MulWith.loc146.%.loc148_5.5 (%.476) = impl_witness_access constants.%MulWith.lookup_impl_witness.a55, element1 [symbolic = %impl.elem1.loc148_5.2 (constants.%impl.elem1.7c4)] // CHECK:STDOUT: %bound_method.loc148_5.1: = bound_method %x.ref, %impl.elem1.loc148_5.1 // CHECK:STDOUT: %specific_impl_fn.loc148_5.1: = specific_impl_function %impl.elem1.loc148_5.1, @MulWith.WithSelf.Op(constants.%U.as_type.b61, constants.%MulWith.facet.5c8) [symbolic = %specific_impl_fn.loc148_5.3 (constants.%specific_impl_fn.57f)] // CHECK:STDOUT: %bound_method.loc148_5.2: = bound_method %x.ref, %specific_impl_fn.loc148_5.1 // CHECK:STDOUT: %.loc148_5.2: ref @MulWith.loc146.%Result.as_type.loc145_54.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %MulWith.WithSelf.Op.call: init @MulWith.loc146.%Result.as_type.loc145_54.1 (%Result.as_type) to %.loc148_5.2 = call %bound_method.loc148_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc148_5.3: ref @MulWith.loc146.%Result.as_type.loc145_54.1 (%Result.as_type) = temporary %.loc148_5.2, %MulWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc148_5.1: @MulWith.loc146.%.loc148_5.5 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc148_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc148_5.1: @MulWith.loc146.%.loc148_5.6 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc148_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %bound_method.loc148_5.3: = bound_method %.loc148_5.3, %impl.elem0.loc148_5.1 +// CHECK:STDOUT: %.loc148_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc143_9.1 (constants.%Result)] // CHECK:STDOUT: %specific_impl_fn.loc148_5.2: = specific_impl_function %impl.elem0.loc148_5.1, @Destroy.WithSelf.Op(constants.%Result) [symbolic = %specific_impl_fn.loc148_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: %bound_method.loc148_5.4: = bound_method %.loc148_5.3, %specific_impl_fn.loc148_5.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc148_5.4(%.loc148_5.3) @@ -1504,13 +1508,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.lookup_impl_witness.loc159: = lookup_impl_witness %T.loc156_4.1, @DivWith.1, @DivWith.1(%U.as_type.loc156_36.1) [symbolic = %DivWith.lookup_impl_witness.loc159 (constants.%DivWith.lookup_impl_witness.df2)] // CHECK:STDOUT: %DivWith.facet: @DivWith.loc157.%DivWith.type.loc156_36.1 (%DivWith.type.523) = facet_value %T.as_type.loc157_29.1, (%DivWith.lookup_impl_witness.loc159) [symbolic = %DivWith.facet (constants.%DivWith.facet.ac1)] // CHECK:STDOUT: %DivWith.WithSelf.Op.type: type = fn_type @DivWith.WithSelf.Op, @DivWith.WithSelf(%U.as_type.loc156_36.1, %DivWith.facet) [symbolic = %DivWith.WithSelf.Op.type (constants.%DivWith.WithSelf.Op.type.cb2)] -// CHECK:STDOUT: %.loc159_5.4: type = fn_type_with_self_type %DivWith.WithSelf.Op.type, %DivWith.facet [symbolic = %.loc159_5.4 (constants.%.2d3)] -// CHECK:STDOUT: %impl.elem1.loc159_5.2: @DivWith.loc157.%.loc159_5.4 (%.2d3) = impl_witness_access %DivWith.lookup_impl_witness.loc159, element1 [symbolic = %impl.elem1.loc159_5.2 (constants.%impl.elem1.254)] +// CHECK:STDOUT: %.loc159_5.5: type = fn_type_with_self_type %DivWith.WithSelf.Op.type, %DivWith.facet [symbolic = %.loc159_5.5 (constants.%.2d3)] +// CHECK:STDOUT: %impl.elem1.loc159_5.2: @DivWith.loc157.%.loc159_5.5 (%.2d3) = impl_witness_access %DivWith.lookup_impl_witness.loc159, element1 [symbolic = %impl.elem1.loc159_5.2 (constants.%impl.elem1.254)] // CHECK:STDOUT: %specific_impl_fn.loc159_5.3: = specific_impl_function %impl.elem1.loc159_5.2, @DivWith.WithSelf.Op(%U.as_type.loc156_36.1, %DivWith.facet) [symbolic = %specific_impl_fn.loc159_5.3 (constants.%specific_impl_fn.518)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Result.loc154_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc159_5.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc154_9.1 [symbolic = %.loc159_5.5 (constants.%.53a)] +// CHECK:STDOUT: %.loc159_5.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc154_9.1 [symbolic = %.loc159_5.6 (constants.%.53a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc154_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc159_5.2: @DivWith.loc157.%.loc159_5.5 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc159_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc159_5.2: @DivWith.loc157.%.loc159_5.6 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc159_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %specific_impl_fn.loc159_5.4: = specific_impl_function %impl.elem0.loc159_5.2, @Destroy.WithSelf.Op(%Result.loc154_9.1) [symbolic = %specific_impl_fn.loc159_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @DivWith.loc157.%Result.as_type.loc156_54.1 (%Result.as_type), %x.param: @DivWith.loc157.%T.as_type.loc157_29.1 (%T.as_type.a31), %y.param: @DivWith.loc157.%U.as_type.loc156_36.1 (%U.as_type.b61)) { @@ -1520,15 +1524,16 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.type.loc159: type = facet_type <@DivWith.1, @DivWith.1(constants.%U.as_type.b61)> [symbolic = %DivWith.type.loc156_36.1 (constants.%DivWith.type.523)] // CHECK:STDOUT: %.loc159_5.1: @DivWith.loc157.%DivWith.assoc_type (%DivWith.assoc_type.cf4) = specific_constant imports.%Core.import_ref.ca2, @DivWith.WithSelf(constants.%U.as_type.b61, constants.%Self.16a) [symbolic = %assoc1 (constants.%assoc1.4eb)] // CHECK:STDOUT: %Op.ref: @DivWith.loc157.%DivWith.assoc_type (%DivWith.assoc_type.cf4) = name_ref Op, %.loc159_5.1 [symbolic = %assoc1 (constants.%assoc1.4eb)] -// CHECK:STDOUT: %impl.elem1.loc159_5.1: @DivWith.loc157.%.loc159_5.4 (%.2d3) = impl_witness_access constants.%DivWith.lookup_impl_witness.df2, element1 [symbolic = %impl.elem1.loc159_5.2 (constants.%impl.elem1.254)] +// CHECK:STDOUT: %impl.elem1.loc159_5.1: @DivWith.loc157.%.loc159_5.5 (%.2d3) = impl_witness_access constants.%DivWith.lookup_impl_witness.df2, element1 [symbolic = %impl.elem1.loc159_5.2 (constants.%impl.elem1.254)] // CHECK:STDOUT: %bound_method.loc159_5.1: = bound_method %x.ref, %impl.elem1.loc159_5.1 // CHECK:STDOUT: %specific_impl_fn.loc159_5.1: = specific_impl_function %impl.elem1.loc159_5.1, @DivWith.WithSelf.Op(constants.%U.as_type.b61, constants.%DivWith.facet.ac1) [symbolic = %specific_impl_fn.loc159_5.3 (constants.%specific_impl_fn.518)] // CHECK:STDOUT: %bound_method.loc159_5.2: = bound_method %x.ref, %specific_impl_fn.loc159_5.1 // CHECK:STDOUT: %.loc159_5.2: ref @DivWith.loc157.%Result.as_type.loc156_54.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %DivWith.WithSelf.Op.call: init @DivWith.loc157.%Result.as_type.loc156_54.1 (%Result.as_type) to %.loc159_5.2 = call %bound_method.loc159_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc159_5.3: ref @DivWith.loc157.%Result.as_type.loc156_54.1 (%Result.as_type) = temporary %.loc159_5.2, %DivWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc159_5.1: @DivWith.loc157.%.loc159_5.5 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc159_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc159_5.1: @DivWith.loc157.%.loc159_5.6 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc159_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %bound_method.loc159_5.3: = bound_method %.loc159_5.3, %impl.elem0.loc159_5.1 +// CHECK:STDOUT: %.loc159_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc154_9.1 (constants.%Result)] // CHECK:STDOUT: %specific_impl_fn.loc159_5.2: = specific_impl_function %impl.elem0.loc159_5.1, @Destroy.WithSelf.Op(constants.%Result) [symbolic = %specific_impl_fn.loc159_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: %bound_method.loc159_5.4: = bound_method %.loc159_5.3, %specific_impl_fn.loc159_5.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc159_5.4(%.loc159_5.3) @@ -1546,13 +1551,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.lookup_impl_witness.loc170: = lookup_impl_witness %T.loc167_4.1, @ModWith.1, @ModWith.1(%U.as_type.loc167_36.1) [symbolic = %ModWith.lookup_impl_witness.loc170 (constants.%ModWith.lookup_impl_witness.054)] // CHECK:STDOUT: %ModWith.facet: @ModWith.loc168.%ModWith.type.loc167_36.1 (%ModWith.type.937) = facet_value %T.as_type.loc168_29.1, (%ModWith.lookup_impl_witness.loc170) [symbolic = %ModWith.facet (constants.%ModWith.facet.555)] // CHECK:STDOUT: %ModWith.WithSelf.Op.type: type = fn_type @ModWith.WithSelf.Op, @ModWith.WithSelf(%U.as_type.loc167_36.1, %ModWith.facet) [symbolic = %ModWith.WithSelf.Op.type (constants.%ModWith.WithSelf.Op.type.cfa)] -// CHECK:STDOUT: %.loc170_5.4: type = fn_type_with_self_type %ModWith.WithSelf.Op.type, %ModWith.facet [symbolic = %.loc170_5.4 (constants.%.973)] -// CHECK:STDOUT: %impl.elem1.loc170_5.2: @ModWith.loc168.%.loc170_5.4 (%.973) = impl_witness_access %ModWith.lookup_impl_witness.loc170, element1 [symbolic = %impl.elem1.loc170_5.2 (constants.%impl.elem1.f20)] +// CHECK:STDOUT: %.loc170_5.5: type = fn_type_with_self_type %ModWith.WithSelf.Op.type, %ModWith.facet [symbolic = %.loc170_5.5 (constants.%.973)] +// CHECK:STDOUT: %impl.elem1.loc170_5.2: @ModWith.loc168.%.loc170_5.5 (%.973) = impl_witness_access %ModWith.lookup_impl_witness.loc170, element1 [symbolic = %impl.elem1.loc170_5.2 (constants.%impl.elem1.f20)] // CHECK:STDOUT: %specific_impl_fn.loc170_5.3: = specific_impl_function %impl.elem1.loc170_5.2, @ModWith.WithSelf.Op(%U.as_type.loc167_36.1, %ModWith.facet) [symbolic = %specific_impl_fn.loc170_5.3 (constants.%specific_impl_fn.37e)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Result.loc165_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc170_5.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc165_9.1 [symbolic = %.loc170_5.5 (constants.%.53a)] +// CHECK:STDOUT: %.loc170_5.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc165_9.1 [symbolic = %.loc170_5.6 (constants.%.53a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc165_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc170_5.2: @ModWith.loc168.%.loc170_5.5 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc170_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc170_5.2: @ModWith.loc168.%.loc170_5.6 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc170_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %specific_impl_fn.loc170_5.4: = specific_impl_function %impl.elem0.loc170_5.2, @Destroy.WithSelf.Op(%Result.loc165_9.1) [symbolic = %specific_impl_fn.loc170_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @ModWith.loc168.%Result.as_type.loc167_54.1 (%Result.as_type), %x.param: @ModWith.loc168.%T.as_type.loc168_29.1 (%T.as_type.fcd), %y.param: @ModWith.loc168.%U.as_type.loc167_36.1 (%U.as_type.b61)) { @@ -1562,15 +1567,16 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.type.loc170: type = facet_type <@ModWith.1, @ModWith.1(constants.%U.as_type.b61)> [symbolic = %ModWith.type.loc167_36.1 (constants.%ModWith.type.937)] // CHECK:STDOUT: %.loc170_5.1: @ModWith.loc168.%ModWith.assoc_type (%ModWith.assoc_type.626) = specific_constant imports.%Core.import_ref.ffe, @ModWith.WithSelf(constants.%U.as_type.b61, constants.%Self.0ef) [symbolic = %assoc1 (constants.%assoc1.6d1)] // CHECK:STDOUT: %Op.ref: @ModWith.loc168.%ModWith.assoc_type (%ModWith.assoc_type.626) = name_ref Op, %.loc170_5.1 [symbolic = %assoc1 (constants.%assoc1.6d1)] -// CHECK:STDOUT: %impl.elem1.loc170_5.1: @ModWith.loc168.%.loc170_5.4 (%.973) = impl_witness_access constants.%ModWith.lookup_impl_witness.054, element1 [symbolic = %impl.elem1.loc170_5.2 (constants.%impl.elem1.f20)] +// CHECK:STDOUT: %impl.elem1.loc170_5.1: @ModWith.loc168.%.loc170_5.5 (%.973) = impl_witness_access constants.%ModWith.lookup_impl_witness.054, element1 [symbolic = %impl.elem1.loc170_5.2 (constants.%impl.elem1.f20)] // CHECK:STDOUT: %bound_method.loc170_5.1: = bound_method %x.ref, %impl.elem1.loc170_5.1 // CHECK:STDOUT: %specific_impl_fn.loc170_5.1: = specific_impl_function %impl.elem1.loc170_5.1, @ModWith.WithSelf.Op(constants.%U.as_type.b61, constants.%ModWith.facet.555) [symbolic = %specific_impl_fn.loc170_5.3 (constants.%specific_impl_fn.37e)] // CHECK:STDOUT: %bound_method.loc170_5.2: = bound_method %x.ref, %specific_impl_fn.loc170_5.1 // CHECK:STDOUT: %.loc170_5.2: ref @ModWith.loc168.%Result.as_type.loc167_54.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %ModWith.WithSelf.Op.call: init @ModWith.loc168.%Result.as_type.loc167_54.1 (%Result.as_type) to %.loc170_5.2 = call %bound_method.loc170_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc170_5.3: ref @ModWith.loc168.%Result.as_type.loc167_54.1 (%Result.as_type) = temporary %.loc170_5.2, %ModWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc170_5.1: @ModWith.loc168.%.loc170_5.5 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc170_5.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc170_5.1: @ModWith.loc168.%.loc170_5.6 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc170_5.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %bound_method.loc170_5.3: = bound_method %.loc170_5.3, %impl.elem0.loc170_5.1 +// CHECK:STDOUT: %.loc170_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc165_9.1 (constants.%Result)] // CHECK:STDOUT: %specific_impl_fn.loc170_5.2: = specific_impl_function %impl.elem0.loc170_5.1, @Destroy.WithSelf.Op(constants.%Result) [symbolic = %specific_impl_fn.loc170_5.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: %bound_method.loc170_5.4: = bound_method %.loc170_5.3, %specific_impl_fn.loc170_5.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc170_5.4(%.loc170_5.3) @@ -1734,16 +1740,17 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Inc.WithSelf.Op.type: type = fn_type @Inc.WithSelf.Op, @Inc.WithSelf(%T.loc278_13.1) [symbolic = %Inc.WithSelf.Op.type (constants.%Inc.WithSelf.Op.type.e10ef6.2)] -// CHECK:STDOUT: %.loc280: type = fn_type_with_self_type %Inc.WithSelf.Op.type, %T.loc278_13.1 [symbolic = %.loc280 (constants.%.a08)] +// CHECK:STDOUT: %.loc280_3.2: type = fn_type_with_self_type %Inc.WithSelf.Op.type, %T.loc278_13.1 [symbolic = %.loc280_3.2 (constants.%.a08)] // CHECK:STDOUT: %Inc.lookup_impl_witness: = lookup_impl_witness %T.loc278_13.1, @Inc [symbolic = %Inc.lookup_impl_witness (constants.%Inc.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc280_3.2: @TestInc.%.loc280 (%.a08) = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc280_3.2 (constants.%impl.elem0.b92)] +// CHECK:STDOUT: %impl.elem0.loc280_3.2: @TestInc.%.loc280_3.2 (%.a08) = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc280_3.2 (constants.%impl.elem0.b92)] // CHECK:STDOUT: %specific_impl_fn.loc280_3.2: = specific_impl_function %impl.elem0.loc280_3.2, @Inc.WithSelf.Op(%T.loc278_13.1) [symbolic = %specific_impl_fn.loc280_3.2 (constants.%specific_impl_fn.855)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: ref @TestInc.%T.as_type.loc278_33.1 (%T.as_type.232)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: ref @TestInc.%T.as_type.loc278_33.1 (%T.as_type.232) = name_ref x, %x -// CHECK:STDOUT: %impl.elem0.loc280_3.1: @TestInc.%.loc280 (%.a08) = impl_witness_access constants.%Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc280_3.2 (constants.%impl.elem0.b92)] +// CHECK:STDOUT: %impl.elem0.loc280_3.1: @TestInc.%.loc280_3.2 (%.a08) = impl_witness_access constants.%Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc280_3.2 (constants.%impl.elem0.b92)] // CHECK:STDOUT: %bound_method.loc280_3.1: = bound_method %x.ref, %impl.elem0.loc280_3.1 +// CHECK:STDOUT: %.loc280_3.1: %Inc.type = converted constants.%T.as_type.232, constants.%T.8f3 [symbolic = %T.loc278_13.1 (constants.%T.8f3)] // CHECK:STDOUT: %specific_impl_fn.loc280_3.1: = specific_impl_function %impl.elem0.loc280_3.1, @Inc.WithSelf.Op(constants.%T.8f3) [symbolic = %specific_impl_fn.loc280_3.2 (constants.%specific_impl_fn.855)] // CHECK:STDOUT: %bound_method.loc280_3.2: = bound_method %x.ref, %specific_impl_fn.loc280_3.1 // CHECK:STDOUT: %Inc.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc280_3.2(%x.ref) @@ -1757,16 +1764,17 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Dec.WithSelf.Op.type: type = fn_type @Dec.WithSelf.Op, @Dec.WithSelf(%T.loc284_13.1) [symbolic = %Dec.WithSelf.Op.type (constants.%Dec.WithSelf.Op.type.bfa830.2)] -// CHECK:STDOUT: %.loc286: type = fn_type_with_self_type %Dec.WithSelf.Op.type, %T.loc284_13.1 [symbolic = %.loc286 (constants.%.aae)] +// CHECK:STDOUT: %.loc286_3.2: type = fn_type_with_self_type %Dec.WithSelf.Op.type, %T.loc284_13.1 [symbolic = %.loc286_3.2 (constants.%.aae)] // CHECK:STDOUT: %Dec.lookup_impl_witness: = lookup_impl_witness %T.loc284_13.1, @Dec [symbolic = %Dec.lookup_impl_witness (constants.%Dec.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc286_3.2: @TestDec.%.loc286 (%.aae) = impl_witness_access %Dec.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc286_3.2 (constants.%impl.elem0.950)] +// CHECK:STDOUT: %impl.elem0.loc286_3.2: @TestDec.%.loc286_3.2 (%.aae) = impl_witness_access %Dec.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc286_3.2 (constants.%impl.elem0.950)] // CHECK:STDOUT: %specific_impl_fn.loc286_3.2: = specific_impl_function %impl.elem0.loc286_3.2, @Dec.WithSelf.Op(%T.loc284_13.1) [symbolic = %specific_impl_fn.loc286_3.2 (constants.%specific_impl_fn.539)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: ref @TestDec.%T.as_type.loc284_33.1 (%T.as_type.c32)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: ref @TestDec.%T.as_type.loc284_33.1 (%T.as_type.c32) = name_ref x, %x -// CHECK:STDOUT: %impl.elem0.loc286_3.1: @TestDec.%.loc286 (%.aae) = impl_witness_access constants.%Dec.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc286_3.2 (constants.%impl.elem0.950)] +// CHECK:STDOUT: %impl.elem0.loc286_3.1: @TestDec.%.loc286_3.2 (%.aae) = impl_witness_access constants.%Dec.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc286_3.2 (constants.%impl.elem0.950)] // CHECK:STDOUT: %bound_method.loc286_3.1: = bound_method %x.ref, %impl.elem0.loc286_3.1 +// CHECK:STDOUT: %.loc286_3.1: %Dec.type = converted constants.%T.as_type.c32, constants.%T.e8e [symbolic = %T.loc284_13.1 (constants.%T.e8e)] // CHECK:STDOUT: %specific_impl_fn.loc286_3.1: = specific_impl_function %impl.elem0.loc286_3.1, @Dec.WithSelf.Op(constants.%T.e8e) [symbolic = %specific_impl_fn.loc286_3.2 (constants.%specific_impl_fn.539)] // CHECK:STDOUT: %bound_method.loc286_3.2: = bound_method %x.ref, %specific_impl_fn.loc286_3.1 // CHECK:STDOUT: %Dec.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc286_3.2(%x.ref) @@ -1780,32 +1788,35 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Negate.lookup_impl_witness: = lookup_impl_witness %T.loc293_4.1, @Negate [symbolic = %Negate.lookup_impl_witness (constants.%Negate.lookup_impl_witness.48a)] -// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %T.as_type.loc294_24.1, (%Negate.lookup_impl_witness) [symbolic = %Negate.facet (constants.%Negate.facet.f2f)] -// CHECK:STDOUT: %Negate.WithSelf.Op.type: type = fn_type @Negate.WithSelf.Op, @Negate.WithSelf(%Negate.facet) [symbolic = %Negate.WithSelf.Op.type (constants.%Negate.WithSelf.Op.type.803)] -// CHECK:STDOUT: %.loc296_3.3: type = fn_type_with_self_type %Negate.WithSelf.Op.type, %Negate.facet [symbolic = %.loc296_3.3 (constants.%.c6c)] -// CHECK:STDOUT: %impl.elem1.loc296_3.2: @TestNegate.%.loc296_3.3 (%.c6c) = impl_witness_access %Negate.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc296_3.2 (constants.%impl.elem1.9a8)] -// CHECK:STDOUT: %specific_impl_fn.loc296_3.3: = specific_impl_function %impl.elem1.loc296_3.2, @Negate.WithSelf.Op(%Negate.facet) [symbolic = %specific_impl_fn.loc296_3.3 (constants.%specific_impl_fn.c5a)] +// CHECK:STDOUT: %Negate.facet.loc296_3.2: %Negate.type = facet_value %T.as_type.loc294_24.1, (%Negate.lookup_impl_witness) [symbolic = %Negate.facet.loc296_3.2 (constants.%Negate.facet.f2f)] +// CHECK:STDOUT: %Negate.WithSelf.Op.type: type = fn_type @Negate.WithSelf.Op, @Negate.WithSelf(%Negate.facet.loc296_3.2) [symbolic = %Negate.WithSelf.Op.type (constants.%Negate.WithSelf.Op.type.803)] +// CHECK:STDOUT: %.loc296_3.5: type = fn_type_with_self_type %Negate.WithSelf.Op.type, %Negate.facet.loc296_3.2 [symbolic = %.loc296_3.5 (constants.%.c6c)] +// CHECK:STDOUT: %impl.elem1.loc296_3.2: @TestNegate.%.loc296_3.5 (%.c6c) = impl_witness_access %Negate.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc296_3.2 (constants.%impl.elem1.9a8)] +// CHECK:STDOUT: %specific_impl_fn.loc296_3.3: = specific_impl_function %impl.elem1.loc296_3.2, @Negate.WithSelf.Op(%Negate.facet.loc296_3.2) [symbolic = %specific_impl_fn.loc296_3.3 (constants.%specific_impl_fn.c5a)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Result.loc292_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc296_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc292_9.1 [symbolic = %.loc296_3.4 (constants.%.53a)] +// CHECK:STDOUT: %.loc296_3.6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc292_9.1 [symbolic = %.loc296_3.6 (constants.%.53a)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc292_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc296_3.2: @TestNegate.%.loc296_3.4 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc296_3.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %impl.elem0.loc296_3.2: @TestNegate.%.loc296_3.6 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc296_3.2 (constants.%impl.elem0.0f9)] // CHECK:STDOUT: %specific_impl_fn.loc296_3.4: = specific_impl_function %impl.elem0.loc296_3.2, @Destroy.WithSelf.Op(%Result.loc292_9.1) [symbolic = %specific_impl_fn.loc296_3.4 (constants.%specific_impl_fn.afc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%y.param: @TestNegate.%Result.as_type.loc293_50.1 (%Result.as_type), %x.param: @TestNegate.%T.as_type.loc294_24.1 (%T.as_type.a98)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: @TestNegate.%T.as_type.loc294_24.1 (%T.as_type.a98) = name_ref x, %x -// CHECK:STDOUT: %impl.elem1.loc296_3.1: @TestNegate.%.loc296_3.3 (%.c6c) = impl_witness_access constants.%Negate.lookup_impl_witness.48a, element1 [symbolic = %impl.elem1.loc296_3.2 (constants.%impl.elem1.9a8)] +// CHECK:STDOUT: %impl.elem1.loc296_3.1: @TestNegate.%.loc296_3.5 (%.c6c) = impl_witness_access constants.%Negate.lookup_impl_witness.48a, element1 [symbolic = %impl.elem1.loc296_3.2 (constants.%impl.elem1.9a8)] // CHECK:STDOUT: %bound_method.loc296_3.1: = bound_method %x.ref, %impl.elem1.loc296_3.1 +// CHECK:STDOUT: %Negate.facet.loc296_3.1: %Negate.type = facet_value constants.%T.as_type.a98, (constants.%Negate.lookup_impl_witness.48a) [symbolic = %Negate.facet.loc296_3.2 (constants.%Negate.facet.f2f)] +// CHECK:STDOUT: %.loc296_3.1: %Negate.type = converted constants.%T.as_type.a98, %Negate.facet.loc296_3.1 [symbolic = %Negate.facet.loc296_3.2 (constants.%Negate.facet.f2f)] // CHECK:STDOUT: %specific_impl_fn.loc296_3.1: = specific_impl_function %impl.elem1.loc296_3.1, @Negate.WithSelf.Op(constants.%Negate.facet.f2f) [symbolic = %specific_impl_fn.loc296_3.3 (constants.%specific_impl_fn.c5a)] // CHECK:STDOUT: %bound_method.loc296_3.2: = bound_method %x.ref, %specific_impl_fn.loc296_3.1 -// CHECK:STDOUT: %.loc296_3.1: ref @TestNegate.%Result.as_type.loc293_50.1 (%Result.as_type) = temporary_storage -// CHECK:STDOUT: %Negate.WithSelf.Op.call: init @TestNegate.%Result.as_type.loc293_50.1 (%Result.as_type) to %.loc296_3.1 = call %bound_method.loc296_3.2(%x.ref) -// CHECK:STDOUT: %.loc296_3.2: ref @TestNegate.%Result.as_type.loc293_50.1 (%Result.as_type) = temporary %.loc296_3.1, %Negate.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc296_3.1: @TestNegate.%.loc296_3.4 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc296_3.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %bound_method.loc296_3.3: = bound_method %.loc296_3.2, %impl.elem0.loc296_3.1 +// CHECK:STDOUT: %.loc296_3.2: ref @TestNegate.%Result.as_type.loc293_50.1 (%Result.as_type) = temporary_storage +// CHECK:STDOUT: %Negate.WithSelf.Op.call: init @TestNegate.%Result.as_type.loc293_50.1 (%Result.as_type) to %.loc296_3.2 = call %bound_method.loc296_3.2(%x.ref) +// CHECK:STDOUT: %.loc296_3.3: ref @TestNegate.%Result.as_type.loc293_50.1 (%Result.as_type) = temporary %.loc296_3.2, %Negate.WithSelf.Op.call +// CHECK:STDOUT: %impl.elem0.loc296_3.1: @TestNegate.%.loc296_3.6 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc296_3.2 (constants.%impl.elem0.0f9)] +// CHECK:STDOUT: %bound_method.loc296_3.3: = bound_method %.loc296_3.3, %impl.elem0.loc296_3.1 +// CHECK:STDOUT: %.loc296_3.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc292_9.1 (constants.%Result)] // CHECK:STDOUT: %specific_impl_fn.loc296_3.2: = specific_impl_function %impl.elem0.loc296_3.1, @Destroy.WithSelf.Op(constants.%Result) [symbolic = %specific_impl_fn.loc296_3.4 (constants.%specific_impl_fn.afc)] -// CHECK:STDOUT: %bound_method.loc296_3.4: = bound_method %.loc296_3.2, %specific_impl_fn.loc296_3.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc296_3.4(%.loc296_3.2) +// CHECK:STDOUT: %bound_method.loc296_3.4: = bound_method %.loc296_3.3, %specific_impl_fn.loc296_3.2 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc296_3.4(%.loc296_3.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1956,11 +1967,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.lookup_impl_witness.loc126 => constants.%custom_witness.248 // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.ff0 // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.e1f -// CHECK:STDOUT: %.loc126_5.4 => constants.%.2c3 +// CHECK:STDOUT: %.loc126_5.5 => constants.%.2c3 // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Op.72717c.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Op.72717c.1 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc126_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc126_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int16.Op.4dca31.1 @@ -1997,11 +2008,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.lookup_impl_witness.loc137 => constants.%custom_witness.f14 // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.49f // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.843 -// CHECK:STDOUT: %.loc137_5.4 => constants.%.00a +// CHECK:STDOUT: %.loc137_5.5 => constants.%.00a // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Op.72717c.2 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Op.72717c.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc137_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc137_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int16.Op.4dca31.1 @@ -2038,11 +2049,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.lookup_impl_witness.loc148 => constants.%custom_witness.6bd // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.d6e // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.f9f -// CHECK:STDOUT: %.loc148_5.4 => constants.%.0ed +// CHECK:STDOUT: %.loc148_5.5 => constants.%.0ed // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Op.72717c.3 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Op.72717c.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc148_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc148_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int16.Op.4dca31.1 @@ -2079,11 +2090,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.lookup_impl_witness.loc159 => constants.%custom_witness.22c // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.437 // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.51a -// CHECK:STDOUT: %.loc159_5.4 => constants.%.316 +// CHECK:STDOUT: %.loc159_5.5 => constants.%.316 // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Op.72717c.4 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Op.72717c.4 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc159_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc159_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int16.Op.4dca31.1 @@ -2120,11 +2131,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.lookup_impl_witness.loc170 => constants.%custom_witness.9e6 // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.251 // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.62d -// CHECK:STDOUT: %.loc170_5.4 => constants.%.9b3 +// CHECK:STDOUT: %.loc170_5.5 => constants.%.9b3 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Op.72717c.5 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Op.72717c.5 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc170_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc170_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int16.Op.4dca31.1 @@ -2161,11 +2172,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.lookup_impl_witness.loc126 => constants.%custom_witness.b17 // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.b59 // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.de7 -// CHECK:STDOUT: %.loc126_5.4 => constants.%.c9e +// CHECK:STDOUT: %.loc126_5.5 => constants.%.c9e // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int16.Op.4dca31.3 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int16.Op.4dca31.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc126_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc126_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int16.Op.4dca31.1 @@ -2202,11 +2213,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.lookup_impl_witness.loc137 => constants.%custom_witness.b07 // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.ef4 // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.723 -// CHECK:STDOUT: %.loc137_5.4 => constants.%.6f3 +// CHECK:STDOUT: %.loc137_5.5 => constants.%.6f3 // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int16.Op.4dca31.4 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int16.Op.4dca31.4 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc137_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc137_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int16.Op.4dca31.1 @@ -2243,11 +2254,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.lookup_impl_witness.loc148 => constants.%custom_witness.8bd // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.19a // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.7b1 -// CHECK:STDOUT: %.loc148_5.4 => constants.%.d82 +// CHECK:STDOUT: %.loc148_5.5 => constants.%.d82 // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int16.Op.4dca31.5 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int16.Op.4dca31.5 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc148_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc148_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int16.Op.4dca31.1 @@ -2284,11 +2295,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.lookup_impl_witness.loc159 => constants.%custom_witness.963 // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.115 // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.a49 -// CHECK:STDOUT: %.loc159_5.4 => constants.%.251 +// CHECK:STDOUT: %.loc159_5.5 => constants.%.251 // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int16.Op.4dca31.6 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int16.Op.4dca31.6 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc159_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc159_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int16.Op.4dca31.1 @@ -2325,11 +2336,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.lookup_impl_witness.loc170 => constants.%custom_witness.8f4 // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.925 // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.519 -// CHECK:STDOUT: %.loc170_5.4 => constants.%.66e2 +// CHECK:STDOUT: %.loc170_5.5 => constants.%.66e2 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int16.Op.4dca31.7 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int16.Op.4dca31.7 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc170_5.5 => constants.%.6da +// CHECK:STDOUT: %.loc170_5.6 => constants.%.6da // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 // CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int16.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int16.Op.4dca31.1 @@ -2366,11 +2377,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.lookup_impl_witness.loc126 => constants.%custom_witness.e02e0c.1 // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.007 // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.dc4 -// CHECK:STDOUT: %.loc126_5.4 => constants.%.dbb +// CHECK:STDOUT: %.loc126_5.5 => constants.%.dbb // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int16.Op.4dca31.8 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int16.Op.4dca31.8 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc126_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc126_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int32.Op.4dca31.1 @@ -2407,11 +2418,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.lookup_impl_witness.loc137 => constants.%custom_witness.4dea15.1 // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.703 // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.6eb -// CHECK:STDOUT: %.loc137_5.4 => constants.%.114 +// CHECK:STDOUT: %.loc137_5.5 => constants.%.114 // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int16.Op.4dca31.9 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int16.Op.4dca31.9 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc137_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc137_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int32.Op.4dca31.1 @@ -2448,11 +2459,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.lookup_impl_witness.loc148 => constants.%custom_witness.337c88.1 // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.fcd // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.99f -// CHECK:STDOUT: %.loc148_5.4 => constants.%.c1c +// CHECK:STDOUT: %.loc148_5.5 => constants.%.c1c // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int16.Op.4dca31.10 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int16.Op.4dca31.10 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc148_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc148_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int32.Op.4dca31.1 @@ -2489,11 +2500,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.lookup_impl_witness.loc159 => constants.%custom_witness.3eb227.1 // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.3bd // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.500 -// CHECK:STDOUT: %.loc159_5.4 => constants.%.ebc +// CHECK:STDOUT: %.loc159_5.5 => constants.%.ebc // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int16.Op.4dca31.11 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int16.Op.4dca31.11 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc159_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc159_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int32.Op.4dca31.1 @@ -2530,11 +2541,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.lookup_impl_witness.loc170 => constants.%custom_witness.501c6d.1 // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.a29 // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.d03 -// CHECK:STDOUT: %.loc170_5.4 => constants.%.839 +// CHECK:STDOUT: %.loc170_5.5 => constants.%.839 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int16.Op.4dca31.12 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int16.Op.4dca31.12 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc170_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc170_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int32.Op.4dca31.1 @@ -2571,11 +2582,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.lookup_impl_witness.loc126 => constants.%custom_witness.15f // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.35b // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.29e -// CHECK:STDOUT: %.loc126_5.4 => constants.%.45e +// CHECK:STDOUT: %.loc126_5.5 => constants.%.45e // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int32.Op.4dca31.2 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int32.Op.4dca31.2 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc126_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc126_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int32.Op.4dca31.1 @@ -2612,11 +2623,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.lookup_impl_witness.loc137 => constants.%custom_witness.bb4 // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.8da // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.85b -// CHECK:STDOUT: %.loc137_5.4 => constants.%.db9 +// CHECK:STDOUT: %.loc137_5.5 => constants.%.db9 // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int32.Op.4dca31.3 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int32.Op.4dca31.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc137_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc137_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int32.Op.4dca31.1 @@ -2653,11 +2664,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.lookup_impl_witness.loc148 => constants.%custom_witness.0ab // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.920 // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.545 -// CHECK:STDOUT: %.loc148_5.4 => constants.%.c5e +// CHECK:STDOUT: %.loc148_5.5 => constants.%.c5e // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int32.Op.4dca31.4 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int32.Op.4dca31.4 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc148_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc148_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int32.Op.4dca31.1 @@ -2694,11 +2705,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.lookup_impl_witness.loc159 => constants.%custom_witness.3ec // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.c79 // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.a6b -// CHECK:STDOUT: %.loc159_5.4 => constants.%.558 +// CHECK:STDOUT: %.loc159_5.5 => constants.%.558 // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int32.Op.4dca31.5 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int32.Op.4dca31.5 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc159_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc159_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int32.Op.4dca31.1 @@ -2735,11 +2746,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.lookup_impl_witness.loc170 => constants.%custom_witness.de0 // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.bef // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.d54 -// CHECK:STDOUT: %.loc170_5.4 => constants.%.8c0 +// CHECK:STDOUT: %.loc170_5.5 => constants.%.8c0 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int32.Op.4dca31.6 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int32.Op.4dca31.6 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc170_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc170_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int32.Op.4dca31.1 @@ -2776,11 +2787,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.lookup_impl_witness.loc126 => constants.%custom_witness.e02e0c.2 // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.ee1 // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.5a5 -// CHECK:STDOUT: %.loc126_5.4 => constants.%.dcb +// CHECK:STDOUT: %.loc126_5.5 => constants.%.dcb // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int32.Op.4dca31.7 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int32.Op.4dca31.7 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc126_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc126_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int32.Op.4dca31.1 @@ -2817,11 +2828,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.lookup_impl_witness.loc137 => constants.%custom_witness.4dea15.2 // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.3dd // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.ccc -// CHECK:STDOUT: %.loc137_5.4 => constants.%.237 +// CHECK:STDOUT: %.loc137_5.5 => constants.%.237 // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int32.Op.4dca31.8 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int32.Op.4dca31.8 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc137_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc137_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int32.Op.4dca31.1 @@ -2858,11 +2869,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.lookup_impl_witness.loc148 => constants.%custom_witness.337c88.2 // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.4d3 // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.843 -// CHECK:STDOUT: %.loc148_5.4 => constants.%.8c9 +// CHECK:STDOUT: %.loc148_5.5 => constants.%.8c9 // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int32.Op.4dca31.9 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int32.Op.4dca31.9 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc148_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc148_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int32.Op.4dca31.1 @@ -2899,11 +2910,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.lookup_impl_witness.loc159 => constants.%custom_witness.3eb227.2 // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.4fe // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.24e -// CHECK:STDOUT: %.loc159_5.4 => constants.%.450 +// CHECK:STDOUT: %.loc159_5.5 => constants.%.450 // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int32.Op.4dca31.10 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int32.Op.4dca31.10 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc159_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc159_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int32.Op.4dca31.1 @@ -2940,11 +2951,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.lookup_impl_witness.loc170 => constants.%custom_witness.501c6d.2 // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.60c // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.bed -// CHECK:STDOUT: %.loc170_5.4 => constants.%.382 +// CHECK:STDOUT: %.loc170_5.5 => constants.%.382 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int32.Op.4dca31.11 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int32.Op.4dca31.11 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc170_5.5 => constants.%.043 +// CHECK:STDOUT: %.loc170_5.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int32.Op.4dca31.1 @@ -2981,11 +2992,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.lookup_impl_witness.loc126 => constants.%custom_witness.68d // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.45c // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.6ad -// CHECK:STDOUT: %.loc126_5.4 => constants.%.b22 +// CHECK:STDOUT: %.loc126_5.5 => constants.%.b22 // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Op.72717c.6 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Op.72717c.6 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc126_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc126_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int64.Op.4dca31.1 @@ -3022,11 +3033,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.lookup_impl_witness.loc137 => constants.%custom_witness.1fa // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.3c0 // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.bdd -// CHECK:STDOUT: %.loc137_5.4 => constants.%.c3d +// CHECK:STDOUT: %.loc137_5.5 => constants.%.c3d // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Op.72717c.7 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Op.72717c.7 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc137_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc137_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int64.Op.4dca31.1 @@ -3063,11 +3074,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.lookup_impl_witness.loc148 => constants.%custom_witness.99d // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.dbd // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.cc8 -// CHECK:STDOUT: %.loc148_5.4 => constants.%.921 +// CHECK:STDOUT: %.loc148_5.5 => constants.%.921 // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Op.72717c.8 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Op.72717c.8 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc148_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc148_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int64.Op.4dca31.1 @@ -3104,11 +3115,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.lookup_impl_witness.loc159 => constants.%custom_witness.a8f // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.91e // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.dd6 -// CHECK:STDOUT: %.loc159_5.4 => constants.%.26f +// CHECK:STDOUT: %.loc159_5.5 => constants.%.26f // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Op.72717c.9 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Op.72717c.9 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc159_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc159_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int64.Op.4dca31.1 @@ -3145,11 +3156,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.lookup_impl_witness.loc170 => constants.%custom_witness.972 // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.c38 // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.663 -// CHECK:STDOUT: %.loc170_5.4 => constants.%.ed0 +// CHECK:STDOUT: %.loc170_5.5 => constants.%.ed0 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Op.72717c.10 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Op.72717c.10 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc170_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc170_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int64.Op.4dca31.1 @@ -3186,11 +3197,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.lookup_impl_witness.loc126 => constants.%custom_witness.98f // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.3de // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.1c0 -// CHECK:STDOUT: %.loc126_5.4 => constants.%.df7 +// CHECK:STDOUT: %.loc126_5.5 => constants.%.df7 // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Op.72717c.11 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Op.72717c.11 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc126_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc126_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int64.Op.4dca31.1 @@ -3227,11 +3238,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.lookup_impl_witness.loc137 => constants.%custom_witness.5c3 // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.320 // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.8fd -// CHECK:STDOUT: %.loc137_5.4 => constants.%.ad9 +// CHECK:STDOUT: %.loc137_5.5 => constants.%.ad9 // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Op.72717c.12 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Op.72717c.12 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc137_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc137_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int64.Op.4dca31.1 @@ -3268,11 +3279,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.lookup_impl_witness.loc148 => constants.%custom_witness.ac0 // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.d72 // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.10e -// CHECK:STDOUT: %.loc148_5.4 => constants.%.be6 +// CHECK:STDOUT: %.loc148_5.5 => constants.%.be6 // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Op.72717c.13 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Op.72717c.13 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc148_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc148_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int64.Op.4dca31.1 @@ -3309,11 +3320,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.lookup_impl_witness.loc159 => constants.%custom_witness.c98 // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.4d9 // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.354 -// CHECK:STDOUT: %.loc159_5.4 => constants.%.436 +// CHECK:STDOUT: %.loc159_5.5 => constants.%.436 // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Op.72717c.14 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Op.72717c.14 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc159_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc159_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int64.Op.4dca31.1 @@ -3350,11 +3361,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.lookup_impl_witness.loc170 => constants.%custom_witness.e66 // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.ca3 // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.dcc -// CHECK:STDOUT: %.loc170_5.4 => constants.%.66e6 +// CHECK:STDOUT: %.loc170_5.5 => constants.%.66e6 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Op.72717c.15 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Op.72717c.15 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc170_5.5 => constants.%.c2e +// CHECK:STDOUT: %.loc170_5.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int64.Op.4dca31.1 @@ -3771,7 +3782,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.357 // CHECK:STDOUT: %Inc.WithSelf.Op.type => constants.%Inc.WithSelf.Op.type.d1d -// CHECK:STDOUT: %.loc280 => constants.%.176 +// CHECK:STDOUT: %.loc280_3.2 => constants.%.176 // CHECK:STDOUT: %Inc.lookup_impl_witness => constants.%custom_witness.f3f // CHECK:STDOUT: %impl.elem0.loc280_3.2 => constants.%Int32.Op.4dca31.18 // CHECK:STDOUT: %specific_impl_fn.loc280_3.2 => constants.%Int32.Op.4dca31.18 @@ -3785,7 +3796,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.357 // CHECK:STDOUT: %Dec.WithSelf.Op.type => constants.%Dec.WithSelf.Op.type.e55 -// CHECK:STDOUT: %.loc286 => constants.%.d09 +// CHECK:STDOUT: %.loc286_3.2 => constants.%.d09 // CHECK:STDOUT: %Dec.lookup_impl_witness => constants.%custom_witness.b24 // CHECK:STDOUT: %impl.elem0.loc286_3.2 => constants.%Int32.Op.4dca31.19 // CHECK:STDOUT: %specific_impl_fn.loc286_3.2 => constants.%Int32.Op.4dca31.19 @@ -3805,13 +3816,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %require_complete.loc294_11 => constants.%complete_type.357 // CHECK:STDOUT: %require_complete.loc294_22 => constants.%complete_type.357 // CHECK:STDOUT: %Negate.lookup_impl_witness => constants.%custom_witness.100 -// CHECK:STDOUT: %Negate.facet => constants.%Negate.facet.8f4 +// CHECK:STDOUT: %Negate.facet.loc296_3.2 => constants.%Negate.facet.8f4 // CHECK:STDOUT: %Negate.WithSelf.Op.type => constants.%Negate.WithSelf.Op.type.181 -// CHECK:STDOUT: %.loc296_3.3 => constants.%.66a +// CHECK:STDOUT: %.loc296_3.5 => constants.%.66a // CHECK:STDOUT: %impl.elem1.loc296_3.2 => constants.%Int16.Op.4dca31.18 // CHECK:STDOUT: %specific_impl_fn.loc296_3.3 => constants.%Int16.Op.4dca31.18 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc296_3.4 => constants.%.c2e +// CHECK:STDOUT: %.loc296_3.6 => constants.%.c2e // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 // CHECK:STDOUT: %impl.elem0.loc296_3.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc296_3.4 => constants.%Int64.Op.4dca31.1 @@ -3831,13 +3842,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %require_complete.loc294_11 => constants.%complete_type.357 // CHECK:STDOUT: %require_complete.loc294_22 => constants.%complete_type.357 // CHECK:STDOUT: %Negate.lookup_impl_witness => constants.%custom_witness.a85 -// CHECK:STDOUT: %Negate.facet => constants.%Negate.facet.aa9 +// CHECK:STDOUT: %Negate.facet.loc296_3.2 => constants.%Negate.facet.aa9 // CHECK:STDOUT: %Negate.WithSelf.Op.type => constants.%Negate.WithSelf.Op.type.050 -// CHECK:STDOUT: %.loc296_3.3 => constants.%.668 +// CHECK:STDOUT: %.loc296_3.5 => constants.%.668 // CHECK:STDOUT: %impl.elem1.loc296_3.2 => constants.%Int32.Op.4dca31.20 // CHECK:STDOUT: %specific_impl_fn.loc296_3.3 => constants.%Int32.Op.4dca31.20 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc296_3.4 => constants.%.043 +// CHECK:STDOUT: %.loc296_3.6 => constants.%.043 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 // CHECK:STDOUT: %impl.elem0.loc296_3.2 => constants.%Int32.Op.4dca31.1 // CHECK:STDOUT: %specific_impl_fn.loc296_3.4 => constants.%Int32.Op.4dca31.1 diff --git a/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon b/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon index eeea29032959..8e4d8a85a3fe 100644 --- a/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon @@ -100,8 +100,8 @@ struct NeqBoolish { // CHECK:STDERR: auto operator!=(NeqBoolish) const -> int; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:20:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: fn NotEqual[self: Self](other: Other) -> bool; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn NotEqual(self, other: Other) -> bool; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ auto operator!=(NeqBoolish) const -> int; }; @@ -131,8 +131,8 @@ struct BothBoolish { // CHECK:STDERR: auto operator==(EqBoolish) const -> int*; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:19:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn Equal[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Equal(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+30]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -144,8 +144,8 @@ struct BothBoolish { // CHECK:STDERR: auto operator==(BothBoolish) const -> Result; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:19:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn Equal[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Equal(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -157,8 +157,8 @@ struct BothBoolish { // CHECK:STDERR: auto operator!=(BothBoolish) const -> Result; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:20:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn NotEqual[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn NotEqual(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+4]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon b/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon index 21a19e89ad7c..83ceb071af0d 100644 --- a/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon @@ -125,8 +125,8 @@ struct LessReturnsBoolish { // CHECK:STDERR: auto operator<(LessReturnsBoolish) const -> int; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:26:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: fn Less[self: Self](other: Other) -> bool; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Less(self, other: Other) -> bool; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ auto operator<(LessReturnsBoolish) const -> int; auto operator<=(LessReturnsBoolish) const -> bool; auto operator>(LessReturnsBoolish) const -> bool; @@ -178,8 +178,8 @@ struct AllReturnBoolish { // CHECK:STDERR: auto operator<=(LessEqualReturnsBoolish) const -> int*; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:27:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn LessOrEquivalent[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn LessOrEquivalent(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+69]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -191,8 +191,8 @@ struct AllReturnBoolish { // CHECK:STDERR: auto operator>=(GreaterEqualReturnsBoolish) const -> Result; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn GreaterOrEquivalent[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn GreaterOrEquivalent(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+56]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -204,8 +204,8 @@ struct AllReturnBoolish { // CHECK:STDERR: auto operator<(AllReturnBoolish) const -> double; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:26:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn Less[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Less(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -217,8 +217,8 @@ struct AllReturnBoolish { // CHECK:STDERR: auto operator<=(AllReturnBoolish) const -> double; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:27:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn LessOrEquivalent[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn LessOrEquivalent(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+30]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -230,8 +230,8 @@ struct AllReturnBoolish { // CHECK:STDERR: auto operator>(AllReturnBoolish) const -> double; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn Greater[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Greater(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -243,8 +243,8 @@ struct AllReturnBoolish { // CHECK:STDERR: auto operator>=(AllReturnBoolish) const -> double; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3: note: while building thunk to match the signature of this function [ThunkSignature] -// CHECK:STDERR: fn GreaterOrEquivalent[self: Self](other: Other) -> bool; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn GreaterOrEquivalent(self, other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+4]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon index 30ebb366581f..9d520a02f31c 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon @@ -683,6 +683,7 @@ fn CopyUnsignedLong() { //@dump-sem-ir-end } + // CHECK:STDOUT: --- long_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2216,10 +2217,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc10: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem0.loc10_5: %.a04 = impl_witness_access constants.%EqWith.impl_witness.95d, element0 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.f0911b.2] // CHECK:STDOUT: %bound_method.loc10_5.1: = bound_method %b.ref.loc10, %impl.elem0.loc10_5 +// CHECK:STDOUT: %ImplicitAs.facet.loc10: %ImplicitAs.type.7eb = facet_value constants.%i32, (constants.%ImplicitAs.impl_witness.f82) [concrete = constants.%ImplicitAs.facet.ce4] +// CHECK:STDOUT: %.loc10_5.1: %ImplicitAs.type.7eb = converted constants.%i32, %ImplicitAs.facet.loc10 [concrete = constants.%ImplicitAs.facet.ce4] // CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10_5, @T.as_type.as.EqWith.impl.Equal.1(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.specific_fn.873bd0.1] // CHECK:STDOUT: %bound_method.loc10_5.2: = bound_method %b.ref.loc10, %specific_fn.loc10 -// CHECK:STDOUT: %.loc10_5: %T.as_type.as.EqWith.impl.Equal.type.e779ca.1 = specific_constant imports.%Core.Equal.d4c, @T.as_type.as.EqWith.impl.673(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.f0911b.1] -// CHECK:STDOUT: %Equal.ref.loc10: %T.as_type.as.EqWith.impl.Equal.type.e779ca.1 = name_ref Equal, %.loc10_5 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.f0911b.1] +// CHECK:STDOUT: %.loc10_5.2: %T.as_type.as.EqWith.impl.Equal.type.e779ca.1 = specific_constant imports.%Core.Equal.d4c, @T.as_type.as.EqWith.impl.673(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.f0911b.1] +// CHECK:STDOUT: %Equal.ref.loc10: %T.as_type.as.EqWith.impl.Equal.type.e779ca.1 = name_ref Equal, %.loc10_5.2 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.f0911b.1] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.Equal.bound.loc10: = bound_method %b.ref.loc10, %Equal.ref.loc10 // CHECK:STDOUT: %T.as_type.as.EqWith.impl.Equal.specific_fn.loc10: = specific_function %Equal.ref.loc10, @T.as_type.as.EqWith.impl.Equal.2(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.specific_fn.873bd0.2] // CHECK:STDOUT: %bound_method.loc10_5.3: = bound_method %b.ref.loc10, %T.as_type.as.EqWith.impl.Equal.specific_fn.loc10 @@ -2233,10 +2236,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc11: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem1.loc11: %.4a6 = impl_witness_access constants.%EqWith.impl_witness.95d, element1 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.3d3117.2] // CHECK:STDOUT: %bound_method.loc11_5.1: = bound_method %b.ref.loc11, %impl.elem1.loc11 +// CHECK:STDOUT: %ImplicitAs.facet.loc11: %ImplicitAs.type.7eb = facet_value constants.%i32, (constants.%ImplicitAs.impl_witness.f82) [concrete = constants.%ImplicitAs.facet.ce4] +// CHECK:STDOUT: %.loc11_5.1: %ImplicitAs.type.7eb = converted constants.%i32, %ImplicitAs.facet.loc11 [concrete = constants.%ImplicitAs.facet.ce4] // CHECK:STDOUT: %specific_fn.loc11: = specific_function %impl.elem1.loc11, @T.as_type.as.EqWith.impl.NotEqual.1(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.specific_fn.fae6fc.1] // CHECK:STDOUT: %bound_method.loc11_5.2: = bound_method %b.ref.loc11, %specific_fn.loc11 -// CHECK:STDOUT: %.loc11_5: %T.as_type.as.EqWith.impl.NotEqual.type.3aca6f.1 = specific_constant imports.%Core.NotEqual.d11, @T.as_type.as.EqWith.impl.673(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.3d3117.1] -// CHECK:STDOUT: %NotEqual.ref.loc11: %T.as_type.as.EqWith.impl.NotEqual.type.3aca6f.1 = name_ref NotEqual, %.loc11_5 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.3d3117.1] +// CHECK:STDOUT: %.loc11_5.2: %T.as_type.as.EqWith.impl.NotEqual.type.3aca6f.1 = specific_constant imports.%Core.NotEqual.d11, @T.as_type.as.EqWith.impl.673(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.3d3117.1] +// CHECK:STDOUT: %NotEqual.ref.loc11: %T.as_type.as.EqWith.impl.NotEqual.type.3aca6f.1 = name_ref NotEqual, %.loc11_5.2 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.3d3117.1] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.NotEqual.bound.loc11: = bound_method %b.ref.loc11, %NotEqual.ref.loc11 // CHECK:STDOUT: %T.as_type.as.EqWith.impl.NotEqual.specific_fn.loc11: = specific_function %NotEqual.ref.loc11, @T.as_type.as.EqWith.impl.NotEqual.2(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.specific_fn.fae6fc.2] // CHECK:STDOUT: %bound_method.loc11_5.3: = bound_method %b.ref.loc11, %T.as_type.as.EqWith.impl.NotEqual.specific_fn.loc11 @@ -2250,10 +2255,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc12: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem2.loc12: %.871 = impl_witness_access constants.%OrderedWith.impl_witness.029, element2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.dcaa48.2] // CHECK:STDOUT: %bound_method.loc12_5.1: = bound_method %b.ref.loc12, %impl.elem2.loc12 +// CHECK:STDOUT: %ImplicitAs.facet.loc12: %ImplicitAs.type.7eb = facet_value constants.%i32, (constants.%ImplicitAs.impl_witness.f82) [concrete = constants.%ImplicitAs.facet.ce4] +// CHECK:STDOUT: %.loc12_5.1: %ImplicitAs.type.7eb = converted constants.%i32, %ImplicitAs.facet.loc12 [concrete = constants.%ImplicitAs.facet.ce4] // CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem2.loc12, @T.as_type.as.OrderedWith.impl.Greater.1(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.specific_fn.052d08.1] // CHECK:STDOUT: %bound_method.loc12_5.2: = bound_method %b.ref.loc12, %specific_fn.loc12 -// CHECK:STDOUT: %.loc12_5: %T.as_type.as.OrderedWith.impl.Greater.type.5d146f.1 = specific_constant imports.%Core.Greater.0b3, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.dcaa48.1] -// CHECK:STDOUT: %Greater.ref.loc12: %T.as_type.as.OrderedWith.impl.Greater.type.5d146f.1 = name_ref Greater, %.loc12_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.dcaa48.1] +// CHECK:STDOUT: %.loc12_5.2: %T.as_type.as.OrderedWith.impl.Greater.type.5d146f.1 = specific_constant imports.%Core.Greater.0b3, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.dcaa48.1] +// CHECK:STDOUT: %Greater.ref.loc12: %T.as_type.as.OrderedWith.impl.Greater.type.5d146f.1 = name_ref Greater, %.loc12_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.dcaa48.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Greater.bound.loc12: = bound_method %b.ref.loc12, %Greater.ref.loc12 // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Greater.specific_fn.loc12: = specific_function %Greater.ref.loc12, @T.as_type.as.OrderedWith.impl.Greater.2(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.specific_fn.052d08.2] // CHECK:STDOUT: %bound_method.loc12_5.3: = bound_method %b.ref.loc12, %T.as_type.as.OrderedWith.impl.Greater.specific_fn.loc12 @@ -2267,10 +2274,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc13: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem0.loc13_5: %.68c = impl_witness_access constants.%OrderedWith.impl_witness.029, element0 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.3e6ac0.2] // CHECK:STDOUT: %bound_method.loc13_5.1: = bound_method %b.ref.loc13, %impl.elem0.loc13_5 +// CHECK:STDOUT: %ImplicitAs.facet.loc13: %ImplicitAs.type.7eb = facet_value constants.%i32, (constants.%ImplicitAs.impl_witness.f82) [concrete = constants.%ImplicitAs.facet.ce4] +// CHECK:STDOUT: %.loc13_5.1: %ImplicitAs.type.7eb = converted constants.%i32, %ImplicitAs.facet.loc13 [concrete = constants.%ImplicitAs.facet.ce4] // CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13_5, @T.as_type.as.OrderedWith.impl.Less.1(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.specific_fn.d4058b.1] // CHECK:STDOUT: %bound_method.loc13_5.2: = bound_method %b.ref.loc13, %specific_fn.loc13 -// CHECK:STDOUT: %.loc13_5: %T.as_type.as.OrderedWith.impl.Less.type.e5a0d6.1 = specific_constant imports.%Core.Less.2f9, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.3e6ac0.1] -// CHECK:STDOUT: %Less.ref.loc13: %T.as_type.as.OrderedWith.impl.Less.type.e5a0d6.1 = name_ref Less, %.loc13_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.3e6ac0.1] +// CHECK:STDOUT: %.loc13_5.2: %T.as_type.as.OrderedWith.impl.Less.type.e5a0d6.1 = specific_constant imports.%Core.Less.2f9, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.3e6ac0.1] +// CHECK:STDOUT: %Less.ref.loc13: %T.as_type.as.OrderedWith.impl.Less.type.e5a0d6.1 = name_ref Less, %.loc13_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.3e6ac0.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Less.bound.loc13: = bound_method %b.ref.loc13, %Less.ref.loc13 // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Less.specific_fn.loc13: = specific_function %Less.ref.loc13, @T.as_type.as.OrderedWith.impl.Less.2(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.specific_fn.d4058b.2] // CHECK:STDOUT: %bound_method.loc13_5.3: = bound_method %b.ref.loc13, %T.as_type.as.OrderedWith.impl.Less.specific_fn.loc13 @@ -2284,10 +2293,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc14: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem3.loc14: %.7c0 = impl_witness_access constants.%OrderedWith.impl_witness.029, element3 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.e6f558.2] // CHECK:STDOUT: %bound_method.loc14_5.1: = bound_method %b.ref.loc14, %impl.elem3.loc14 +// CHECK:STDOUT: %ImplicitAs.facet.loc14: %ImplicitAs.type.7eb = facet_value constants.%i32, (constants.%ImplicitAs.impl_witness.f82) [concrete = constants.%ImplicitAs.facet.ce4] +// CHECK:STDOUT: %.loc14_5.1: %ImplicitAs.type.7eb = converted constants.%i32, %ImplicitAs.facet.loc14 [concrete = constants.%ImplicitAs.facet.ce4] // CHECK:STDOUT: %specific_fn.loc14: = specific_function %impl.elem3.loc14, @T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.1(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.a37dff.1] // CHECK:STDOUT: %bound_method.loc14_5.2: = bound_method %b.ref.loc14, %specific_fn.loc14 -// CHECK:STDOUT: %.loc14_5: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.e46d69.1 = specific_constant imports.%Core.GreaterOrEquivalent.e06, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.e6f558.1] -// CHECK:STDOUT: %GreaterOrEquivalent.ref.loc14: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.e46d69.1 = name_ref GreaterOrEquivalent, %.loc14_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.e6f558.1] +// CHECK:STDOUT: %.loc14_5.2: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.e46d69.1 = specific_constant imports.%Core.GreaterOrEquivalent.e06, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.e6f558.1] +// CHECK:STDOUT: %GreaterOrEquivalent.ref.loc14: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.e46d69.1 = name_ref GreaterOrEquivalent, %.loc14_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.e6f558.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.bound.loc14: = bound_method %b.ref.loc14, %GreaterOrEquivalent.ref.loc14 // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.loc14: = specific_function %GreaterOrEquivalent.ref.loc14, @T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.2(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.a37dff.2] // CHECK:STDOUT: %bound_method.loc14_5.3: = bound_method %b.ref.loc14, %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.loc14 @@ -2301,10 +2312,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc15: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem1.loc15: %.a3d = impl_witness_access constants.%OrderedWith.impl_witness.029, element1 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b51928.2] // CHECK:STDOUT: %bound_method.loc15_5.1: = bound_method %b.ref.loc15, %impl.elem1.loc15 +// CHECK:STDOUT: %ImplicitAs.facet.loc15: %ImplicitAs.type.7eb = facet_value constants.%i32, (constants.%ImplicitAs.impl_witness.f82) [concrete = constants.%ImplicitAs.facet.ce4] +// CHECK:STDOUT: %.loc15_5.1: %ImplicitAs.type.7eb = converted constants.%i32, %ImplicitAs.facet.loc15 [concrete = constants.%ImplicitAs.facet.ce4] // CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem1.loc15, @T.as_type.as.OrderedWith.impl.LessOrEquivalent.1(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.ad853c.1] // CHECK:STDOUT: %bound_method.loc15_5.2: = bound_method %b.ref.loc15, %specific_fn.loc15 -// CHECK:STDOUT: %.loc15_5: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.be0eb0.1 = specific_constant imports.%Core.LessOrEquivalent.27e, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b51928.1] -// CHECK:STDOUT: %LessOrEquivalent.ref.loc15: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.be0eb0.1 = name_ref LessOrEquivalent, %.loc15_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b51928.1] +// CHECK:STDOUT: %.loc15_5.2: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.be0eb0.1 = specific_constant imports.%Core.LessOrEquivalent.27e, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b51928.1] +// CHECK:STDOUT: %LessOrEquivalent.ref.loc15: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.be0eb0.1 = name_ref LessOrEquivalent, %.loc15_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b51928.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.bound.loc15: = bound_method %b.ref.loc15, %LessOrEquivalent.ref.loc15 // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.loc15: = specific_function %LessOrEquivalent.ref.loc15, @T.as_type.as.OrderedWith.impl.LessOrEquivalent.2(constants.%ImplicitAs.facet.ce4) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.ad853c.2] // CHECK:STDOUT: %bound_method.loc15_5.3: = bound_method %b.ref.loc15, %T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.loc15 @@ -2318,10 +2331,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc17: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem0.loc17_5: %.651 = impl_witness_access constants.%EqWith.impl_witness.772, element0 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.4e32c9.2] // CHECK:STDOUT: %bound_method.loc17_5.1: = bound_method %int_1.loc17, %impl.elem0.loc17_5 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.bound.1038cb.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc17: %ImplicitAs.type.7eb = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.e27) [concrete = constants.%ImplicitAs.facet.b30] +// CHECK:STDOUT: %.loc17_5.1: %ImplicitAs.type.7eb = converted Core.IntLiteral, %ImplicitAs.facet.loc17 [concrete = constants.%ImplicitAs.facet.b30] // CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17_5, @T.as_type.as.EqWith.impl.Equal.1(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.specific_fn.2002e1.1] // CHECK:STDOUT: %bound_method.loc17_5.2: = bound_method %int_1.loc17, %specific_fn.loc17 [concrete = constants.%bound_method.5ea17a.1] -// CHECK:STDOUT: %.loc17_5: %T.as_type.as.EqWith.impl.Equal.type.f5ab79.1 = specific_constant imports.%Core.Equal.d4c, @T.as_type.as.EqWith.impl.673(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.4e32c9.1] -// CHECK:STDOUT: %Equal.ref.loc17: %T.as_type.as.EqWith.impl.Equal.type.f5ab79.1 = name_ref Equal, %.loc17_5 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.4e32c9.1] +// CHECK:STDOUT: %.loc17_5.2: %T.as_type.as.EqWith.impl.Equal.type.f5ab79.1 = specific_constant imports.%Core.Equal.d4c, @T.as_type.as.EqWith.impl.673(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.4e32c9.1] +// CHECK:STDOUT: %Equal.ref.loc17: %T.as_type.as.EqWith.impl.Equal.type.f5ab79.1 = name_ref Equal, %.loc17_5.2 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.4e32c9.1] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.Equal.bound.loc17: = bound_method %int_1.loc17, %Equal.ref.loc17 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.bound.1038cb.2] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.Equal.specific_fn.loc17: = specific_function %Equal.ref.loc17, @T.as_type.as.EqWith.impl.Equal.2(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.specific_fn.2002e1.2] // CHECK:STDOUT: %bound_method.loc17_5.3: = bound_method %int_1.loc17, %T.as_type.as.EqWith.impl.Equal.specific_fn.loc17 [concrete = constants.%bound_method.5ea17a.2] @@ -2335,10 +2350,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc18: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem1.loc18: %.830 = impl_witness_access constants.%EqWith.impl_witness.772, element1 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.7e38ae.2] // CHECK:STDOUT: %bound_method.loc18_5.1: = bound_method %int_1.loc18, %impl.elem1.loc18 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.bound.750155.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc18: %ImplicitAs.type.7eb = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.e27) [concrete = constants.%ImplicitAs.facet.b30] +// CHECK:STDOUT: %.loc18_5.1: %ImplicitAs.type.7eb = converted Core.IntLiteral, %ImplicitAs.facet.loc18 [concrete = constants.%ImplicitAs.facet.b30] // CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem1.loc18, @T.as_type.as.EqWith.impl.NotEqual.1(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.specific_fn.cb3ce7.1] // CHECK:STDOUT: %bound_method.loc18_5.2: = bound_method %int_1.loc18, %specific_fn.loc18 [concrete = constants.%bound_method.c6610c.1] -// CHECK:STDOUT: %.loc18_5: %T.as_type.as.EqWith.impl.NotEqual.type.f0c8ea.1 = specific_constant imports.%Core.NotEqual.d11, @T.as_type.as.EqWith.impl.673(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.7e38ae.1] -// CHECK:STDOUT: %NotEqual.ref.loc18: %T.as_type.as.EqWith.impl.NotEqual.type.f0c8ea.1 = name_ref NotEqual, %.loc18_5 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.7e38ae.1] +// CHECK:STDOUT: %.loc18_5.2: %T.as_type.as.EqWith.impl.NotEqual.type.f0c8ea.1 = specific_constant imports.%Core.NotEqual.d11, @T.as_type.as.EqWith.impl.673(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.7e38ae.1] +// CHECK:STDOUT: %NotEqual.ref.loc18: %T.as_type.as.EqWith.impl.NotEqual.type.f0c8ea.1 = name_ref NotEqual, %.loc18_5.2 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.7e38ae.1] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.NotEqual.bound.loc18: = bound_method %int_1.loc18, %NotEqual.ref.loc18 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.bound.750155.2] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.NotEqual.specific_fn.loc18: = specific_function %NotEqual.ref.loc18, @T.as_type.as.EqWith.impl.NotEqual.2(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.specific_fn.cb3ce7.2] // CHECK:STDOUT: %bound_method.loc18_5.3: = bound_method %int_1.loc18, %T.as_type.as.EqWith.impl.NotEqual.specific_fn.loc18 [concrete = constants.%bound_method.c6610c.2] @@ -2352,10 +2369,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc19: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem2.loc19: %.48e = impl_witness_access constants.%OrderedWith.impl_witness.8ce, element2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.3f6fcf.2] // CHECK:STDOUT: %bound_method.loc19_5.1: = bound_method %int_1.loc19, %impl.elem2.loc19 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.bound.b05e6b.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc19: %ImplicitAs.type.7eb = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.e27) [concrete = constants.%ImplicitAs.facet.b30] +// CHECK:STDOUT: %.loc19_5.1: %ImplicitAs.type.7eb = converted Core.IntLiteral, %ImplicitAs.facet.loc19 [concrete = constants.%ImplicitAs.facet.b30] // CHECK:STDOUT: %specific_fn.loc19: = specific_function %impl.elem2.loc19, @T.as_type.as.OrderedWith.impl.Greater.1(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.specific_fn.b46b59.1] // CHECK:STDOUT: %bound_method.loc19_5.2: = bound_method %int_1.loc19, %specific_fn.loc19 [concrete = constants.%bound_method.84b063.1] -// CHECK:STDOUT: %.loc19_5: %T.as_type.as.OrderedWith.impl.Greater.type.dc545b.1 = specific_constant imports.%Core.Greater.0b3, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.3f6fcf.1] -// CHECK:STDOUT: %Greater.ref.loc19: %T.as_type.as.OrderedWith.impl.Greater.type.dc545b.1 = name_ref Greater, %.loc19_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.3f6fcf.1] +// CHECK:STDOUT: %.loc19_5.2: %T.as_type.as.OrderedWith.impl.Greater.type.dc545b.1 = specific_constant imports.%Core.Greater.0b3, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.3f6fcf.1] +// CHECK:STDOUT: %Greater.ref.loc19: %T.as_type.as.OrderedWith.impl.Greater.type.dc545b.1 = name_ref Greater, %.loc19_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.3f6fcf.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Greater.bound.loc19: = bound_method %int_1.loc19, %Greater.ref.loc19 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.bound.b05e6b.2] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Greater.specific_fn.loc19: = specific_function %Greater.ref.loc19, @T.as_type.as.OrderedWith.impl.Greater.2(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.specific_fn.b46b59.2] // CHECK:STDOUT: %bound_method.loc19_5.3: = bound_method %int_1.loc19, %T.as_type.as.OrderedWith.impl.Greater.specific_fn.loc19 [concrete = constants.%bound_method.84b063.2] @@ -2369,10 +2388,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc20: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem0.loc20_5: %.138 = impl_witness_access constants.%OrderedWith.impl_witness.8ce, element0 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.0804e2.2] // CHECK:STDOUT: %bound_method.loc20_5.1: = bound_method %int_1.loc20, %impl.elem0.loc20_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.bound.c0d522.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc20: %ImplicitAs.type.7eb = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.e27) [concrete = constants.%ImplicitAs.facet.b30] +// CHECK:STDOUT: %.loc20_5.1: %ImplicitAs.type.7eb = converted Core.IntLiteral, %ImplicitAs.facet.loc20 [concrete = constants.%ImplicitAs.facet.b30] // CHECK:STDOUT: %specific_fn.loc20: = specific_function %impl.elem0.loc20_5, @T.as_type.as.OrderedWith.impl.Less.1(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.specific_fn.6ba13f.1] // CHECK:STDOUT: %bound_method.loc20_5.2: = bound_method %int_1.loc20, %specific_fn.loc20 [concrete = constants.%bound_method.a4c927.1] -// CHECK:STDOUT: %.loc20_5: %T.as_type.as.OrderedWith.impl.Less.type.ea162e.1 = specific_constant imports.%Core.Less.2f9, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.0804e2.1] -// CHECK:STDOUT: %Less.ref.loc20: %T.as_type.as.OrderedWith.impl.Less.type.ea162e.1 = name_ref Less, %.loc20_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.0804e2.1] +// CHECK:STDOUT: %.loc20_5.2: %T.as_type.as.OrderedWith.impl.Less.type.ea162e.1 = specific_constant imports.%Core.Less.2f9, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.0804e2.1] +// CHECK:STDOUT: %Less.ref.loc20: %T.as_type.as.OrderedWith.impl.Less.type.ea162e.1 = name_ref Less, %.loc20_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.0804e2.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Less.bound.loc20: = bound_method %int_1.loc20, %Less.ref.loc20 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.bound.c0d522.2] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Less.specific_fn.loc20: = specific_function %Less.ref.loc20, @T.as_type.as.OrderedWith.impl.Less.2(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.specific_fn.6ba13f.2] // CHECK:STDOUT: %bound_method.loc20_5.3: = bound_method %int_1.loc20, %T.as_type.as.OrderedWith.impl.Less.specific_fn.loc20 [concrete = constants.%bound_method.a4c927.2] @@ -2386,10 +2407,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc21: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem3.loc21: %.5fe = impl_witness_access constants.%OrderedWith.impl_witness.8ce, element3 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.d37e1c.2] // CHECK:STDOUT: %bound_method.loc21_5.1: = bound_method %int_1.loc21, %impl.elem3.loc21 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.bound.af5bde.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc21: %ImplicitAs.type.7eb = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.e27) [concrete = constants.%ImplicitAs.facet.b30] +// CHECK:STDOUT: %.loc21_5.1: %ImplicitAs.type.7eb = converted Core.IntLiteral, %ImplicitAs.facet.loc21 [concrete = constants.%ImplicitAs.facet.b30] // CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem3.loc21, @T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.1(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.8d07ea.1] // CHECK:STDOUT: %bound_method.loc21_5.2: = bound_method %int_1.loc21, %specific_fn.loc21 [concrete = constants.%bound_method.d2ea71.1] -// CHECK:STDOUT: %.loc21_5: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.1ebc13.1 = specific_constant imports.%Core.GreaterOrEquivalent.e06, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.d37e1c.1] -// CHECK:STDOUT: %GreaterOrEquivalent.ref.loc21: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.1ebc13.1 = name_ref GreaterOrEquivalent, %.loc21_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.d37e1c.1] +// CHECK:STDOUT: %.loc21_5.2: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.1ebc13.1 = specific_constant imports.%Core.GreaterOrEquivalent.e06, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.d37e1c.1] +// CHECK:STDOUT: %GreaterOrEquivalent.ref.loc21: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.1ebc13.1 = name_ref GreaterOrEquivalent, %.loc21_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.d37e1c.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.bound.loc21: = bound_method %int_1.loc21, %GreaterOrEquivalent.ref.loc21 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.bound.af5bde.2] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.loc21: = specific_function %GreaterOrEquivalent.ref.loc21, @T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.2(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.8d07ea.2] // CHECK:STDOUT: %bound_method.loc21_5.3: = bound_method %int_1.loc21, %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.loc21 [concrete = constants.%bound_method.d2ea71.2] @@ -2403,10 +2426,12 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.ref.loc22: %Cpp.long = name_ref a, %a // CHECK:STDOUT: %impl.elem1.loc22: %.9c3 = impl_witness_access constants.%OrderedWith.impl_witness.8ce, element1 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.6b9921.2] // CHECK:STDOUT: %bound_method.loc22_5.1: = bound_method %int_1.loc22, %impl.elem1.loc22 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.bound.1f479f.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc22: %ImplicitAs.type.7eb = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.e27) [concrete = constants.%ImplicitAs.facet.b30] +// CHECK:STDOUT: %.loc22_5.1: %ImplicitAs.type.7eb = converted Core.IntLiteral, %ImplicitAs.facet.loc22 [concrete = constants.%ImplicitAs.facet.b30] // CHECK:STDOUT: %specific_fn.loc22: = specific_function %impl.elem1.loc22, @T.as_type.as.OrderedWith.impl.LessOrEquivalent.1(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.9ed43e.1] // CHECK:STDOUT: %bound_method.loc22_5.2: = bound_method %int_1.loc22, %specific_fn.loc22 [concrete = constants.%bound_method.ce4a7e.1] -// CHECK:STDOUT: %.loc22_5: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.b869b8.1 = specific_constant imports.%Core.LessOrEquivalent.27e, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.6b9921.1] -// CHECK:STDOUT: %LessOrEquivalent.ref.loc22: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.b869b8.1 = name_ref LessOrEquivalent, %.loc22_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.6b9921.1] +// CHECK:STDOUT: %.loc22_5.2: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.b869b8.1 = specific_constant imports.%Core.LessOrEquivalent.27e, @T.as_type.as.OrderedWith.impl.821(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.6b9921.1] +// CHECK:STDOUT: %LessOrEquivalent.ref.loc22: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.b869b8.1 = name_ref LessOrEquivalent, %.loc22_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.6b9921.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.bound.loc22: = bound_method %int_1.loc22, %LessOrEquivalent.ref.loc22 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.bound.1f479f.2] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.loc22: = specific_function %LessOrEquivalent.ref.loc22, @T.as_type.as.OrderedWith.impl.LessOrEquivalent.2(constants.%ImplicitAs.facet.b30) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.9ed43e.2] // CHECK:STDOUT: %bound_method.loc22_5.3: = bound_method %int_1.loc22, %T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.loc22 [concrete = constants.%bound_method.ce4a7e.2] diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon index c578df931007..147e3693b689 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon @@ -631,6 +631,7 @@ fn CopyUnsignedLongLong() { //@dump-sem-ir-end } + // CHECK:STDOUT: --- long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2142,10 +2143,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc10: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem0.loc10_5: %.183 = impl_witness_access constants.%EqWith.impl_witness.084, element0 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.817082.2] // CHECK:STDOUT: %bound_method.loc10_5.1: = bound_method %b.ref.loc10, %impl.elem0.loc10_5 +// CHECK:STDOUT: %ImplicitAs.facet.loc10: %ImplicitAs.type.0ec = facet_value constants.%i64, (constants.%ImplicitAs.impl_witness.305) [concrete = constants.%ImplicitAs.facet.7a4] +// CHECK:STDOUT: %.loc10_5.1: %ImplicitAs.type.0ec = converted constants.%i64, %ImplicitAs.facet.loc10 [concrete = constants.%ImplicitAs.facet.7a4] // CHECK:STDOUT: %specific_fn.loc10: = specific_function %impl.elem0.loc10_5, @T.as_type.as.EqWith.impl.Equal.3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.specific_fn.044d32.1] // CHECK:STDOUT: %bound_method.loc10_5.2: = bound_method %b.ref.loc10, %specific_fn.loc10 -// CHECK:STDOUT: %.loc10_5: %T.as_type.as.EqWith.impl.Equal.type.6d33d6.1 = specific_constant imports.%Core.Equal.4f5, @T.as_type.as.EqWith.impl.6d3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.817082.1] -// CHECK:STDOUT: %Equal.ref.loc10: %T.as_type.as.EqWith.impl.Equal.type.6d33d6.1 = name_ref Equal, %.loc10_5 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.817082.1] +// CHECK:STDOUT: %.loc10_5.2: %T.as_type.as.EqWith.impl.Equal.type.6d33d6.1 = specific_constant imports.%Core.Equal.4f5, @T.as_type.as.EqWith.impl.6d3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.817082.1] +// CHECK:STDOUT: %Equal.ref.loc10: %T.as_type.as.EqWith.impl.Equal.type.6d33d6.1 = name_ref Equal, %.loc10_5.2 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.817082.1] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.Equal.bound.loc10: = bound_method %b.ref.loc10, %Equal.ref.loc10 // CHECK:STDOUT: %T.as_type.as.EqWith.impl.Equal.specific_fn.loc10: = specific_function %Equal.ref.loc10, @T.as_type.as.EqWith.impl.Equal.4(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.specific_fn.044d32.2] // CHECK:STDOUT: %bound_method.loc10_5.3: = bound_method %b.ref.loc10, %T.as_type.as.EqWith.impl.Equal.specific_fn.loc10 @@ -2159,10 +2162,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc11: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem1.loc11: %.eca = impl_witness_access constants.%EqWith.impl_witness.084, element1 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.de7c60.2] // CHECK:STDOUT: %bound_method.loc11_5.1: = bound_method %b.ref.loc11, %impl.elem1.loc11 +// CHECK:STDOUT: %ImplicitAs.facet.loc11: %ImplicitAs.type.0ec = facet_value constants.%i64, (constants.%ImplicitAs.impl_witness.305) [concrete = constants.%ImplicitAs.facet.7a4] +// CHECK:STDOUT: %.loc11_5.1: %ImplicitAs.type.0ec = converted constants.%i64, %ImplicitAs.facet.loc11 [concrete = constants.%ImplicitAs.facet.7a4] // CHECK:STDOUT: %specific_fn.loc11: = specific_function %impl.elem1.loc11, @T.as_type.as.EqWith.impl.NotEqual.3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.specific_fn.b44c79.1] // CHECK:STDOUT: %bound_method.loc11_5.2: = bound_method %b.ref.loc11, %specific_fn.loc11 -// CHECK:STDOUT: %.loc11_5: %T.as_type.as.EqWith.impl.NotEqual.type.2c42f8.1 = specific_constant imports.%Core.NotEqual.0b2, @T.as_type.as.EqWith.impl.6d3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.de7c60.1] -// CHECK:STDOUT: %NotEqual.ref.loc11: %T.as_type.as.EqWith.impl.NotEqual.type.2c42f8.1 = name_ref NotEqual, %.loc11_5 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.de7c60.1] +// CHECK:STDOUT: %.loc11_5.2: %T.as_type.as.EqWith.impl.NotEqual.type.2c42f8.1 = specific_constant imports.%Core.NotEqual.0b2, @T.as_type.as.EqWith.impl.6d3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.de7c60.1] +// CHECK:STDOUT: %NotEqual.ref.loc11: %T.as_type.as.EqWith.impl.NotEqual.type.2c42f8.1 = name_ref NotEqual, %.loc11_5.2 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.de7c60.1] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.NotEqual.bound.loc11: = bound_method %b.ref.loc11, %NotEqual.ref.loc11 // CHECK:STDOUT: %T.as_type.as.EqWith.impl.NotEqual.specific_fn.loc11: = specific_function %NotEqual.ref.loc11, @T.as_type.as.EqWith.impl.NotEqual.4(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.specific_fn.b44c79.2] // CHECK:STDOUT: %bound_method.loc11_5.3: = bound_method %b.ref.loc11, %T.as_type.as.EqWith.impl.NotEqual.specific_fn.loc11 @@ -2176,10 +2181,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc12: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem2.loc12: %.af0 = impl_witness_access constants.%OrderedWith.impl_witness.7e3, element2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.749015.2] // CHECK:STDOUT: %bound_method.loc12_5.1: = bound_method %b.ref.loc12, %impl.elem2.loc12 +// CHECK:STDOUT: %ImplicitAs.facet.loc12: %ImplicitAs.type.0ec = facet_value constants.%i64, (constants.%ImplicitAs.impl_witness.305) [concrete = constants.%ImplicitAs.facet.7a4] +// CHECK:STDOUT: %.loc12_5.1: %ImplicitAs.type.0ec = converted constants.%i64, %ImplicitAs.facet.loc12 [concrete = constants.%ImplicitAs.facet.7a4] // CHECK:STDOUT: %specific_fn.loc12: = specific_function %impl.elem2.loc12, @T.as_type.as.OrderedWith.impl.Greater.3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.specific_fn.cbc6c2.1] // CHECK:STDOUT: %bound_method.loc12_5.2: = bound_method %b.ref.loc12, %specific_fn.loc12 -// CHECK:STDOUT: %.loc12_5: %T.as_type.as.OrderedWith.impl.Greater.type.085dd9.1 = specific_constant imports.%Core.Greater.c24, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.749015.1] -// CHECK:STDOUT: %Greater.ref.loc12: %T.as_type.as.OrderedWith.impl.Greater.type.085dd9.1 = name_ref Greater, %.loc12_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.749015.1] +// CHECK:STDOUT: %.loc12_5.2: %T.as_type.as.OrderedWith.impl.Greater.type.085dd9.1 = specific_constant imports.%Core.Greater.c24, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.749015.1] +// CHECK:STDOUT: %Greater.ref.loc12: %T.as_type.as.OrderedWith.impl.Greater.type.085dd9.1 = name_ref Greater, %.loc12_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.749015.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Greater.bound.loc12: = bound_method %b.ref.loc12, %Greater.ref.loc12 // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Greater.specific_fn.loc12: = specific_function %Greater.ref.loc12, @T.as_type.as.OrderedWith.impl.Greater.4(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.specific_fn.cbc6c2.2] // CHECK:STDOUT: %bound_method.loc12_5.3: = bound_method %b.ref.loc12, %T.as_type.as.OrderedWith.impl.Greater.specific_fn.loc12 @@ -2193,10 +2200,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc13: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem0.loc13_5: %.901 = impl_witness_access constants.%OrderedWith.impl_witness.7e3, element0 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.c5f236.2] // CHECK:STDOUT: %bound_method.loc13_5.1: = bound_method %b.ref.loc13, %impl.elem0.loc13_5 +// CHECK:STDOUT: %ImplicitAs.facet.loc13: %ImplicitAs.type.0ec = facet_value constants.%i64, (constants.%ImplicitAs.impl_witness.305) [concrete = constants.%ImplicitAs.facet.7a4] +// CHECK:STDOUT: %.loc13_5.1: %ImplicitAs.type.0ec = converted constants.%i64, %ImplicitAs.facet.loc13 [concrete = constants.%ImplicitAs.facet.7a4] // CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13_5, @T.as_type.as.OrderedWith.impl.Less.3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.specific_fn.a8a2ad.1] // CHECK:STDOUT: %bound_method.loc13_5.2: = bound_method %b.ref.loc13, %specific_fn.loc13 -// CHECK:STDOUT: %.loc13_5: %T.as_type.as.OrderedWith.impl.Less.type.7b405f.1 = specific_constant imports.%Core.Less.2d9, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.c5f236.1] -// CHECK:STDOUT: %Less.ref.loc13: %T.as_type.as.OrderedWith.impl.Less.type.7b405f.1 = name_ref Less, %.loc13_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.c5f236.1] +// CHECK:STDOUT: %.loc13_5.2: %T.as_type.as.OrderedWith.impl.Less.type.7b405f.1 = specific_constant imports.%Core.Less.2d9, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.c5f236.1] +// CHECK:STDOUT: %Less.ref.loc13: %T.as_type.as.OrderedWith.impl.Less.type.7b405f.1 = name_ref Less, %.loc13_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.c5f236.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Less.bound.loc13: = bound_method %b.ref.loc13, %Less.ref.loc13 // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Less.specific_fn.loc13: = specific_function %Less.ref.loc13, @T.as_type.as.OrderedWith.impl.Less.4(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.specific_fn.a8a2ad.2] // CHECK:STDOUT: %bound_method.loc13_5.3: = bound_method %b.ref.loc13, %T.as_type.as.OrderedWith.impl.Less.specific_fn.loc13 @@ -2210,10 +2219,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc14: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem3.loc14: %.96b = impl_witness_access constants.%OrderedWith.impl_witness.7e3, element3 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.f86b3e.2] // CHECK:STDOUT: %bound_method.loc14_5.1: = bound_method %b.ref.loc14, %impl.elem3.loc14 +// CHECK:STDOUT: %ImplicitAs.facet.loc14: %ImplicitAs.type.0ec = facet_value constants.%i64, (constants.%ImplicitAs.impl_witness.305) [concrete = constants.%ImplicitAs.facet.7a4] +// CHECK:STDOUT: %.loc14_5.1: %ImplicitAs.type.0ec = converted constants.%i64, %ImplicitAs.facet.loc14 [concrete = constants.%ImplicitAs.facet.7a4] // CHECK:STDOUT: %specific_fn.loc14: = specific_function %impl.elem3.loc14, @T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.8a93e9.1] // CHECK:STDOUT: %bound_method.loc14_5.2: = bound_method %b.ref.loc14, %specific_fn.loc14 -// CHECK:STDOUT: %.loc14_5: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.0f0b65.1 = specific_constant imports.%Core.GreaterOrEquivalent.8e2, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.f86b3e.1] -// CHECK:STDOUT: %GreaterOrEquivalent.ref.loc14: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.0f0b65.1 = name_ref GreaterOrEquivalent, %.loc14_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.f86b3e.1] +// CHECK:STDOUT: %.loc14_5.2: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.0f0b65.1 = specific_constant imports.%Core.GreaterOrEquivalent.8e2, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.f86b3e.1] +// CHECK:STDOUT: %GreaterOrEquivalent.ref.loc14: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.0f0b65.1 = name_ref GreaterOrEquivalent, %.loc14_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.f86b3e.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.bound.loc14: = bound_method %b.ref.loc14, %GreaterOrEquivalent.ref.loc14 // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.loc14: = specific_function %GreaterOrEquivalent.ref.loc14, @T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.4(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.8a93e9.2] // CHECK:STDOUT: %bound_method.loc14_5.3: = bound_method %b.ref.loc14, %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.loc14 @@ -2227,10 +2238,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc15: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem1.loc15: %.829 = impl_witness_access constants.%OrderedWith.impl_witness.7e3, element1 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.e5cfba.2] // CHECK:STDOUT: %bound_method.loc15_5.1: = bound_method %b.ref.loc15, %impl.elem1.loc15 +// CHECK:STDOUT: %ImplicitAs.facet.loc15: %ImplicitAs.type.0ec = facet_value constants.%i64, (constants.%ImplicitAs.impl_witness.305) [concrete = constants.%ImplicitAs.facet.7a4] +// CHECK:STDOUT: %.loc15_5.1: %ImplicitAs.type.0ec = converted constants.%i64, %ImplicitAs.facet.loc15 [concrete = constants.%ImplicitAs.facet.7a4] // CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem1.loc15, @T.as_type.as.OrderedWith.impl.LessOrEquivalent.3(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.ab9ff7.1] // CHECK:STDOUT: %bound_method.loc15_5.2: = bound_method %b.ref.loc15, %specific_fn.loc15 -// CHECK:STDOUT: %.loc15_5: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.577251.1 = specific_constant imports.%Core.LessOrEquivalent.d90, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.e5cfba.1] -// CHECK:STDOUT: %LessOrEquivalent.ref.loc15: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.577251.1 = name_ref LessOrEquivalent, %.loc15_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.e5cfba.1] +// CHECK:STDOUT: %.loc15_5.2: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.577251.1 = specific_constant imports.%Core.LessOrEquivalent.d90, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.e5cfba.1] +// CHECK:STDOUT: %LessOrEquivalent.ref.loc15: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.577251.1 = name_ref LessOrEquivalent, %.loc15_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.e5cfba.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.bound.loc15: = bound_method %b.ref.loc15, %LessOrEquivalent.ref.loc15 // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.loc15: = specific_function %LessOrEquivalent.ref.loc15, @T.as_type.as.OrderedWith.impl.LessOrEquivalent.4(constants.%ImplicitAs.facet.7a4) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.ab9ff7.2] // CHECK:STDOUT: %bound_method.loc15_5.3: = bound_method %b.ref.loc15, %T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.loc15 @@ -2244,10 +2257,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc17: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem0.loc17_5: %.658 = impl_witness_access constants.%EqWith.impl_witness.cb6, element0 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.66756b.2] // CHECK:STDOUT: %bound_method.loc17_5.1: = bound_method %int_1.loc17, %impl.elem0.loc17_5 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.bound.2fcdd5.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc17: %ImplicitAs.type.0ec = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.660) [concrete = constants.%ImplicitAs.facet.2ed] +// CHECK:STDOUT: %.loc17_5.1: %ImplicitAs.type.0ec = converted Core.IntLiteral, %ImplicitAs.facet.loc17 [concrete = constants.%ImplicitAs.facet.2ed] // CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17_5, @T.as_type.as.EqWith.impl.Equal.3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.specific_fn.7834c5.1] // CHECK:STDOUT: %bound_method.loc17_5.2: = bound_method %int_1.loc17, %specific_fn.loc17 [concrete = constants.%bound_method.7c9d36.1] -// CHECK:STDOUT: %.loc17_5: %T.as_type.as.EqWith.impl.Equal.type.8e6244.1 = specific_constant imports.%Core.Equal.4f5, @T.as_type.as.EqWith.impl.6d3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.66756b.1] -// CHECK:STDOUT: %Equal.ref.loc17: %T.as_type.as.EqWith.impl.Equal.type.8e6244.1 = name_ref Equal, %.loc17_5 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.66756b.1] +// CHECK:STDOUT: %.loc17_5.2: %T.as_type.as.EqWith.impl.Equal.type.8e6244.1 = specific_constant imports.%Core.Equal.4f5, @T.as_type.as.EqWith.impl.6d3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.66756b.1] +// CHECK:STDOUT: %Equal.ref.loc17: %T.as_type.as.EqWith.impl.Equal.type.8e6244.1 = name_ref Equal, %.loc17_5.2 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.66756b.1] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.Equal.bound.loc17: = bound_method %int_1.loc17, %Equal.ref.loc17 [concrete = constants.%T.as_type.as.EqWith.impl.Equal.bound.2fcdd5.2] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.Equal.specific_fn.loc17: = specific_function %Equal.ref.loc17, @T.as_type.as.EqWith.impl.Equal.4(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.EqWith.impl.Equal.specific_fn.7834c5.2] // CHECK:STDOUT: %bound_method.loc17_5.3: = bound_method %int_1.loc17, %T.as_type.as.EqWith.impl.Equal.specific_fn.loc17 [concrete = constants.%bound_method.7c9d36.2] @@ -2261,10 +2276,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc18: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem1.loc18: %.1f9 = impl_witness_access constants.%EqWith.impl_witness.cb6, element1 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.672038.2] // CHECK:STDOUT: %bound_method.loc18_5.1: = bound_method %int_1.loc18, %impl.elem1.loc18 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.bound.a9911b.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc18: %ImplicitAs.type.0ec = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.660) [concrete = constants.%ImplicitAs.facet.2ed] +// CHECK:STDOUT: %.loc18_5.1: %ImplicitAs.type.0ec = converted Core.IntLiteral, %ImplicitAs.facet.loc18 [concrete = constants.%ImplicitAs.facet.2ed] // CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem1.loc18, @T.as_type.as.EqWith.impl.NotEqual.3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.specific_fn.598adf.1] // CHECK:STDOUT: %bound_method.loc18_5.2: = bound_method %int_1.loc18, %specific_fn.loc18 [concrete = constants.%bound_method.1f073e.1] -// CHECK:STDOUT: %.loc18_5: %T.as_type.as.EqWith.impl.NotEqual.type.fb7a86.1 = specific_constant imports.%Core.NotEqual.0b2, @T.as_type.as.EqWith.impl.6d3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.672038.1] -// CHECK:STDOUT: %NotEqual.ref.loc18: %T.as_type.as.EqWith.impl.NotEqual.type.fb7a86.1 = name_ref NotEqual, %.loc18_5 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.672038.1] +// CHECK:STDOUT: %.loc18_5.2: %T.as_type.as.EqWith.impl.NotEqual.type.fb7a86.1 = specific_constant imports.%Core.NotEqual.0b2, @T.as_type.as.EqWith.impl.6d3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.672038.1] +// CHECK:STDOUT: %NotEqual.ref.loc18: %T.as_type.as.EqWith.impl.NotEqual.type.fb7a86.1 = name_ref NotEqual, %.loc18_5.2 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.672038.1] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.NotEqual.bound.loc18: = bound_method %int_1.loc18, %NotEqual.ref.loc18 [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.bound.a9911b.2] // CHECK:STDOUT: %T.as_type.as.EqWith.impl.NotEqual.specific_fn.loc18: = specific_function %NotEqual.ref.loc18, @T.as_type.as.EqWith.impl.NotEqual.4(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.EqWith.impl.NotEqual.specific_fn.598adf.2] // CHECK:STDOUT: %bound_method.loc18_5.3: = bound_method %int_1.loc18, %T.as_type.as.EqWith.impl.NotEqual.specific_fn.loc18 [concrete = constants.%bound_method.1f073e.2] @@ -2278,10 +2295,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc19: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem2.loc19: %.1e0 = impl_witness_access constants.%OrderedWith.impl_witness.ccd, element2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.a80774.2] // CHECK:STDOUT: %bound_method.loc19_5.1: = bound_method %int_1.loc19, %impl.elem2.loc19 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.bound.ba4552.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc19: %ImplicitAs.type.0ec = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.660) [concrete = constants.%ImplicitAs.facet.2ed] +// CHECK:STDOUT: %.loc19_5.1: %ImplicitAs.type.0ec = converted Core.IntLiteral, %ImplicitAs.facet.loc19 [concrete = constants.%ImplicitAs.facet.2ed] // CHECK:STDOUT: %specific_fn.loc19: = specific_function %impl.elem2.loc19, @T.as_type.as.OrderedWith.impl.Greater.3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.specific_fn.3eccd1.1] // CHECK:STDOUT: %bound_method.loc19_5.2: = bound_method %int_1.loc19, %specific_fn.loc19 [concrete = constants.%bound_method.560bca.1] -// CHECK:STDOUT: %.loc19_5: %T.as_type.as.OrderedWith.impl.Greater.type.e2356e.1 = specific_constant imports.%Core.Greater.c24, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.a80774.1] -// CHECK:STDOUT: %Greater.ref.loc19: %T.as_type.as.OrderedWith.impl.Greater.type.e2356e.1 = name_ref Greater, %.loc19_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.a80774.1] +// CHECK:STDOUT: %.loc19_5.2: %T.as_type.as.OrderedWith.impl.Greater.type.e2356e.1 = specific_constant imports.%Core.Greater.c24, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.a80774.1] +// CHECK:STDOUT: %Greater.ref.loc19: %T.as_type.as.OrderedWith.impl.Greater.type.e2356e.1 = name_ref Greater, %.loc19_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.a80774.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Greater.bound.loc19: = bound_method %int_1.loc19, %Greater.ref.loc19 [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.bound.ba4552.2] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Greater.specific_fn.loc19: = specific_function %Greater.ref.loc19, @T.as_type.as.OrderedWith.impl.Greater.4(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.Greater.specific_fn.3eccd1.2] // CHECK:STDOUT: %bound_method.loc19_5.3: = bound_method %int_1.loc19, %T.as_type.as.OrderedWith.impl.Greater.specific_fn.loc19 [concrete = constants.%bound_method.560bca.2] @@ -2295,10 +2314,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc20: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem0.loc20_5: %.4c9 = impl_witness_access constants.%OrderedWith.impl_witness.ccd, element0 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.09733d.2] // CHECK:STDOUT: %bound_method.loc20_5.1: = bound_method %int_1.loc20, %impl.elem0.loc20_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.bound.069497.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc20: %ImplicitAs.type.0ec = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.660) [concrete = constants.%ImplicitAs.facet.2ed] +// CHECK:STDOUT: %.loc20_5.1: %ImplicitAs.type.0ec = converted Core.IntLiteral, %ImplicitAs.facet.loc20 [concrete = constants.%ImplicitAs.facet.2ed] // CHECK:STDOUT: %specific_fn.loc20: = specific_function %impl.elem0.loc20_5, @T.as_type.as.OrderedWith.impl.Less.3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.specific_fn.0beaf8.1] // CHECK:STDOUT: %bound_method.loc20_5.2: = bound_method %int_1.loc20, %specific_fn.loc20 [concrete = constants.%bound_method.103f49.1] -// CHECK:STDOUT: %.loc20_5: %T.as_type.as.OrderedWith.impl.Less.type.28a50f.1 = specific_constant imports.%Core.Less.2d9, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.09733d.1] -// CHECK:STDOUT: %Less.ref.loc20: %T.as_type.as.OrderedWith.impl.Less.type.28a50f.1 = name_ref Less, %.loc20_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.09733d.1] +// CHECK:STDOUT: %.loc20_5.2: %T.as_type.as.OrderedWith.impl.Less.type.28a50f.1 = specific_constant imports.%Core.Less.2d9, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.09733d.1] +// CHECK:STDOUT: %Less.ref.loc20: %T.as_type.as.OrderedWith.impl.Less.type.28a50f.1 = name_ref Less, %.loc20_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.09733d.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Less.bound.loc20: = bound_method %int_1.loc20, %Less.ref.loc20 [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.bound.069497.2] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.Less.specific_fn.loc20: = specific_function %Less.ref.loc20, @T.as_type.as.OrderedWith.impl.Less.4(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.Less.specific_fn.0beaf8.2] // CHECK:STDOUT: %bound_method.loc20_5.3: = bound_method %int_1.loc20, %T.as_type.as.OrderedWith.impl.Less.specific_fn.loc20 [concrete = constants.%bound_method.103f49.2] @@ -2312,10 +2333,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc21: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem3.loc21: %.b09 = impl_witness_access constants.%OrderedWith.impl_witness.ccd, element3 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.ae8de7.2] // CHECK:STDOUT: %bound_method.loc21_5.1: = bound_method %int_1.loc21, %impl.elem3.loc21 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.bound.22317d.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc21: %ImplicitAs.type.0ec = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.660) [concrete = constants.%ImplicitAs.facet.2ed] +// CHECK:STDOUT: %.loc21_5.1: %ImplicitAs.type.0ec = converted Core.IntLiteral, %ImplicitAs.facet.loc21 [concrete = constants.%ImplicitAs.facet.2ed] // CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem3.loc21, @T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.371f57.1] // CHECK:STDOUT: %bound_method.loc21_5.2: = bound_method %int_1.loc21, %specific_fn.loc21 [concrete = constants.%bound_method.ffa540.1] -// CHECK:STDOUT: %.loc21_5: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.09194f.1 = specific_constant imports.%Core.GreaterOrEquivalent.8e2, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.ae8de7.1] -// CHECK:STDOUT: %GreaterOrEquivalent.ref.loc21: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.09194f.1 = name_ref GreaterOrEquivalent, %.loc21_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.ae8de7.1] +// CHECK:STDOUT: %.loc21_5.2: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.09194f.1 = specific_constant imports.%Core.GreaterOrEquivalent.8e2, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.ae8de7.1] +// CHECK:STDOUT: %GreaterOrEquivalent.ref.loc21: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.type.09194f.1 = name_ref GreaterOrEquivalent, %.loc21_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.ae8de7.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.bound.loc21: = bound_method %int_1.loc21, %GreaterOrEquivalent.ref.loc21 [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.bound.22317d.2] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.loc21: = specific_function %GreaterOrEquivalent.ref.loc21, @T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.4(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.371f57.2] // CHECK:STDOUT: %bound_method.loc21_5.3: = bound_method %int_1.loc21, %T.as_type.as.OrderedWith.impl.GreaterOrEquivalent.specific_fn.loc21 [concrete = constants.%bound_method.ffa540.2] @@ -2329,10 +2352,12 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.ref.loc22: %Cpp.long_long = name_ref a, %a // CHECK:STDOUT: %impl.elem1.loc22: %.cab = impl_witness_access constants.%OrderedWith.impl_witness.ccd, element1 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b7cd44.2] // CHECK:STDOUT: %bound_method.loc22_5.1: = bound_method %int_1.loc22, %impl.elem1.loc22 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.bound.2eaa72.1] +// CHECK:STDOUT: %ImplicitAs.facet.loc22: %ImplicitAs.type.0ec = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.660) [concrete = constants.%ImplicitAs.facet.2ed] +// CHECK:STDOUT: %.loc22_5.1: %ImplicitAs.type.0ec = converted Core.IntLiteral, %ImplicitAs.facet.loc22 [concrete = constants.%ImplicitAs.facet.2ed] // CHECK:STDOUT: %specific_fn.loc22: = specific_function %impl.elem1.loc22, @T.as_type.as.OrderedWith.impl.LessOrEquivalent.3(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.05fce2.1] // CHECK:STDOUT: %bound_method.loc22_5.2: = bound_method %int_1.loc22, %specific_fn.loc22 [concrete = constants.%bound_method.83e687.1] -// CHECK:STDOUT: %.loc22_5: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.1522a4.1 = specific_constant imports.%Core.LessOrEquivalent.d90, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b7cd44.1] -// CHECK:STDOUT: %LessOrEquivalent.ref.loc22: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.1522a4.1 = name_ref LessOrEquivalent, %.loc22_5 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b7cd44.1] +// CHECK:STDOUT: %.loc22_5.2: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.1522a4.1 = specific_constant imports.%Core.LessOrEquivalent.d90, @T.as_type.as.OrderedWith.impl.df2(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b7cd44.1] +// CHECK:STDOUT: %LessOrEquivalent.ref.loc22: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.type.1522a4.1 = name_ref LessOrEquivalent, %.loc22_5.2 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.b7cd44.1] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.bound.loc22: = bound_method %int_1.loc22, %LessOrEquivalent.ref.loc22 [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.bound.2eaa72.2] // CHECK:STDOUT: %T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.loc22: = specific_function %LessOrEquivalent.ref.loc22, @T.as_type.as.OrderedWith.impl.LessOrEquivalent.4(constants.%ImplicitAs.facet.2ed) [concrete = constants.%T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.05fce2.2] // CHECK:STDOUT: %bound_method.loc22_5.3: = bound_method %int_1.loc22, %T.as_type.as.OrderedWith.impl.LessOrEquivalent.specific_fn.loc22 [concrete = constants.%bound_method.83e687.2] diff --git a/toolchain/check/testdata/interop/cpp/range_for.carbon b/toolchain/check/testdata/interop/cpp/range_for.carbon index e10200f3ae1f..6cf45f7ebdd5 100644 --- a/toolchain/check/testdata/interop/cpp/range_for.carbon +++ b/toolchain/check/testdata/interop/cpp/range_for.carbon @@ -183,14 +183,14 @@ fn TestDriver(var m: Cpp.N.MutableRange) { // CHECK:STDERR: Test(m); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:12: note: value expression passed to reference parameter [ValueForRefParam] - // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn Begin(self) -> Iterator; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-23]]:34: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: friend auto begin(MutableRange&) -> Iterator; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Begin(self) -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-23]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = f64](r: R) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -199,14 +199,14 @@ fn TestDriver(var m: Cpp.N.MutableRange) { // CHECK:STDERR: Test(m); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:10: note: value expression passed to reference parameter [ValueForRefParam] - // CHECK:STDERR: fn End[self: Self]() -> Sentinel; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn End(self) -> Sentinel; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-38]]:32: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: friend auto end(MutableRange&) -> Iterator; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: fn End[self: Self]() -> Sentinel; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn End(self) -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-39]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = f64](r: R) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -298,14 +298,14 @@ fn TestDriver(var m: Cpp.N.MutableRange) { // CHECK:STDERR: Test(m); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:12: note: value expression passed to reference parameter [ValueForRefParam] - // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn Begin(self) -> Iterator; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-23]]:34: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: friend auto begin(MutableRange&) -> Iterator; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Begin(self) -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-23]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -314,14 +314,14 @@ fn TestDriver(var m: Cpp.N.MutableRange) { // CHECK:STDERR: Test(m); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:10: note: value expression passed to reference parameter [ValueForRefParam] - // CHECK:STDERR: fn End[self: Self]() -> Sentinel; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn End(self) -> Sentinel; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-38]]:32: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: friend auto end(MutableRange&) -> Sentinel; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: fn End[self: Self]() -> Sentinel; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn End(self) -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-39]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -393,14 +393,14 @@ fn TestDriver(var mc: Cpp.N.MutableAndConstRange) { // CHECK:STDERR: Test(mc); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:12: note: value expression passed to reference parameter [ValueForRefParam] - // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn Begin(self) -> Iterator; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-26]]:44: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: friend auto begin(MutableAndConstRange&) -> Iterator; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Begin(self) -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-23]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -409,14 +409,14 @@ fn TestDriver(var mc: Cpp.N.MutableAndConstRange) { // CHECK:STDERR: Test(mc); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:10: note: value expression passed to reference parameter [ValueForRefParam] - // CHECK:STDERR: fn End[self: Self]() -> Sentinel; - // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn End(self) -> Sentinel; + // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-41]]:42: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: friend auto end(MutableAndConstRange&) -> Iterator; // CHECK:STDERR: ^ // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:3: note: while building thunk to match the signature of this function [ThunkSignature] - // CHECK:STDERR: fn End[self: Self]() -> Sentinel; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn End(self) -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-39]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -636,6 +636,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, Test(end_function_deleted); } + // CHECK:STDOUT: --- methods_return_same_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -901,21 +902,21 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc30_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.c86)] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc30_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.bbb)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.d2b)] -// CHECK:STDOUT: %.loc34_19.12: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc34_19.12 (constants.%.3e2)] -// CHECK:STDOUT: %impl.elem2.loc34_19.2: @Test.%.loc34_19.12 (%.3e2) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_19.2 (constants.%impl.elem2.f53)] -// CHECK:STDOUT: %specific_impl_fn.loc34_19.4: = specific_impl_function %impl.elem2.loc34_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.87a)] +// CHECK:STDOUT: %Iterate.facet.loc34_19.3: %Iterate.type = facet_value %R.as_type.loc30_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc34_19.3 (constants.%Iterate.facet.bbb)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc34_19.3) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.d2b)] +// CHECK:STDOUT: %.loc34_19.15: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc34_19.3 [symbolic = %.loc34_19.15 (constants.%.3e2)] +// CHECK:STDOUT: %impl.elem2.loc34_19.2: @Test.%.loc34_19.15 (%.3e2) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_19.2 (constants.%impl.elem2.f53)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.4: = specific_impl_function %impl.elem2.loc34_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc34_19.3) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.87a)] // CHECK:STDOUT: // CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.3b4)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.28b)] -// CHECK:STDOUT: %.loc34_19.13: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc34_19.13 (constants.%.a8b)] -// CHECK:STDOUT: %impl.elem3.loc34_19.2: @Test.%.loc34_19.13 (%.a8b) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.9c3)] -// CHECK:STDOUT: %specific_impl_fn.loc34_19.5: = specific_impl_function %impl.elem3.loc34_19.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.ab2)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc34_19.3) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.28b)] +// CHECK:STDOUT: %.loc34_19.16: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc34_19.3 [symbolic = %.loc34_19.16 (constants.%.a8b)] +// CHECK:STDOUT: %impl.elem3.loc34_19.2: @Test.%.loc34_19.16 (%.a8b) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.9c3)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.5: = specific_impl_function %impl.elem3.loc34_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc34_19.3) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.ab2)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.515)] -// CHECK:STDOUT: %.loc34_19.14: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc34_19.14 (constants.%.94f)] +// CHECK:STDOUT: %.loc34_19.17: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc34_19.17 (constants.%.94f)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.5d5)] -// CHECK:STDOUT: %impl.elem0.loc34_19.2: @Test.%.loc34_19.14 (%.94f) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.e52)] +// CHECK:STDOUT: %impl.elem0.loc34_19.2: @Test.%.loc34_19.17 (%.94f) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.e52)] // CHECK:STDOUT: %specific_impl_fn.loc34_19.6: = specific_impl_function %impl.elem0.loc34_19.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc34_19.6 (constants.%specific_impl_fn.12e)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc30_55.1 (%R.as_type.67d)) { @@ -925,8 +926,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.6b6 = value_binding_pattern i [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc30_55.1 (%R.as_type.67d) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc34_19.1: @Test.%.loc34_19.12 (%.3e2) = impl_witness_access constants.%Iterate.lookup_impl_witness.c86, element2 [symbolic = %impl.elem2.loc34_19.2 (constants.%impl.elem2.f53)] +// CHECK:STDOUT: %impl.elem2.loc34_19.1: @Test.%.loc34_19.15 (%.3e2) = impl_witness_access constants.%Iterate.lookup_impl_witness.c86, element2 [symbolic = %impl.elem2.loc34_19.2 (constants.%impl.elem2.f53)] // CHECK:STDOUT: %bound_method.loc34_19.1: = bound_method %r.ref, %impl.elem2.loc34_19.1 +// CHECK:STDOUT: %Iterate.facet.loc34_19.1: %Iterate.type = facet_value constants.%R.as_type.67d, (constants.%Iterate.lookup_impl_witness.c86) [symbolic = %Iterate.facet.loc34_19.3 (constants.%Iterate.facet.bbb)] +// CHECK:STDOUT: %.loc34_19.1: %Iterate.type = converted constants.%R.as_type.67d, %Iterate.facet.loc34_19.1 [symbolic = %Iterate.facet.loc34_19.3 (constants.%Iterate.facet.bbb)] // CHECK:STDOUT: %specific_impl_fn.loc34_19.1: = specific_impl_function %impl.elem2.loc34_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.bbb) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.87a)] // CHECK:STDOUT: %bound_method.loc34_19.2: = bound_method %r.ref, %specific_impl_fn.loc34_19.1 // CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.ca2) = var invalid @@ -936,37 +939,39 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr: @Test.%ptr (%ptr.3b4) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc34_19.1: @Test.%.loc34_19.13 (%.a8b) = impl_witness_access constants.%Iterate.lookup_impl_witness.c86, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.9c3)] +// CHECK:STDOUT: %impl.elem3.loc34_19.1: @Test.%.loc34_19.16 (%.a8b) = impl_witness_access constants.%Iterate.lookup_impl_witness.c86, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.9c3)] // CHECK:STDOUT: %bound_method.loc34_19.3: = bound_method %r.ref, %impl.elem3.loc34_19.1 -// CHECK:STDOUT: %.loc34_19.1: %Destroy.type = converted constants.%as_type.ca2, constants.%impl.elem1.d31 [symbolic = %impl.elem1 (constants.%impl.elem1.d31)] +// CHECK:STDOUT: %Iterate.facet.loc34_19.2: %Iterate.type = facet_value constants.%R.as_type.67d, (constants.%Iterate.lookup_impl_witness.c86) [symbolic = %Iterate.facet.loc34_19.3 (constants.%Iterate.facet.bbb)] +// CHECK:STDOUT: %.loc34_19.2: %Iterate.type = converted constants.%R.as_type.67d, %Iterate.facet.loc34_19.2 [symbolic = %Iterate.facet.loc34_19.3 (constants.%Iterate.facet.bbb)] +// CHECK:STDOUT: %.loc34_19.3: %Destroy.type = converted constants.%as_type.ca2, constants.%impl.elem1.d31 [symbolic = %impl.elem1 (constants.%impl.elem1.d31)] // CHECK:STDOUT: %specific_impl_fn.loc34_19.2: = specific_impl_function %impl.elem3.loc34_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.bbb) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.ab2)] // CHECK:STDOUT: %bound_method.loc34_19.4: = bound_method %r.ref, %specific_impl_fn.loc34_19.2 -// CHECK:STDOUT: %.loc34_19.2: ref %Optional.e28 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.e28 to %.loc34_19.2 = call %bound_method.loc34_19.4(%r.ref, %addr) -// CHECK:STDOUT: %.loc34_19.3: ref %Optional.e28 = temporary %.loc34_19.2, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc34_19.4: %Optional.HasValue.type.c6d = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.172) [concrete = constants.%Optional.HasValue.89b] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.c6d = name_ref HasValue, %.loc34_19.4 [concrete = constants.%Optional.HasValue.89b] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc34_19.3, %HasValue.ref +// CHECK:STDOUT: %.loc34_19.4: ref %Optional.e28 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.e28 to %.loc34_19.4 = call %bound_method.loc34_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc34_19.5: ref %Optional.e28 = temporary %.loc34_19.4, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc34_19.6: %Optional.HasValue.type.c6d = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.172) [concrete = constants.%Optional.HasValue.89b] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.c6d = name_ref HasValue, %.loc34_19.6 [concrete = constants.%Optional.HasValue.89b] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc34_19.5, %HasValue.ref // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.172) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc34_19.5: = bound_method %.loc34_19.3, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc34_19.5: %Optional.e28 = acquire_value %.loc34_19.3 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc34_19.5(%.loc34_19.5) -// CHECK:STDOUT: %.loc34_19.6: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc34_19.7: bool = converted %Optional.HasValue.call, %.loc34_19.6 -// CHECK:STDOUT: if %.loc34_19.7 br !for.body else br !for.done +// CHECK:STDOUT: %bound_method.loc34_19.5: = bound_method %.loc34_19.5, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc34_19.7: %Optional.e28 = acquire_value %.loc34_19.5 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc34_19.5(%.loc34_19.7) +// CHECK:STDOUT: %.loc34_19.8: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc34_19.9: bool = converted %Optional.HasValue.call, %.loc34_19.8 +// CHECK:STDOUT: if %.loc34_19.9 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc34_19.8: %Optional.Get.type.7e6 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.172) [concrete = constants.%Optional.Get.722] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.7e6 = name_ref Get, %.loc34_19.8 [concrete = constants.%Optional.Get.722] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc34_19.3, %Get.ref +// CHECK:STDOUT: %.loc34_19.10: %Optional.Get.type.7e6 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.172) [concrete = constants.%Optional.Get.722] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.7e6 = name_ref Get, %.loc34_19.10 [concrete = constants.%Optional.Get.722] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc34_19.5, %Get.ref // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.172) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc34_19.6: = bound_method %.loc34_19.3, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc34_19.9: %Optional.e28 = acquire_value %.loc34_19.3 -// CHECK:STDOUT: %Optional.Get.call: init %i32 = call %bound_method.loc34_19.6(%.loc34_19.9) +// CHECK:STDOUT: %bound_method.loc34_19.6: = bound_method %.loc34_19.5, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc34_19.11: %Optional.e28 = acquire_value %.loc34_19.5 +// CHECK:STDOUT: %Optional.Get.call: init %i32 = call %bound_method.loc34_19.6(%.loc34_19.11) // CHECK:STDOUT: %i32.loc34: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc34_19.10: %i32 = value_of_initializer %Optional.Get.call -// CHECK:STDOUT: %.loc34_19.11: %i32 = converted %Optional.Get.call, %.loc34_19.10 -// CHECK:STDOUT: %i: %i32 = value_binding i, %.loc34_19.11 +// CHECK:STDOUT: %.loc34_19.12: %i32 = value_of_initializer %Optional.Get.call +// CHECK:STDOUT: %.loc34_19.13: %i32 = converted %Optional.Get.call, %.loc34_19.12 +// CHECK:STDOUT: %i: %i32 = value_binding i, %.loc34_19.13 // CHECK:STDOUT: %sum.ref: ref %i32 = name_ref sum, %sum // CHECK:STDOUT: %i.ref: %i32 = name_ref i, %i // CHECK:STDOUT: %impl.elem0.loc35: %.b28 = impl_witness_access constants.%AddAssignWith.impl_witness.22e, element0 [concrete = constants.%Int.as.AddAssignWith.impl.Op.00e760.2] @@ -982,10 +987,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %.loc34_19.3, constants.%Destroy.Op.1a2547.9 -// CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_19.3) -// CHECK:STDOUT: %impl.elem0.loc34_19.1: @Test.%.loc34_19.14 (%.94f) = impl_witness_access constants.%Destroy.lookup_impl_witness.5d5, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.e52)] +// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %.loc34_19.5, constants.%Destroy.Op.1a2547.9 +// CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_19.5) +// CHECK:STDOUT: %impl.elem0.loc34_19.1: @Test.%.loc34_19.17 (%.94f) = impl_witness_access constants.%Destroy.lookup_impl_witness.5d5, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.e52)] // CHECK:STDOUT: %bound_method.loc34_19.7: = bound_method %var, %impl.elem0.loc34_19.1 +// CHECK:STDOUT: %.loc34_19.14: %Destroy.type = converted constants.%as_type.ca2, constants.%impl.elem1.d31 [symbolic = %impl.elem1 (constants.%impl.elem1.d31)] // CHECK:STDOUT: %specific_impl_fn.loc34_19.3: = specific_impl_function %impl.elem0.loc34_19.1, @Destroy.WithSelf.Op(constants.%impl.elem1.d31) [symbolic = %specific_impl_fn.loc34_19.6 (constants.%specific_impl_fn.12e)] // CHECK:STDOUT: %bound_method.loc34_19.8: = bound_method %var, %specific_impl_fn.loc34_19.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc34_19.8(%var) @@ -1034,9 +1040,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc30 => constants.%complete_type.357 // CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.cea -// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.ffb +// CHECK:STDOUT: %Iterate.facet.loc34_19.3 => constants.%Iterate.facet.ffb // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.dcb -// CHECK:STDOUT: %.loc34_19.12 => constants.%.d6a +// CHECK:STDOUT: %.loc34_19.15 => constants.%.d6a // CHECK:STDOUT: %impl.elem2.loc34_19.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.8d2 // CHECK:STDOUT: %specific_impl_fn.loc34_19.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn.bf1 // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.30f @@ -1044,11 +1050,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.c28 // CHECK:STDOUT: %ptr => constants.%ptr.45c // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.30e -// CHECK:STDOUT: %.loc34_19.13 => constants.%.d23 +// CHECK:STDOUT: %.loc34_19.16 => constants.%.d23 // CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%R.as_type.as.Iterate.impl.Next.34d // CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.dd5 // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c6c -// CHECK:STDOUT: %.loc34_19.14 => constants.%.0a4 +// CHECK:STDOUT: %.loc34_19.17 => constants.%.0a4 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.10 // CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.Op.1a2547.10 // CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.Op.1a2547.10 @@ -1062,9 +1068,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc30 => constants.%complete_type.357 // CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.12a -// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.5eb +// CHECK:STDOUT: %Iterate.facet.loc34_19.3 => constants.%Iterate.facet.5eb // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.ab5 -// CHECK:STDOUT: %.loc34_19.12 => constants.%.744 +// CHECK:STDOUT: %.loc34_19.15 => constants.%.744 // CHECK:STDOUT: %impl.elem2.loc34_19.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.2f6 // CHECK:STDOUT: %specific_impl_fn.loc34_19.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn.a05 // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.e4c @@ -1072,11 +1078,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.8d5 // CHECK:STDOUT: %ptr => constants.%ptr.c5c // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.e25 -// CHECK:STDOUT: %.loc34_19.13 => constants.%.03b +// CHECK:STDOUT: %.loc34_19.16 => constants.%.03b // CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%R.as_type.as.Iterate.impl.Next.393 // CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.4cc // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.7ec -// CHECK:STDOUT: %.loc34_19.14 => constants.%.0e7 +// CHECK:STDOUT: %.loc34_19.17 => constants.%.0e7 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.11 // CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.Op.1a2547.11 // CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.Op.1a2547.11 @@ -1349,21 +1355,21 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc40_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.acc)] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc40_69.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.b95)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.d69)] -// CHECK:STDOUT: %.loc44_29.13: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc44_29.13 (constants.%.f8a)] -// CHECK:STDOUT: %impl.elem2.loc44_29.2: @Test.%.loc44_29.13 (%.f8a) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc44_29.2 (constants.%impl.elem2.398)] -// CHECK:STDOUT: %specific_impl_fn.loc44_29.4: = specific_impl_function %impl.elem2.loc44_29.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc44_29.4 (constants.%specific_impl_fn.544)] +// CHECK:STDOUT: %Iterate.facet.loc44_29.3: %Iterate.type = facet_value %R.as_type.loc40_69.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc44_29.3 (constants.%Iterate.facet.b95)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc44_29.3) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.d69)] +// CHECK:STDOUT: %.loc44_29.16: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc44_29.3 [symbolic = %.loc44_29.16 (constants.%.f8a)] +// CHECK:STDOUT: %impl.elem2.loc44_29.2: @Test.%.loc44_29.16 (%.f8a) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc44_29.2 (constants.%impl.elem2.398)] +// CHECK:STDOUT: %specific_impl_fn.loc44_29.4: = specific_impl_function %impl.elem2.loc44_29.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc44_29.3) [symbolic = %specific_impl_fn.loc44_29.4 (constants.%specific_impl_fn.544)] // CHECK:STDOUT: // CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.bdd)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.d6f)] -// CHECK:STDOUT: %.loc44_29.14: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc44_29.14 (constants.%.52a)] -// CHECK:STDOUT: %impl.elem3.loc44_29.2: @Test.%.loc44_29.14 (%.52a) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc44_29.2 (constants.%impl.elem3.510)] -// CHECK:STDOUT: %specific_impl_fn.loc44_29.5: = specific_impl_function %impl.elem3.loc44_29.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc44_29.5 (constants.%specific_impl_fn.a00)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc44_29.3) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.d6f)] +// CHECK:STDOUT: %.loc44_29.17: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc44_29.3 [symbolic = %.loc44_29.17 (constants.%.52a)] +// CHECK:STDOUT: %impl.elem3.loc44_29.2: @Test.%.loc44_29.17 (%.52a) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc44_29.2 (constants.%impl.elem3.510)] +// CHECK:STDOUT: %specific_impl_fn.loc44_29.5: = specific_impl_function %impl.elem3.loc44_29.2, @Iterate.WithSelf.Next(%Iterate.facet.loc44_29.3) [symbolic = %specific_impl_fn.loc44_29.5 (constants.%specific_impl_fn.a00)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d67)] -// CHECK:STDOUT: %.loc44_29.15: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc44_29.15 (constants.%.4b9)] +// CHECK:STDOUT: %.loc44_29.18: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc44_29.18 (constants.%.4b9)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.ff8)] -// CHECK:STDOUT: %impl.elem0.loc44_29.2: @Test.%.loc44_29.15 (%.4b9) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc44_29.2 (constants.%impl.elem0.fbe)] +// CHECK:STDOUT: %impl.elem0.loc44_29.2: @Test.%.loc44_29.18 (%.4b9) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc44_29.2 (constants.%impl.elem0.fbe)] // CHECK:STDOUT: %specific_impl_fn.loc44_29.6: = specific_impl_function %impl.elem0.loc44_29.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc44_29.6 (constants.%specific_impl_fn.517)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: ref @Test.%R.as_type.loc40_69.1 (%R.as_type.f62)) { @@ -1373,8 +1379,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.e9f = value_binding_pattern i [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: ref @Test.%R.as_type.loc40_69.1 (%R.as_type.f62) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc44_29.1: @Test.%.loc44_29.13 (%.f8a) = impl_witness_access constants.%Iterate.lookup_impl_witness.acc, element2 [symbolic = %impl.elem2.loc44_29.2 (constants.%impl.elem2.398)] +// CHECK:STDOUT: %impl.elem2.loc44_29.1: @Test.%.loc44_29.16 (%.f8a) = impl_witness_access constants.%Iterate.lookup_impl_witness.acc, element2 [symbolic = %impl.elem2.loc44_29.2 (constants.%impl.elem2.398)] // CHECK:STDOUT: %bound_method.loc44_29.1: = bound_method %r.ref, %impl.elem2.loc44_29.1 +// CHECK:STDOUT: %Iterate.facet.loc44_29.1: %Iterate.type = facet_value constants.%R.as_type.f62, (constants.%Iterate.lookup_impl_witness.acc) [symbolic = %Iterate.facet.loc44_29.3 (constants.%Iterate.facet.b95)] +// CHECK:STDOUT: %.loc44_29.1: %Iterate.type = converted constants.%R.as_type.f62, %Iterate.facet.loc44_29.1 [symbolic = %Iterate.facet.loc44_29.3 (constants.%Iterate.facet.b95)] // CHECK:STDOUT: %specific_impl_fn.loc44_29.1: = specific_impl_function %impl.elem2.loc44_29.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.b95) [symbolic = %specific_impl_fn.loc44_29.4 (constants.%specific_impl_fn.544)] // CHECK:STDOUT: %bound_method.loc44_29.2: = bound_method %r.ref, %specific_impl_fn.loc44_29.1 // CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.bc6) = var invalid @@ -1385,42 +1393,44 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc44: @Test.%ptr (%ptr.bdd) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc44_29.1: @Test.%.loc44_29.14 (%.52a) = impl_witness_access constants.%Iterate.lookup_impl_witness.acc, element3 [symbolic = %impl.elem3.loc44_29.2 (constants.%impl.elem3.510)] +// CHECK:STDOUT: %impl.elem3.loc44_29.1: @Test.%.loc44_29.17 (%.52a) = impl_witness_access constants.%Iterate.lookup_impl_witness.acc, element3 [symbolic = %impl.elem3.loc44_29.2 (constants.%impl.elem3.510)] // CHECK:STDOUT: %bound_method.loc44_29.3: = bound_method %r.ref, %impl.elem3.loc44_29.1 -// CHECK:STDOUT: %.loc44_29.1: %Destroy.type = converted constants.%as_type.bc6, constants.%impl.elem1.411 [symbolic = %impl.elem1 (constants.%impl.elem1.411)] +// CHECK:STDOUT: %Iterate.facet.loc44_29.2: %Iterate.type = facet_value constants.%R.as_type.f62, (constants.%Iterate.lookup_impl_witness.acc) [symbolic = %Iterate.facet.loc44_29.3 (constants.%Iterate.facet.b95)] +// CHECK:STDOUT: %.loc44_29.2: %Iterate.type = converted constants.%R.as_type.f62, %Iterate.facet.loc44_29.2 [symbolic = %Iterate.facet.loc44_29.3 (constants.%Iterate.facet.b95)] +// CHECK:STDOUT: %.loc44_29.3: %Destroy.type = converted constants.%as_type.bc6, constants.%impl.elem1.411 [symbolic = %impl.elem1 (constants.%impl.elem1.411)] // CHECK:STDOUT: %specific_impl_fn.loc44_29.2: = specific_impl_function %impl.elem3.loc44_29.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.b95) [symbolic = %specific_impl_fn.loc44_29.5 (constants.%specific_impl_fn.a00)] // CHECK:STDOUT: %bound_method.loc44_29.4: = bound_method %r.ref, %specific_impl_fn.loc44_29.2 -// CHECK:STDOUT: %.loc44_29.2: ref %Optional.95f = temporary_storage +// CHECK:STDOUT: %.loc44_29.4: ref %Optional.95f = temporary_storage // CHECK:STDOUT: %.loc44_28.2: @Test.%R.as_type.loc40_69.1 (%R.as_type.f62) = acquire_value %r.ref -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.95f to %.loc44_29.2 = call %bound_method.loc44_29.4(%.loc44_28.2, %addr.loc44) -// CHECK:STDOUT: %.loc44_29.3: ref %Optional.95f = temporary %.loc44_29.2, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc44_29.4: %Optional.HasValue.type.006 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.705) [concrete = constants.%Optional.HasValue.988] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.006 = name_ref HasValue, %.loc44_29.4 [concrete = constants.%Optional.HasValue.988] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc44_29.3, %HasValue.ref +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.95f to %.loc44_29.4 = call %bound_method.loc44_29.4(%.loc44_28.2, %addr.loc44) +// CHECK:STDOUT: %.loc44_29.5: ref %Optional.95f = temporary %.loc44_29.4, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc44_29.6: %Optional.HasValue.type.006 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.705) [concrete = constants.%Optional.HasValue.988] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.006 = name_ref HasValue, %.loc44_29.6 [concrete = constants.%Optional.HasValue.988] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc44_29.5, %HasValue.ref // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.705) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc44_29.5: = bound_method %.loc44_29.3, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc44_29.5: %Optional.95f = acquire_value %.loc44_29.3 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc44_29.5(%.loc44_29.5) -// CHECK:STDOUT: %.loc44_29.6: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc44_29.7: bool = converted %Optional.HasValue.call, %.loc44_29.6 -// CHECK:STDOUT: if %.loc44_29.7 br !for.body else br !for.done +// CHECK:STDOUT: %bound_method.loc44_29.5: = bound_method %.loc44_29.5, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc44_29.7: %Optional.95f = acquire_value %.loc44_29.5 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc44_29.5(%.loc44_29.7) +// CHECK:STDOUT: %.loc44_29.8: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc44_29.9: bool = converted %Optional.HasValue.call, %.loc44_29.8 +// CHECK:STDOUT: if %.loc44_29.9 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc44_29.8: %Optional.Get.type.30f = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.705) [concrete = constants.%Optional.Get.59c] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.30f = name_ref Get, %.loc44_29.8 [concrete = constants.%Optional.Get.59c] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc44_29.3, %Get.ref +// CHECK:STDOUT: %.loc44_29.10: %Optional.Get.type.30f = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.705) [concrete = constants.%Optional.Get.59c] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.30f = name_ref Get, %.loc44_29.10 [concrete = constants.%Optional.Get.59c] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc44_29.5, %Get.ref // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.705) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc44_29.6: = bound_method %.loc44_29.3, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc44_29.9: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc44_29.10: %Optional.95f = acquire_value %.loc44_29.3 -// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc44_29.9 = call %bound_method.loc44_29.6(%.loc44_29.10) +// CHECK:STDOUT: %bound_method.loc44_29.6: = bound_method %.loc44_29.5, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc44_29.11: ref %ValueType = temporary_storage +// CHECK:STDOUT: %.loc44_29.12: %Optional.95f = acquire_value %.loc44_29.5 +// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc44_29.11 = call %bound_method.loc44_29.6(%.loc44_29.12) // CHECK:STDOUT: %.loc44_14: type = splice_block %ValueType.ref.loc44 [concrete = constants.%ValueType] { // CHECK:STDOUT: %Cpp.ref.loc44: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ValueType.ref.loc44: type = name_ref ValueType, imports.%ValueType.decl [concrete = constants.%ValueType] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc44_29.11: ref %ValueType = temporary %.loc44_29.9, %Optional.Get.call -// CHECK:STDOUT: %.loc44_29.12: %ValueType = acquire_value %.loc44_29.11 -// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc44_29.12 +// CHECK:STDOUT: %.loc44_29.13: ref %ValueType = temporary %.loc44_29.11, %Optional.Get.call +// CHECK:STDOUT: %.loc44_29.14: %ValueType = acquire_value %.loc44_29.13 +// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc44_29.14 // CHECK:STDOUT: %sum.ref: ref %ValueType = name_ref sum, %sum // CHECK:STDOUT: %i.ref: %ValueType = name_ref i, %i // CHECK:STDOUT: %ValueType.cpp_operator.bound: = bound_method %sum.ref, imports.%ValueType.cpp_operator.decl @@ -1432,14 +1442,15 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %ValueType.Op.bound.loc44: = bound_method %.loc44_29.11, constants.%ValueType.Op.4dca31.1 +// CHECK:STDOUT: %ValueType.Op.bound.loc44: = bound_method %.loc44_29.13, constants.%ValueType.Op.4dca31.1 // CHECK:STDOUT: %Op.ref.loc44: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc44: = bound_method %.loc44_29.11, %Op.ref.loc44 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc44: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc44(%.loc44_29.11) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc44_29.3, constants.%Destroy.Op.1a2547.7 -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc44_29.3) -// CHECK:STDOUT: %impl.elem0.loc44_29.1: @Test.%.loc44_29.15 (%.4b9) = impl_witness_access constants.%Destroy.lookup_impl_witness.ff8, element0 [symbolic = %impl.elem0.loc44_29.2 (constants.%impl.elem0.fbe)] +// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc44: = bound_method %.loc44_29.13, %Op.ref.loc44 +// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc44: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc44(%.loc44_29.13) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc44_29.5, constants.%Destroy.Op.1a2547.7 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc44_29.5) +// CHECK:STDOUT: %impl.elem0.loc44_29.1: @Test.%.loc44_29.18 (%.4b9) = impl_witness_access constants.%Destroy.lookup_impl_witness.ff8, element0 [symbolic = %impl.elem0.loc44_29.2 (constants.%impl.elem0.fbe)] // CHECK:STDOUT: %bound_method.loc44_29.7: = bound_method %var, %impl.elem0.loc44_29.1 +// CHECK:STDOUT: %.loc44_29.15: %Destroy.type = converted constants.%as_type.bc6, constants.%impl.elem1.411 [symbolic = %impl.elem1 (constants.%impl.elem1.411)] // CHECK:STDOUT: %specific_impl_fn.loc44_29.3: = specific_impl_function %impl.elem0.loc44_29.1, @Destroy.WithSelf.Op(constants.%impl.elem1.411) [symbolic = %specific_impl_fn.loc44_29.6 (constants.%specific_impl_fn.517)] // CHECK:STDOUT: %bound_method.loc44_29.8: = bound_method %var, %specific_impl_fn.loc44_29.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc44_29.8(%var) @@ -1488,9 +1499,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc40 => constants.%complete_type.357 // CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.096 -// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.723 +// CHECK:STDOUT: %Iterate.facet.loc44_29.3 => constants.%Iterate.facet.723 // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.47d -// CHECK:STDOUT: %.loc44_29.13 => constants.%.47d +// CHECK:STDOUT: %.loc44_29.16 => constants.%.47d // CHECK:STDOUT: %impl.elem2.loc44_29.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.498 // CHECK:STDOUT: %specific_impl_fn.loc44_29.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn.532 // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.305 @@ -1498,11 +1509,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.94f // CHECK:STDOUT: %ptr => constants.%ptr.d6b // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.6f1 -// CHECK:STDOUT: %.loc44_29.14 => constants.%.fd2 +// CHECK:STDOUT: %.loc44_29.17 => constants.%.fd2 // CHECK:STDOUT: %impl.elem3.loc44_29.2 => constants.%R.as_type.as.Iterate.impl.Next.055 // CHECK:STDOUT: %specific_impl_fn.loc44_29.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.5cb // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c89 -// CHECK:STDOUT: %.loc44_29.15 => constants.%.e8a +// CHECK:STDOUT: %.loc44_29.18 => constants.%.e8a // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.8 // CHECK:STDOUT: %impl.elem0.loc44_29.2 => constants.%Destroy.Op.1a2547.8 // CHECK:STDOUT: %specific_impl_fn.loc44_29.6 => constants.%Destroy.Op.1a2547.8 @@ -1516,9 +1527,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc40 => constants.%complete_type.357 // CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.40c -// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.c46 +// CHECK:STDOUT: %Iterate.facet.loc44_29.3 => constants.%Iterate.facet.c46 // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.cd5 -// CHECK:STDOUT: %.loc44_29.13 => constants.%.763 +// CHECK:STDOUT: %.loc44_29.16 => constants.%.763 // CHECK:STDOUT: %impl.elem2.loc44_29.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.bd2 // CHECK:STDOUT: %specific_impl_fn.loc44_29.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn.7c7 // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.e08 @@ -1526,11 +1537,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.dea // CHECK:STDOUT: %ptr => constants.%ptr.2f7 // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.285 -// CHECK:STDOUT: %.loc44_29.14 => constants.%.bca +// CHECK:STDOUT: %.loc44_29.17 => constants.%.bca // CHECK:STDOUT: %impl.elem3.loc44_29.2 => constants.%R.as_type.as.Iterate.impl.Next.c50 // CHECK:STDOUT: %specific_impl_fn.loc44_29.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.a9a // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.e30 -// CHECK:STDOUT: %.loc44_29.15 => constants.%.987 +// CHECK:STDOUT: %.loc44_29.18 => constants.%.987 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.9 // CHECK:STDOUT: %impl.elem0.loc44_29.2 => constants.%Destroy.Op.1a2547.9 // CHECK:STDOUT: %specific_impl_fn.loc44_29.6 => constants.%Destroy.Op.1a2547.9 @@ -1724,21 +1735,21 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc20_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.171)] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc20_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.523)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.51e)] -// CHECK:STDOUT: %.loc24_19.12: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc24_19.12 (constants.%.250)] -// CHECK:STDOUT: %impl.elem2.loc24_19.2: @Test.%.loc24_19.12 (%.250) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc24_19.2 (constants.%impl.elem2.9ef)] -// CHECK:STDOUT: %specific_impl_fn.loc24_19.4: = specific_impl_function %impl.elem2.loc24_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.5ff)] +// CHECK:STDOUT: %Iterate.facet.loc24_19.3: %Iterate.type = facet_value %R.as_type.loc20_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc24_19.3 (constants.%Iterate.facet.523)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc24_19.3) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.51e)] +// CHECK:STDOUT: %.loc24_19.15: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc24_19.3 [symbolic = %.loc24_19.15 (constants.%.250)] +// CHECK:STDOUT: %impl.elem2.loc24_19.2: @Test.%.loc24_19.15 (%.250) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc24_19.2 (constants.%impl.elem2.9ef)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.4: = specific_impl_function %impl.elem2.loc24_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc24_19.3) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.5ff)] // CHECK:STDOUT: // CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.b94)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.e1d)] -// CHECK:STDOUT: %.loc24_19.13: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc24_19.13 (constants.%.f81)] -// CHECK:STDOUT: %impl.elem3.loc24_19.2: @Test.%.loc24_19.13 (%.f81) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.04c)] -// CHECK:STDOUT: %specific_impl_fn.loc24_19.5: = specific_impl_function %impl.elem3.loc24_19.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.c5b)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc24_19.3) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.e1d)] +// CHECK:STDOUT: %.loc24_19.16: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc24_19.3 [symbolic = %.loc24_19.16 (constants.%.f81)] +// CHECK:STDOUT: %impl.elem3.loc24_19.2: @Test.%.loc24_19.16 (%.f81) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.04c)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.5: = specific_impl_function %impl.elem3.loc24_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc24_19.3) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.c5b)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.b9c)] -// CHECK:STDOUT: %.loc24_19.14: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc24_19.14 (constants.%.75c)] +// CHECK:STDOUT: %.loc24_19.17: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc24_19.17 (constants.%.75c)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.f8f)] -// CHECK:STDOUT: %impl.elem0.loc24_19.2: @Test.%.loc24_19.14 (%.75c) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.688)] +// CHECK:STDOUT: %impl.elem0.loc24_19.2: @Test.%.loc24_19.17 (%.75c) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.688)] // CHECK:STDOUT: %specific_impl_fn.loc24_19.6: = specific_impl_function %impl.elem0.loc24_19.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc24_19.6 (constants.%specific_impl_fn.1e0)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc20_55.1 (%R.as_type.657)) { @@ -1748,8 +1759,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.fb7 = value_binding_pattern i [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc20_55.1 (%R.as_type.657) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc24_19.1: @Test.%.loc24_19.12 (%.250) = impl_witness_access constants.%Iterate.lookup_impl_witness.171, element2 [symbolic = %impl.elem2.loc24_19.2 (constants.%impl.elem2.9ef)] +// CHECK:STDOUT: %impl.elem2.loc24_19.1: @Test.%.loc24_19.15 (%.250) = impl_witness_access constants.%Iterate.lookup_impl_witness.171, element2 [symbolic = %impl.elem2.loc24_19.2 (constants.%impl.elem2.9ef)] // CHECK:STDOUT: %bound_method.loc24_19.1: = bound_method %r.ref, %impl.elem2.loc24_19.1 +// CHECK:STDOUT: %Iterate.facet.loc24_19.1: %Iterate.type = facet_value constants.%R.as_type.657, (constants.%Iterate.lookup_impl_witness.171) [symbolic = %Iterate.facet.loc24_19.3 (constants.%Iterate.facet.523)] +// CHECK:STDOUT: %.loc24_19.1: %Iterate.type = converted constants.%R.as_type.657, %Iterate.facet.loc24_19.1 [symbolic = %Iterate.facet.loc24_19.3 (constants.%Iterate.facet.523)] // CHECK:STDOUT: %specific_impl_fn.loc24_19.1: = specific_impl_function %impl.elem2.loc24_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.523) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.5ff)] // CHECK:STDOUT: %bound_method.loc24_19.2: = bound_method %r.ref, %specific_impl_fn.loc24_19.1 // CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.6f2) = var invalid @@ -1759,37 +1772,39 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr: @Test.%ptr (%ptr.b94) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc24_19.1: @Test.%.loc24_19.13 (%.f81) = impl_witness_access constants.%Iterate.lookup_impl_witness.171, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.04c)] +// CHECK:STDOUT: %impl.elem3.loc24_19.1: @Test.%.loc24_19.16 (%.f81) = impl_witness_access constants.%Iterate.lookup_impl_witness.171, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.04c)] // CHECK:STDOUT: %bound_method.loc24_19.3: = bound_method %r.ref, %impl.elem3.loc24_19.1 -// CHECK:STDOUT: %.loc24_19.1: %Destroy.type = converted constants.%as_type.6f2, constants.%impl.elem1.f12 [symbolic = %impl.elem1 (constants.%impl.elem1.f12)] +// CHECK:STDOUT: %Iterate.facet.loc24_19.2: %Iterate.type = facet_value constants.%R.as_type.657, (constants.%Iterate.lookup_impl_witness.171) [symbolic = %Iterate.facet.loc24_19.3 (constants.%Iterate.facet.523)] +// CHECK:STDOUT: %.loc24_19.2: %Iterate.type = converted constants.%R.as_type.657, %Iterate.facet.loc24_19.2 [symbolic = %Iterate.facet.loc24_19.3 (constants.%Iterate.facet.523)] +// CHECK:STDOUT: %.loc24_19.3: %Destroy.type = converted constants.%as_type.6f2, constants.%impl.elem1.f12 [symbolic = %impl.elem1 (constants.%impl.elem1.f12)] // CHECK:STDOUT: %specific_impl_fn.loc24_19.2: = specific_impl_function %impl.elem3.loc24_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.523) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.c5b)] // CHECK:STDOUT: %bound_method.loc24_19.4: = bound_method %r.ref, %specific_impl_fn.loc24_19.2 -// CHECK:STDOUT: %.loc24_19.2: ref %Optional.f48 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.f48 to %.loc24_19.2 = call %bound_method.loc24_19.4(%r.ref, %addr) -// CHECK:STDOUT: %.loc24_19.3: ref %Optional.f48 = temporary %.loc24_19.2, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc24_19.4: %Optional.HasValue.type.d4e = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.HasValue.e79] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.d4e = name_ref HasValue, %.loc24_19.4 [concrete = constants.%Optional.HasValue.e79] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc24_19.3, %HasValue.ref +// CHECK:STDOUT: %.loc24_19.4: ref %Optional.f48 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.f48 to %.loc24_19.4 = call %bound_method.loc24_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc24_19.5: ref %Optional.f48 = temporary %.loc24_19.4, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc24_19.6: %Optional.HasValue.type.d4e = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.HasValue.e79] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.d4e = name_ref HasValue, %.loc24_19.6 [concrete = constants.%Optional.HasValue.e79] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc24_19.5, %HasValue.ref // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_19.5: = bound_method %.loc24_19.3, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc24_19.5: %Optional.f48 = acquire_value %.loc24_19.3 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc24_19.5(%.loc24_19.5) -// CHECK:STDOUT: %.loc24_19.6: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc24_19.7: bool = converted %Optional.HasValue.call, %.loc24_19.6 -// CHECK:STDOUT: if %.loc24_19.7 br !for.body else br !for.done +// CHECK:STDOUT: %bound_method.loc24_19.5: = bound_method %.loc24_19.5, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc24_19.7: %Optional.f48 = acquire_value %.loc24_19.5 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc24_19.5(%.loc24_19.7) +// CHECK:STDOUT: %.loc24_19.8: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc24_19.9: bool = converted %Optional.HasValue.call, %.loc24_19.8 +// CHECK:STDOUT: if %.loc24_19.9 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc24_19.8: %Optional.Get.type.822 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.Get.f05] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.822 = name_ref Get, %.loc24_19.8 [concrete = constants.%Optional.Get.f05] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc24_19.3, %Get.ref +// CHECK:STDOUT: %.loc24_19.10: %Optional.Get.type.822 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.Get.f05] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.822 = name_ref Get, %.loc24_19.10 [concrete = constants.%Optional.Get.f05] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc24_19.5, %Get.ref // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_19.6: = bound_method %.loc24_19.3, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc24_19.9: %Optional.f48 = acquire_value %.loc24_19.3 -// CHECK:STDOUT: %Optional.Get.call: init %f64.dc1 = call %bound_method.loc24_19.6(%.loc24_19.9) +// CHECK:STDOUT: %bound_method.loc24_19.6: = bound_method %.loc24_19.5, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc24_19.11: %Optional.f48 = acquire_value %.loc24_19.5 +// CHECK:STDOUT: %Optional.Get.call: init %f64.dc1 = call %bound_method.loc24_19.6(%.loc24_19.11) // CHECK:STDOUT: %f64.loc24: type = type_literal constants.%f64.dc1 [concrete = constants.%f64.dc1] -// CHECK:STDOUT: %.loc24_19.10: %f64.dc1 = value_of_initializer %Optional.Get.call -// CHECK:STDOUT: %.loc24_19.11: %f64.dc1 = converted %Optional.Get.call, %.loc24_19.10 -// CHECK:STDOUT: %i: %f64.dc1 = value_binding i, %.loc24_19.11 +// CHECK:STDOUT: %.loc24_19.12: %f64.dc1 = value_of_initializer %Optional.Get.call +// CHECK:STDOUT: %.loc24_19.13: %f64.dc1 = converted %Optional.Get.call, %.loc24_19.12 +// CHECK:STDOUT: %i: %f64.dc1 = value_binding i, %.loc24_19.13 // CHECK:STDOUT: %sum.ref: ref %f64.dc1 = name_ref sum, %sum // CHECK:STDOUT: %i.ref: %f64.dc1 = name_ref i, %i // CHECK:STDOUT: %impl.elem0.loc25: %.746 = impl_witness_access constants.%AddAssignWith.impl_witness.e85, element0 [concrete = constants.%Float.as.AddAssignWith.impl.Op.ac1] @@ -1800,10 +1815,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %.loc24_19.3, constants.%Destroy.Op.1a2547.9 -// CHECK:STDOUT: %Destroy.Op.call.loc24: init %empty_tuple.type = call %Destroy.Op.bound.loc24(%.loc24_19.3) -// CHECK:STDOUT: %impl.elem0.loc24_19.1: @Test.%.loc24_19.14 (%.75c) = impl_witness_access constants.%Destroy.lookup_impl_witness.f8f, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.688)] +// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %.loc24_19.5, constants.%Destroy.Op.1a2547.9 +// CHECK:STDOUT: %Destroy.Op.call.loc24: init %empty_tuple.type = call %Destroy.Op.bound.loc24(%.loc24_19.5) +// CHECK:STDOUT: %impl.elem0.loc24_19.1: @Test.%.loc24_19.17 (%.75c) = impl_witness_access constants.%Destroy.lookup_impl_witness.f8f, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.688)] // CHECK:STDOUT: %bound_method.loc24_19.7: = bound_method %var, %impl.elem0.loc24_19.1 +// CHECK:STDOUT: %.loc24_19.14: %Destroy.type = converted constants.%as_type.6f2, constants.%impl.elem1.f12 [symbolic = %impl.elem1 (constants.%impl.elem1.f12)] // CHECK:STDOUT: %specific_impl_fn.loc24_19.3: = specific_impl_function %impl.elem0.loc24_19.1, @Destroy.WithSelf.Op(constants.%impl.elem1.f12) [symbolic = %specific_impl_fn.loc24_19.6 (constants.%specific_impl_fn.1e0)] // CHECK:STDOUT: %bound_method.loc24_19.8: = bound_method %var, %specific_impl_fn.loc24_19.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc24_19.8(%var) @@ -1852,9 +1868,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc20 => constants.%complete_type.357 // CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.1f0 -// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.9f4 +// CHECK:STDOUT: %Iterate.facet.loc24_19.3 => constants.%Iterate.facet.9f4 // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.d89 -// CHECK:STDOUT: %.loc24_19.12 => constants.%.e0f +// CHECK:STDOUT: %.loc24_19.15 => constants.%.e0f // CHECK:STDOUT: %impl.elem2.loc24_19.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.d2e // CHECK:STDOUT: %specific_impl_fn.loc24_19.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.40b @@ -1862,11 +1878,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.320 // CHECK:STDOUT: %ptr => constants.%ptr.d1a // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.64f -// CHECK:STDOUT: %.loc24_19.13 => constants.%.50c +// CHECK:STDOUT: %.loc24_19.16 => constants.%.50c // CHECK:STDOUT: %impl.elem3.loc24_19.2 => constants.%R.as_type.as.Iterate.impl.Next.0b7 // CHECK:STDOUT: %specific_impl_fn.loc24_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.117 -// CHECK:STDOUT: %.loc24_19.14 => constants.%.5a4 +// CHECK:STDOUT: %.loc24_19.17 => constants.%.5a4 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.10 // CHECK:STDOUT: %impl.elem0.loc24_19.2 => constants.%Destroy.Op.1a2547.10 // CHECK:STDOUT: %specific_impl_fn.loc24_19.6 => constants.%Destroy.Op.1a2547.10 @@ -2060,21 +2076,21 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc22_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.171)] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc22_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.523)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.51e)] -// CHECK:STDOUT: %.loc26_19.12: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc26_19.12 (constants.%.250)] -// CHECK:STDOUT: %impl.elem2.loc26_19.2: @Test.%.loc26_19.12 (%.250) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc26_19.2 (constants.%impl.elem2.9ef)] -// CHECK:STDOUT: %specific_impl_fn.loc26_19.4: = specific_impl_function %impl.elem2.loc26_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.5ff)] +// CHECK:STDOUT: %Iterate.facet.loc26_19.3: %Iterate.type = facet_value %R.as_type.loc22_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc26_19.3 (constants.%Iterate.facet.523)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc26_19.3) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.51e)] +// CHECK:STDOUT: %.loc26_19.15: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc26_19.3 [symbolic = %.loc26_19.15 (constants.%.250)] +// CHECK:STDOUT: %impl.elem2.loc26_19.2: @Test.%.loc26_19.15 (%.250) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc26_19.2 (constants.%impl.elem2.9ef)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.4: = specific_impl_function %impl.elem2.loc26_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc26_19.3) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.5ff)] // CHECK:STDOUT: // CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.b94)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.e1d)] -// CHECK:STDOUT: %.loc26_19.13: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc26_19.13 (constants.%.f81)] -// CHECK:STDOUT: %impl.elem3.loc26_19.2: @Test.%.loc26_19.13 (%.f81) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.04c)] -// CHECK:STDOUT: %specific_impl_fn.loc26_19.5: = specific_impl_function %impl.elem3.loc26_19.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.c5b)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc26_19.3) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.e1d)] +// CHECK:STDOUT: %.loc26_19.16: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc26_19.3 [symbolic = %.loc26_19.16 (constants.%.f81)] +// CHECK:STDOUT: %impl.elem3.loc26_19.2: @Test.%.loc26_19.16 (%.f81) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.04c)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.5: = specific_impl_function %impl.elem3.loc26_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc26_19.3) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.c5b)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.b9c)] -// CHECK:STDOUT: %.loc26_19.14: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc26_19.14 (constants.%.75c)] +// CHECK:STDOUT: %.loc26_19.17: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc26_19.17 (constants.%.75c)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.f8f)] -// CHECK:STDOUT: %impl.elem0.loc26_19.2: @Test.%.loc26_19.14 (%.75c) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.688)] +// CHECK:STDOUT: %impl.elem0.loc26_19.2: @Test.%.loc26_19.17 (%.75c) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.688)] // CHECK:STDOUT: %specific_impl_fn.loc26_19.6: = specific_impl_function %impl.elem0.loc26_19.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc26_19.6 (constants.%specific_impl_fn.1e0)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc22_55.1 (%R.as_type.657)) { @@ -2084,8 +2100,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.fb7 = value_binding_pattern i [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc22_55.1 (%R.as_type.657) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc26_19.1: @Test.%.loc26_19.12 (%.250) = impl_witness_access constants.%Iterate.lookup_impl_witness.171, element2 [symbolic = %impl.elem2.loc26_19.2 (constants.%impl.elem2.9ef)] +// CHECK:STDOUT: %impl.elem2.loc26_19.1: @Test.%.loc26_19.15 (%.250) = impl_witness_access constants.%Iterate.lookup_impl_witness.171, element2 [symbolic = %impl.elem2.loc26_19.2 (constants.%impl.elem2.9ef)] // CHECK:STDOUT: %bound_method.loc26_19.1: = bound_method %r.ref, %impl.elem2.loc26_19.1 +// CHECK:STDOUT: %Iterate.facet.loc26_19.1: %Iterate.type = facet_value constants.%R.as_type.657, (constants.%Iterate.lookup_impl_witness.171) [symbolic = %Iterate.facet.loc26_19.3 (constants.%Iterate.facet.523)] +// CHECK:STDOUT: %.loc26_19.1: %Iterate.type = converted constants.%R.as_type.657, %Iterate.facet.loc26_19.1 [symbolic = %Iterate.facet.loc26_19.3 (constants.%Iterate.facet.523)] // CHECK:STDOUT: %specific_impl_fn.loc26_19.1: = specific_impl_function %impl.elem2.loc26_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.523) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.5ff)] // CHECK:STDOUT: %bound_method.loc26_19.2: = bound_method %r.ref, %specific_impl_fn.loc26_19.1 // CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.6f2) = var invalid @@ -2095,37 +2113,39 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr: @Test.%ptr (%ptr.b94) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc26_19.1: @Test.%.loc26_19.13 (%.f81) = impl_witness_access constants.%Iterate.lookup_impl_witness.171, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.04c)] +// CHECK:STDOUT: %impl.elem3.loc26_19.1: @Test.%.loc26_19.16 (%.f81) = impl_witness_access constants.%Iterate.lookup_impl_witness.171, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.04c)] // CHECK:STDOUT: %bound_method.loc26_19.3: = bound_method %r.ref, %impl.elem3.loc26_19.1 -// CHECK:STDOUT: %.loc26_19.1: %Destroy.type = converted constants.%as_type.6f2, constants.%impl.elem1.f12 [symbolic = %impl.elem1 (constants.%impl.elem1.f12)] +// CHECK:STDOUT: %Iterate.facet.loc26_19.2: %Iterate.type = facet_value constants.%R.as_type.657, (constants.%Iterate.lookup_impl_witness.171) [symbolic = %Iterate.facet.loc26_19.3 (constants.%Iterate.facet.523)] +// CHECK:STDOUT: %.loc26_19.2: %Iterate.type = converted constants.%R.as_type.657, %Iterate.facet.loc26_19.2 [symbolic = %Iterate.facet.loc26_19.3 (constants.%Iterate.facet.523)] +// CHECK:STDOUT: %.loc26_19.3: %Destroy.type = converted constants.%as_type.6f2, constants.%impl.elem1.f12 [symbolic = %impl.elem1 (constants.%impl.elem1.f12)] // CHECK:STDOUT: %specific_impl_fn.loc26_19.2: = specific_impl_function %impl.elem3.loc26_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.523) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.c5b)] // CHECK:STDOUT: %bound_method.loc26_19.4: = bound_method %r.ref, %specific_impl_fn.loc26_19.2 -// CHECK:STDOUT: %.loc26_19.2: ref %Optional.f48 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.f48 to %.loc26_19.2 = call %bound_method.loc26_19.4(%r.ref, %addr) -// CHECK:STDOUT: %.loc26_19.3: ref %Optional.f48 = temporary %.loc26_19.2, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc26_19.4: %Optional.HasValue.type.d4e = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.HasValue.e79] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.d4e = name_ref HasValue, %.loc26_19.4 [concrete = constants.%Optional.HasValue.e79] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc26_19.3, %HasValue.ref +// CHECK:STDOUT: %.loc26_19.4: ref %Optional.f48 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.f48 to %.loc26_19.4 = call %bound_method.loc26_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc26_19.5: ref %Optional.f48 = temporary %.loc26_19.4, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc26_19.6: %Optional.HasValue.type.d4e = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.HasValue.e79] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.d4e = name_ref HasValue, %.loc26_19.6 [concrete = constants.%Optional.HasValue.e79] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc26_19.5, %HasValue.ref // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc26_19.5: = bound_method %.loc26_19.3, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc26_19.5: %Optional.f48 = acquire_value %.loc26_19.3 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc26_19.5(%.loc26_19.5) -// CHECK:STDOUT: %.loc26_19.6: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc26_19.7: bool = converted %Optional.HasValue.call, %.loc26_19.6 -// CHECK:STDOUT: if %.loc26_19.7 br !for.body else br !for.done +// CHECK:STDOUT: %bound_method.loc26_19.5: = bound_method %.loc26_19.5, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc26_19.7: %Optional.f48 = acquire_value %.loc26_19.5 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc26_19.5(%.loc26_19.7) +// CHECK:STDOUT: %.loc26_19.8: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc26_19.9: bool = converted %Optional.HasValue.call, %.loc26_19.8 +// CHECK:STDOUT: if %.loc26_19.9 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc26_19.8: %Optional.Get.type.822 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.Get.f05] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.822 = name_ref Get, %.loc26_19.8 [concrete = constants.%Optional.Get.f05] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc26_19.3, %Get.ref +// CHECK:STDOUT: %.loc26_19.10: %Optional.Get.type.822 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.Get.f05] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.822 = name_ref Get, %.loc26_19.10 [concrete = constants.%Optional.Get.f05] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc26_19.5, %Get.ref // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.cc1) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc26_19.6: = bound_method %.loc26_19.3, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc26_19.9: %Optional.f48 = acquire_value %.loc26_19.3 -// CHECK:STDOUT: %Optional.Get.call: init %f64.dc1 = call %bound_method.loc26_19.6(%.loc26_19.9) +// CHECK:STDOUT: %bound_method.loc26_19.6: = bound_method %.loc26_19.5, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc26_19.11: %Optional.f48 = acquire_value %.loc26_19.5 +// CHECK:STDOUT: %Optional.Get.call: init %f64.dc1 = call %bound_method.loc26_19.6(%.loc26_19.11) // CHECK:STDOUT: %f64.loc26: type = type_literal constants.%f64.dc1 [concrete = constants.%f64.dc1] -// CHECK:STDOUT: %.loc26_19.10: %f64.dc1 = value_of_initializer %Optional.Get.call -// CHECK:STDOUT: %.loc26_19.11: %f64.dc1 = converted %Optional.Get.call, %.loc26_19.10 -// CHECK:STDOUT: %i: %f64.dc1 = value_binding i, %.loc26_19.11 +// CHECK:STDOUT: %.loc26_19.12: %f64.dc1 = value_of_initializer %Optional.Get.call +// CHECK:STDOUT: %.loc26_19.13: %f64.dc1 = converted %Optional.Get.call, %.loc26_19.12 +// CHECK:STDOUT: %i: %f64.dc1 = value_binding i, %.loc26_19.13 // CHECK:STDOUT: %sum.ref: ref %f64.dc1 = name_ref sum, %sum // CHECK:STDOUT: %i.ref: %f64.dc1 = name_ref i, %i // CHECK:STDOUT: %impl.elem0.loc27: %.746 = impl_witness_access constants.%AddAssignWith.impl_witness.e85, element0 [concrete = constants.%Float.as.AddAssignWith.impl.Op.ac1] @@ -2136,10 +2156,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %.loc26_19.3, constants.%Destroy.Op.1a2547.9 -// CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call %Destroy.Op.bound.loc26(%.loc26_19.3) -// CHECK:STDOUT: %impl.elem0.loc26_19.1: @Test.%.loc26_19.14 (%.75c) = impl_witness_access constants.%Destroy.lookup_impl_witness.f8f, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.688)] +// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %.loc26_19.5, constants.%Destroy.Op.1a2547.9 +// CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call %Destroy.Op.bound.loc26(%.loc26_19.5) +// CHECK:STDOUT: %impl.elem0.loc26_19.1: @Test.%.loc26_19.17 (%.75c) = impl_witness_access constants.%Destroy.lookup_impl_witness.f8f, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.688)] // CHECK:STDOUT: %bound_method.loc26_19.7: = bound_method %var, %impl.elem0.loc26_19.1 +// CHECK:STDOUT: %.loc26_19.14: %Destroy.type = converted constants.%as_type.6f2, constants.%impl.elem1.f12 [symbolic = %impl.elem1 (constants.%impl.elem1.f12)] // CHECK:STDOUT: %specific_impl_fn.loc26_19.3: = specific_impl_function %impl.elem0.loc26_19.1, @Destroy.WithSelf.Op(constants.%impl.elem1.f12) [symbolic = %specific_impl_fn.loc26_19.6 (constants.%specific_impl_fn.1e0)] // CHECK:STDOUT: %bound_method.loc26_19.8: = bound_method %var, %specific_impl_fn.loc26_19.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc26_19.8(%var) @@ -2188,9 +2209,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc22 => constants.%complete_type.357 // CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.5f7 -// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.c9f +// CHECK:STDOUT: %Iterate.facet.loc26_19.3 => constants.%Iterate.facet.c9f // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.bde -// CHECK:STDOUT: %.loc26_19.12 => constants.%.c29a +// CHECK:STDOUT: %.loc26_19.15 => constants.%.c29a // CHECK:STDOUT: %impl.elem2.loc26_19.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.41a // CHECK:STDOUT: %specific_impl_fn.loc26_19.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.e1e @@ -2198,11 +2219,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.843 // CHECK:STDOUT: %ptr => constants.%ptr.a4f // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.454 -// CHECK:STDOUT: %.loc26_19.13 => constants.%.b4c +// CHECK:STDOUT: %.loc26_19.16 => constants.%.b4c // CHECK:STDOUT: %impl.elem3.loc26_19.2 => constants.%R.as_type.as.Iterate.impl.Next.928 // CHECK:STDOUT: %specific_impl_fn.loc26_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.452 -// CHECK:STDOUT: %.loc26_19.14 => constants.%.899 +// CHECK:STDOUT: %.loc26_19.17 => constants.%.899 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.10 // CHECK:STDOUT: %impl.elem0.loc26_19.2 => constants.%Destroy.Op.1a2547.10 // CHECK:STDOUT: %specific_impl_fn.loc26_19.6 => constants.%Destroy.Op.1a2547.10 @@ -2422,21 +2443,21 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc27_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.8b4)] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc27_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.b19)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.217)] -// CHECK:STDOUT: %.loc31_31.13: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc31_31.13 (constants.%.a27)] -// CHECK:STDOUT: %impl.elem2.loc31_31.2: @Test.%.loc31_31.13 (%.a27) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_31.2 (constants.%impl.elem2.7c0)] -// CHECK:STDOUT: %specific_impl_fn.loc31_31.4: = specific_impl_function %impl.elem2.loc31_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc31_31.4 (constants.%specific_impl_fn.e23)] +// CHECK:STDOUT: %Iterate.facet.loc31_31.3: %Iterate.type = facet_value %R.as_type.loc27_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc31_31.3 (constants.%Iterate.facet.b19)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc31_31.3) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.217)] +// CHECK:STDOUT: %.loc31_31.16: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc31_31.3 [symbolic = %.loc31_31.16 (constants.%.a27)] +// CHECK:STDOUT: %impl.elem2.loc31_31.2: @Test.%.loc31_31.16 (%.a27) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_31.2 (constants.%impl.elem2.7c0)] +// CHECK:STDOUT: %specific_impl_fn.loc31_31.4: = specific_impl_function %impl.elem2.loc31_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc31_31.3) [symbolic = %specific_impl_fn.loc31_31.4 (constants.%specific_impl_fn.e23)] // CHECK:STDOUT: // CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.530)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.10a)] -// CHECK:STDOUT: %.loc31_31.14: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc31_31.14 (constants.%.df57)] -// CHECK:STDOUT: %impl.elem3.loc31_31.2: @Test.%.loc31_31.14 (%.df57) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_31.2 (constants.%impl.elem3.199)] -// CHECK:STDOUT: %specific_impl_fn.loc31_31.5: = specific_impl_function %impl.elem3.loc31_31.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc31_31.5 (constants.%specific_impl_fn.169)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc31_31.3) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.10a)] +// CHECK:STDOUT: %.loc31_31.17: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc31_31.3 [symbolic = %.loc31_31.17 (constants.%.df57)] +// CHECK:STDOUT: %impl.elem3.loc31_31.2: @Test.%.loc31_31.17 (%.df57) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_31.2 (constants.%impl.elem3.199)] +// CHECK:STDOUT: %specific_impl_fn.loc31_31.5: = specific_impl_function %impl.elem3.loc31_31.2, @Iterate.WithSelf.Next(%Iterate.facet.loc31_31.3) [symbolic = %specific_impl_fn.loc31_31.5 (constants.%specific_impl_fn.169)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.e7e)] -// CHECK:STDOUT: %.loc31_31.15: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc31_31.15 (constants.%.bc1)] +// CHECK:STDOUT: %.loc31_31.18: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc31_31.18 (constants.%.bc1)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.f37)] -// CHECK:STDOUT: %impl.elem0.loc31_31.2: @Test.%.loc31_31.15 (%.bc1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc31_31.2 (constants.%impl.elem0.c7c)] +// CHECK:STDOUT: %impl.elem0.loc31_31.2: @Test.%.loc31_31.18 (%.bc1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc31_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %specific_impl_fn.loc31_31.6: = specific_impl_function %impl.elem0.loc31_31.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc31_31.6 (constants.%specific_impl_fn.cd3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc27_67.1 (%R.as_type.a62)) { @@ -2446,8 +2467,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.e41 = value_binding_pattern i [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc27_67.1 (%R.as_type.a62) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc31_31.1: @Test.%.loc31_31.13 (%.a27) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element2 [symbolic = %impl.elem2.loc31_31.2 (constants.%impl.elem2.7c0)] +// CHECK:STDOUT: %impl.elem2.loc31_31.1: @Test.%.loc31_31.16 (%.a27) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element2 [symbolic = %impl.elem2.loc31_31.2 (constants.%impl.elem2.7c0)] // CHECK:STDOUT: %bound_method.loc31_31.1: = bound_method %r.ref, %impl.elem2.loc31_31.1 +// CHECK:STDOUT: %Iterate.facet.loc31_31.1: %Iterate.type = facet_value constants.%R.as_type.a62, (constants.%Iterate.lookup_impl_witness.8b4) [symbolic = %Iterate.facet.loc31_31.3 (constants.%Iterate.facet.b19)] +// CHECK:STDOUT: %.loc31_31.1: %Iterate.type = converted constants.%R.as_type.a62, %Iterate.facet.loc31_31.1 [symbolic = %Iterate.facet.loc31_31.3 (constants.%Iterate.facet.b19)] // CHECK:STDOUT: %specific_impl_fn.loc31_31.1: = specific_impl_function %impl.elem2.loc31_31.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.b19) [symbolic = %specific_impl_fn.loc31_31.4 (constants.%specific_impl_fn.e23)] // CHECK:STDOUT: %bound_method.loc31_31.2: = bound_method %r.ref, %specific_impl_fn.loc31_31.1 // CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.862) = var invalid @@ -2457,42 +2480,44 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc31: @Test.%ptr (%ptr.530) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc31_31.1: @Test.%.loc31_31.14 (%.df57) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element3 [symbolic = %impl.elem3.loc31_31.2 (constants.%impl.elem3.199)] +// CHECK:STDOUT: %impl.elem3.loc31_31.1: @Test.%.loc31_31.17 (%.df57) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element3 [symbolic = %impl.elem3.loc31_31.2 (constants.%impl.elem3.199)] // CHECK:STDOUT: %bound_method.loc31_31.3: = bound_method %r.ref, %impl.elem3.loc31_31.1 -// CHECK:STDOUT: %.loc31_31.1: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] +// CHECK:STDOUT: %Iterate.facet.loc31_31.2: %Iterate.type = facet_value constants.%R.as_type.a62, (constants.%Iterate.lookup_impl_witness.8b4) [symbolic = %Iterate.facet.loc31_31.3 (constants.%Iterate.facet.b19)] +// CHECK:STDOUT: %.loc31_31.2: %Iterate.type = converted constants.%R.as_type.a62, %Iterate.facet.loc31_31.2 [symbolic = %Iterate.facet.loc31_31.3 (constants.%Iterate.facet.b19)] +// CHECK:STDOUT: %.loc31_31.3: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] // CHECK:STDOUT: %specific_impl_fn.loc31_31.2: = specific_impl_function %impl.elem3.loc31_31.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.b19) [symbolic = %specific_impl_fn.loc31_31.5 (constants.%specific_impl_fn.169)] // CHECK:STDOUT: %bound_method.loc31_31.4: = bound_method %r.ref, %specific_impl_fn.loc31_31.2 -// CHECK:STDOUT: %.loc31_31.2: ref %Optional.552 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.552 to %.loc31_31.2 = call %bound_method.loc31_31.4(%r.ref, %addr.loc31) -// CHECK:STDOUT: %.loc31_31.3: ref %Optional.552 = temporary %.loc31_31.2, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc31_31.4: %Optional.HasValue.type.109 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.HasValue.605] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.109 = name_ref HasValue, %.loc31_31.4 [concrete = constants.%Optional.HasValue.605] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc31_31.3, %HasValue.ref +// CHECK:STDOUT: %.loc31_31.4: ref %Optional.552 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.552 to %.loc31_31.4 = call %bound_method.loc31_31.4(%r.ref, %addr.loc31) +// CHECK:STDOUT: %.loc31_31.5: ref %Optional.552 = temporary %.loc31_31.4, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc31_31.6: %Optional.HasValue.type.109 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.HasValue.605] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.109 = name_ref HasValue, %.loc31_31.6 [concrete = constants.%Optional.HasValue.605] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc31_31.5, %HasValue.ref // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc31_31.5: = bound_method %.loc31_31.3, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc31_31.5: %Optional.552 = acquire_value %.loc31_31.3 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc31_31.5(%.loc31_31.5) -// CHECK:STDOUT: %.loc31_31.6: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc31_31.7: bool = converted %Optional.HasValue.call, %.loc31_31.6 -// CHECK:STDOUT: if %.loc31_31.7 br !for.body else br !for.done +// CHECK:STDOUT: %bound_method.loc31_31.5: = bound_method %.loc31_31.5, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc31_31.7: %Optional.552 = acquire_value %.loc31_31.5 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc31_31.5(%.loc31_31.7) +// CHECK:STDOUT: %.loc31_31.8: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc31_31.9: bool = converted %Optional.HasValue.call, %.loc31_31.8 +// CHECK:STDOUT: if %.loc31_31.9 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc31_31.8: %Optional.Get.type.135 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.Get.5aa] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.135 = name_ref Get, %.loc31_31.8 [concrete = constants.%Optional.Get.5aa] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc31_31.3, %Get.ref +// CHECK:STDOUT: %.loc31_31.10: %Optional.Get.type.135 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.Get.5aa] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.135 = name_ref Get, %.loc31_31.10 [concrete = constants.%Optional.Get.5aa] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc31_31.5, %Get.ref // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc31_31.6: = bound_method %.loc31_31.3, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc31_31.9: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc31_31.10: %Optional.552 = acquire_value %.loc31_31.3 -// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc31_31.9 = call %bound_method.loc31_31.6(%.loc31_31.10) +// CHECK:STDOUT: %bound_method.loc31_31.6: = bound_method %.loc31_31.5, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc31_31.11: ref %ValueType = temporary_storage +// CHECK:STDOUT: %.loc31_31.12: %Optional.552 = acquire_value %.loc31_31.5 +// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc31_31.11 = call %bound_method.loc31_31.6(%.loc31_31.12) // CHECK:STDOUT: %.loc31_16: type = splice_block %ValueType.ref.loc31 [concrete = constants.%ValueType] { // CHECK:STDOUT: %Cpp.ref.loc31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc31: = name_ref N, imports.%N [concrete = imports.%N] // CHECK:STDOUT: %ValueType.ref.loc31: type = name_ref ValueType, imports.%ValueType.decl [concrete = constants.%ValueType] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc31_31.11: ref %ValueType = temporary %.loc31_31.9, %Optional.Get.call -// CHECK:STDOUT: %.loc31_31.12: %ValueType = acquire_value %.loc31_31.11 -// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc31_31.12 +// CHECK:STDOUT: %.loc31_31.13: ref %ValueType = temporary %.loc31_31.11, %Optional.Get.call +// CHECK:STDOUT: %.loc31_31.14: %ValueType = acquire_value %.loc31_31.13 +// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc31_31.14 // CHECK:STDOUT: %sum.ref: ref %ValueType = name_ref sum, %sum // CHECK:STDOUT: %i.ref: %ValueType = name_ref i, %i // CHECK:STDOUT: %ValueType.cpp_operator.bound: = bound_method %sum.ref, imports.%ValueType.cpp_operator.decl @@ -2504,14 +2529,15 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %ValueType.Op.bound.loc31: = bound_method %.loc31_31.11, constants.%ValueType.Op.4c94b9.1 +// CHECK:STDOUT: %ValueType.Op.bound.loc31: = bound_method %.loc31_31.13, constants.%ValueType.Op.4c94b9.1 // CHECK:STDOUT: %Op.ref.loc31: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc31: = bound_method %.loc31_31.11, %Op.ref.loc31 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc31: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc31(%.loc31_31.11) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc31_31.3, constants.%Destroy.Op.1a2547.7 -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc31_31.3) -// CHECK:STDOUT: %impl.elem0.loc31_31.1: @Test.%.loc31_31.15 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc31_31.2 (constants.%impl.elem0.c7c)] +// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc31: = bound_method %.loc31_31.13, %Op.ref.loc31 +// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc31: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc31(%.loc31_31.13) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc31_31.5, constants.%Destroy.Op.1a2547.7 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc31_31.5) +// CHECK:STDOUT: %impl.elem0.loc31_31.1: @Test.%.loc31_31.18 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc31_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %bound_method.loc31_31.7: = bound_method %var, %impl.elem0.loc31_31.1 +// CHECK:STDOUT: %.loc31_31.15: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] // CHECK:STDOUT: %specific_impl_fn.loc31_31.3: = specific_impl_function %impl.elem0.loc31_31.1, @Destroy.WithSelf.Op(constants.%impl.elem1.46a) [symbolic = %specific_impl_fn.loc31_31.6 (constants.%specific_impl_fn.cd3)] // CHECK:STDOUT: %bound_method.loc31_31.8: = bound_method %var, %specific_impl_fn.loc31_31.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc31_31.8(%var) @@ -2560,9 +2586,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc27 => constants.%complete_type.357 // CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.466 -// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.099 +// CHECK:STDOUT: %Iterate.facet.loc31_31.3 => constants.%Iterate.facet.099 // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.e43 -// CHECK:STDOUT: %.loc31_31.13 => constants.%.da4e +// CHECK:STDOUT: %.loc31_31.16 => constants.%.da4e // CHECK:STDOUT: %impl.elem2.loc31_31.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.a27 // CHECK:STDOUT: %specific_impl_fn.loc31_31.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.777 @@ -2570,11 +2596,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.e35 // CHECK:STDOUT: %ptr => constants.%ptr.fc0 // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.be4 -// CHECK:STDOUT: %.loc31_31.14 => constants.%.4b8 +// CHECK:STDOUT: %.loc31_31.17 => constants.%.4b8 // CHECK:STDOUT: %impl.elem3.loc31_31.2 => constants.%R.as_type.as.Iterate.impl.Next.bf3 // CHECK:STDOUT: %specific_impl_fn.loc31_31.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.589 -// CHECK:STDOUT: %.loc31_31.15 => constants.%.4e1 +// CHECK:STDOUT: %.loc31_31.18 => constants.%.4e1 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.8 // CHECK:STDOUT: %impl.elem0.loc31_31.2 => constants.%Destroy.Op.1a2547.8 // CHECK:STDOUT: %specific_impl_fn.loc31_31.6 => constants.%Destroy.Op.1a2547.8 @@ -2705,21 +2731,21 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc28_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.8b4)] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc28_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.217)] -// CHECK:STDOUT: %.loc32_31.13: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc32_31.13 (constants.%.a27)] -// CHECK:STDOUT: %impl.elem2.loc32_31.2: @Test.%.loc32_31.13 (%.a27) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc32_31.2 (constants.%impl.elem2.7c0)] -// CHECK:STDOUT: %specific_impl_fn.loc32_31.4: = specific_impl_function %impl.elem2.loc32_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc32_31.4 (constants.%specific_impl_fn.e23)] +// CHECK:STDOUT: %Iterate.facet.loc32_31.3: %Iterate.type = facet_value %R.as_type.loc28_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc32_31.3 (constants.%Iterate.facet)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc32_31.3) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.217)] +// CHECK:STDOUT: %.loc32_31.16: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc32_31.3 [symbolic = %.loc32_31.16 (constants.%.a27)] +// CHECK:STDOUT: %impl.elem2.loc32_31.2: @Test.%.loc32_31.16 (%.a27) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc32_31.2 (constants.%impl.elem2.7c0)] +// CHECK:STDOUT: %specific_impl_fn.loc32_31.4: = specific_impl_function %impl.elem2.loc32_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc32_31.3) [symbolic = %specific_impl_fn.loc32_31.4 (constants.%specific_impl_fn.e23)] // CHECK:STDOUT: // CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.530)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.10a)] -// CHECK:STDOUT: %.loc32_31.14: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc32_31.14 (constants.%.df57)] -// CHECK:STDOUT: %impl.elem3.loc32_31.2: @Test.%.loc32_31.14 (%.df57) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc32_31.2 (constants.%impl.elem3.199)] -// CHECK:STDOUT: %specific_impl_fn.loc32_31.5: = specific_impl_function %impl.elem3.loc32_31.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc32_31.5 (constants.%specific_impl_fn.169)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc32_31.3) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.10a)] +// CHECK:STDOUT: %.loc32_31.17: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc32_31.3 [symbolic = %.loc32_31.17 (constants.%.df57)] +// CHECK:STDOUT: %impl.elem3.loc32_31.2: @Test.%.loc32_31.17 (%.df57) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc32_31.2 (constants.%impl.elem3.199)] +// CHECK:STDOUT: %specific_impl_fn.loc32_31.5: = specific_impl_function %impl.elem3.loc32_31.2, @Iterate.WithSelf.Next(%Iterate.facet.loc32_31.3) [symbolic = %specific_impl_fn.loc32_31.5 (constants.%specific_impl_fn.169)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.e7e)] -// CHECK:STDOUT: %.loc32_31.15: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc32_31.15 (constants.%.bc1)] +// CHECK:STDOUT: %.loc32_31.18: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc32_31.18 (constants.%.bc1)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.f37)] -// CHECK:STDOUT: %impl.elem0.loc32_31.2: @Test.%.loc32_31.15 (%.bc1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc32_31.2 (constants.%impl.elem0.c7c)] +// CHECK:STDOUT: %impl.elem0.loc32_31.2: @Test.%.loc32_31.18 (%.bc1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc32_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %specific_impl_fn.loc32_31.6: = specific_impl_function %impl.elem0.loc32_31.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc32_31.6 (constants.%specific_impl_fn.cd3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc28_67.1 (%R.as_type.a62)) { @@ -2729,8 +2755,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.e41 = value_binding_pattern i [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc28_67.1 (%R.as_type.a62) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc32_31.1: @Test.%.loc32_31.13 (%.a27) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element2 [symbolic = %impl.elem2.loc32_31.2 (constants.%impl.elem2.7c0)] +// CHECK:STDOUT: %impl.elem2.loc32_31.1: @Test.%.loc32_31.16 (%.a27) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element2 [symbolic = %impl.elem2.loc32_31.2 (constants.%impl.elem2.7c0)] // CHECK:STDOUT: %bound_method.loc32_31.1: = bound_method %r.ref, %impl.elem2.loc32_31.1 +// CHECK:STDOUT: %Iterate.facet.loc32_31.1: %Iterate.type = facet_value constants.%R.as_type.a62, (constants.%Iterate.lookup_impl_witness.8b4) [symbolic = %Iterate.facet.loc32_31.3 (constants.%Iterate.facet)] +// CHECK:STDOUT: %.loc32_31.1: %Iterate.type = converted constants.%R.as_type.a62, %Iterate.facet.loc32_31.1 [symbolic = %Iterate.facet.loc32_31.3 (constants.%Iterate.facet)] // CHECK:STDOUT: %specific_impl_fn.loc32_31.1: = specific_impl_function %impl.elem2.loc32_31.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet) [symbolic = %specific_impl_fn.loc32_31.4 (constants.%specific_impl_fn.e23)] // CHECK:STDOUT: %bound_method.loc32_31.2: = bound_method %r.ref, %specific_impl_fn.loc32_31.1 // CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.862) = var invalid @@ -2740,42 +2768,44 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc32: @Test.%ptr (%ptr.530) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc32_31.1: @Test.%.loc32_31.14 (%.df57) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element3 [symbolic = %impl.elem3.loc32_31.2 (constants.%impl.elem3.199)] +// CHECK:STDOUT: %impl.elem3.loc32_31.1: @Test.%.loc32_31.17 (%.df57) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element3 [symbolic = %impl.elem3.loc32_31.2 (constants.%impl.elem3.199)] // CHECK:STDOUT: %bound_method.loc32_31.3: = bound_method %r.ref, %impl.elem3.loc32_31.1 -// CHECK:STDOUT: %.loc32_31.1: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] +// CHECK:STDOUT: %Iterate.facet.loc32_31.2: %Iterate.type = facet_value constants.%R.as_type.a62, (constants.%Iterate.lookup_impl_witness.8b4) [symbolic = %Iterate.facet.loc32_31.3 (constants.%Iterate.facet)] +// CHECK:STDOUT: %.loc32_31.2: %Iterate.type = converted constants.%R.as_type.a62, %Iterate.facet.loc32_31.2 [symbolic = %Iterate.facet.loc32_31.3 (constants.%Iterate.facet)] +// CHECK:STDOUT: %.loc32_31.3: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] // CHECK:STDOUT: %specific_impl_fn.loc32_31.2: = specific_impl_function %impl.elem3.loc32_31.1, @Iterate.WithSelf.Next(constants.%Iterate.facet) [symbolic = %specific_impl_fn.loc32_31.5 (constants.%specific_impl_fn.169)] // CHECK:STDOUT: %bound_method.loc32_31.4: = bound_method %r.ref, %specific_impl_fn.loc32_31.2 -// CHECK:STDOUT: %.loc32_31.2: ref %Optional.be6 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.be6 to %.loc32_31.2 = call %bound_method.loc32_31.4(%r.ref, %addr.loc32) -// CHECK:STDOUT: %.loc32_31.3: ref %Optional.be6 = temporary %.loc32_31.2, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc32_31.4: %Optional.HasValue.type.2bf = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.642) [concrete = constants.%Optional.HasValue.cdf] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.2bf = name_ref HasValue, %.loc32_31.4 [concrete = constants.%Optional.HasValue.cdf] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc32_31.3, %HasValue.ref +// CHECK:STDOUT: %.loc32_31.4: ref %Optional.be6 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.be6 to %.loc32_31.4 = call %bound_method.loc32_31.4(%r.ref, %addr.loc32) +// CHECK:STDOUT: %.loc32_31.5: ref %Optional.be6 = temporary %.loc32_31.4, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc32_31.6: %Optional.HasValue.type.2bf = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.642) [concrete = constants.%Optional.HasValue.cdf] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.2bf = name_ref HasValue, %.loc32_31.6 [concrete = constants.%Optional.HasValue.cdf] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc32_31.5, %HasValue.ref // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.642) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc32_31.5: = bound_method %.loc32_31.3, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc32_31.5: %Optional.be6 = acquire_value %.loc32_31.3 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc32_31.5(%.loc32_31.5) -// CHECK:STDOUT: %.loc32_31.6: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc32_31.7: bool = converted %Optional.HasValue.call, %.loc32_31.6 -// CHECK:STDOUT: if %.loc32_31.7 br !for.body else br !for.done +// CHECK:STDOUT: %bound_method.loc32_31.5: = bound_method %.loc32_31.5, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc32_31.7: %Optional.be6 = acquire_value %.loc32_31.5 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc32_31.5(%.loc32_31.7) +// CHECK:STDOUT: %.loc32_31.8: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc32_31.9: bool = converted %Optional.HasValue.call, %.loc32_31.8 +// CHECK:STDOUT: if %.loc32_31.9 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc32_31.8: %Optional.Get.type.112 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.642) [concrete = constants.%Optional.Get.6bf] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.112 = name_ref Get, %.loc32_31.8 [concrete = constants.%Optional.Get.6bf] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc32_31.3, %Get.ref +// CHECK:STDOUT: %.loc32_31.10: %Optional.Get.type.112 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.642) [concrete = constants.%Optional.Get.6bf] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.112 = name_ref Get, %.loc32_31.10 [concrete = constants.%Optional.Get.6bf] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc32_31.5, %Get.ref // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.642) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc32_31.6: = bound_method %.loc32_31.3, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc32_31.9: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc32_31.10: %Optional.be6 = acquire_value %.loc32_31.3 -// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc32_31.9 = call %bound_method.loc32_31.6(%.loc32_31.10) +// CHECK:STDOUT: %bound_method.loc32_31.6: = bound_method %.loc32_31.5, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc32_31.11: ref %ValueType = temporary_storage +// CHECK:STDOUT: %.loc32_31.12: %Optional.be6 = acquire_value %.loc32_31.5 +// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc32_31.11 = call %bound_method.loc32_31.6(%.loc32_31.12) // CHECK:STDOUT: %.loc32_16: type = splice_block %ValueType.ref.loc32 [concrete = constants.%ValueType] { // CHECK:STDOUT: %Cpp.ref.loc32: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc32: = name_ref N, imports.%N [concrete = imports.%N] // CHECK:STDOUT: %ValueType.ref.loc32: type = name_ref ValueType, imports.%ValueType.decl [concrete = constants.%ValueType] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc32_31.11: ref %ValueType = temporary %.loc32_31.9, %Optional.Get.call -// CHECK:STDOUT: %.loc32_31.12: %ValueType = acquire_value %.loc32_31.11 -// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc32_31.12 +// CHECK:STDOUT: %.loc32_31.13: ref %ValueType = temporary %.loc32_31.11, %Optional.Get.call +// CHECK:STDOUT: %.loc32_31.14: %ValueType = acquire_value %.loc32_31.13 +// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc32_31.14 // CHECK:STDOUT: %sum.ref: ref %ValueType = name_ref sum, %sum // CHECK:STDOUT: %i.ref: %ValueType = name_ref i, %i // CHECK:STDOUT: %ValueType.cpp_operator.bound: = bound_method %sum.ref, imports.%ValueType.cpp_operator.decl @@ -2787,14 +2817,15 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %ValueType.Op.bound.loc32: = bound_method %.loc32_31.11, constants.%ValueType.Op.4c94b9.1 +// CHECK:STDOUT: %ValueType.Op.bound.loc32: = bound_method %.loc32_31.13, constants.%ValueType.Op.4c94b9.1 // CHECK:STDOUT: %Op.ref.loc32: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc32: = bound_method %.loc32_31.11, %Op.ref.loc32 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc32: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc32(%.loc32_31.11) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc32_31.3, constants.%Destroy.Op.1a2547.7 -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc32_31.3) -// CHECK:STDOUT: %impl.elem0.loc32_31.1: @Test.%.loc32_31.15 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc32_31.2 (constants.%impl.elem0.c7c)] +// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc32: = bound_method %.loc32_31.13, %Op.ref.loc32 +// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc32: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc32(%.loc32_31.13) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc32_31.5, constants.%Destroy.Op.1a2547.7 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc32_31.5) +// CHECK:STDOUT: %impl.elem0.loc32_31.1: @Test.%.loc32_31.18 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc32_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %bound_method.loc32_31.7: = bound_method %var, %impl.elem0.loc32_31.1 +// CHECK:STDOUT: %.loc32_31.15: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] // CHECK:STDOUT: %specific_impl_fn.loc32_31.3: = specific_impl_function %impl.elem0.loc32_31.1, @Destroy.WithSelf.Op(constants.%impl.elem1.46a) [symbolic = %specific_impl_fn.loc32_31.6 (constants.%specific_impl_fn.cd3)] // CHECK:STDOUT: %bound_method.loc32_31.8: = bound_method %var, %specific_impl_fn.loc32_31.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc32_31.8(%var) @@ -3042,21 +3073,21 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc35_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.8b4)] -// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc35_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.b19)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.217)] -// CHECK:STDOUT: %.loc39_31.13: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc39_31.13 (constants.%.a27)] -// CHECK:STDOUT: %impl.elem2.loc39_31.2: @Test.%.loc39_31.13 (%.a27) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc39_31.2 (constants.%impl.elem2.7c0)] -// CHECK:STDOUT: %specific_impl_fn.loc39_31.4: = specific_impl_function %impl.elem2.loc39_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc39_31.4 (constants.%specific_impl_fn.e23)] +// CHECK:STDOUT: %Iterate.facet.loc39_31.3: %Iterate.type = facet_value %R.as_type.loc35_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc39_31.3 (constants.%Iterate.facet.b19)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc39_31.3) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.217)] +// CHECK:STDOUT: %.loc39_31.16: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc39_31.3 [symbolic = %.loc39_31.16 (constants.%.a27)] +// CHECK:STDOUT: %impl.elem2.loc39_31.2: @Test.%.loc39_31.16 (%.a27) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc39_31.2 (constants.%impl.elem2.7c0)] +// CHECK:STDOUT: %specific_impl_fn.loc39_31.4: = specific_impl_function %impl.elem2.loc39_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc39_31.3) [symbolic = %specific_impl_fn.loc39_31.4 (constants.%specific_impl_fn.e23)] // CHECK:STDOUT: // CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.530)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.10a)] -// CHECK:STDOUT: %.loc39_31.14: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc39_31.14 (constants.%.df57)] -// CHECK:STDOUT: %impl.elem3.loc39_31.2: @Test.%.loc39_31.14 (%.df57) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc39_31.2 (constants.%impl.elem3.199)] -// CHECK:STDOUT: %specific_impl_fn.loc39_31.5: = specific_impl_function %impl.elem3.loc39_31.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc39_31.5 (constants.%specific_impl_fn.169)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc39_31.3) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.10a)] +// CHECK:STDOUT: %.loc39_31.17: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc39_31.3 [symbolic = %.loc39_31.17 (constants.%.df57)] +// CHECK:STDOUT: %impl.elem3.loc39_31.2: @Test.%.loc39_31.17 (%.df57) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc39_31.2 (constants.%impl.elem3.199)] +// CHECK:STDOUT: %specific_impl_fn.loc39_31.5: = specific_impl_function %impl.elem3.loc39_31.2, @Iterate.WithSelf.Next(%Iterate.facet.loc39_31.3) [symbolic = %specific_impl_fn.loc39_31.5 (constants.%specific_impl_fn.169)] // CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.e7e)] -// CHECK:STDOUT: %.loc39_31.15: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc39_31.15 (constants.%.bc1)] +// CHECK:STDOUT: %.loc39_31.18: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc39_31.18 (constants.%.bc1)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.f37)] -// CHECK:STDOUT: %impl.elem0.loc39_31.2: @Test.%.loc39_31.15 (%.bc1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc39_31.2 (constants.%impl.elem0.c7c)] +// CHECK:STDOUT: %impl.elem0.loc39_31.2: @Test.%.loc39_31.18 (%.bc1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc39_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %specific_impl_fn.loc39_31.6: = specific_impl_function %impl.elem0.loc39_31.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc39_31.6 (constants.%specific_impl_fn.cd3)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc35_67.1 (%R.as_type.a62)) { @@ -3066,8 +3097,10 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.e41 = value_binding_pattern i [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc35_67.1 (%R.as_type.a62) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc39_31.1: @Test.%.loc39_31.13 (%.a27) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element2 [symbolic = %impl.elem2.loc39_31.2 (constants.%impl.elem2.7c0)] +// CHECK:STDOUT: %impl.elem2.loc39_31.1: @Test.%.loc39_31.16 (%.a27) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element2 [symbolic = %impl.elem2.loc39_31.2 (constants.%impl.elem2.7c0)] // CHECK:STDOUT: %bound_method.loc39_31.1: = bound_method %r.ref, %impl.elem2.loc39_31.1 +// CHECK:STDOUT: %Iterate.facet.loc39_31.1: %Iterate.type = facet_value constants.%R.as_type.a62, (constants.%Iterate.lookup_impl_witness.8b4) [symbolic = %Iterate.facet.loc39_31.3 (constants.%Iterate.facet.b19)] +// CHECK:STDOUT: %.loc39_31.1: %Iterate.type = converted constants.%R.as_type.a62, %Iterate.facet.loc39_31.1 [symbolic = %Iterate.facet.loc39_31.3 (constants.%Iterate.facet.b19)] // CHECK:STDOUT: %specific_impl_fn.loc39_31.1: = specific_impl_function %impl.elem2.loc39_31.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.b19) [symbolic = %specific_impl_fn.loc39_31.4 (constants.%specific_impl_fn.e23)] // CHECK:STDOUT: %bound_method.loc39_31.2: = bound_method %r.ref, %specific_impl_fn.loc39_31.1 // CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.862) = var invalid @@ -3077,42 +3110,44 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc39: @Test.%ptr (%ptr.530) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc39_31.1: @Test.%.loc39_31.14 (%.df57) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element3 [symbolic = %impl.elem3.loc39_31.2 (constants.%impl.elem3.199)] +// CHECK:STDOUT: %impl.elem3.loc39_31.1: @Test.%.loc39_31.17 (%.df57) = impl_witness_access constants.%Iterate.lookup_impl_witness.8b4, element3 [symbolic = %impl.elem3.loc39_31.2 (constants.%impl.elem3.199)] // CHECK:STDOUT: %bound_method.loc39_31.3: = bound_method %r.ref, %impl.elem3.loc39_31.1 -// CHECK:STDOUT: %.loc39_31.1: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] +// CHECK:STDOUT: %Iterate.facet.loc39_31.2: %Iterate.type = facet_value constants.%R.as_type.a62, (constants.%Iterate.lookup_impl_witness.8b4) [symbolic = %Iterate.facet.loc39_31.3 (constants.%Iterate.facet.b19)] +// CHECK:STDOUT: %.loc39_31.2: %Iterate.type = converted constants.%R.as_type.a62, %Iterate.facet.loc39_31.2 [symbolic = %Iterate.facet.loc39_31.3 (constants.%Iterate.facet.b19)] +// CHECK:STDOUT: %.loc39_31.3: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] // CHECK:STDOUT: %specific_impl_fn.loc39_31.2: = specific_impl_function %impl.elem3.loc39_31.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.b19) [symbolic = %specific_impl_fn.loc39_31.5 (constants.%specific_impl_fn.169)] // CHECK:STDOUT: %bound_method.loc39_31.4: = bound_method %r.ref, %specific_impl_fn.loc39_31.2 -// CHECK:STDOUT: %.loc39_31.2: ref %Optional.552 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.552 to %.loc39_31.2 = call %bound_method.loc39_31.4(%r.ref, %addr.loc39) -// CHECK:STDOUT: %.loc39_31.3: ref %Optional.552 = temporary %.loc39_31.2, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc39_31.4: %Optional.HasValue.type.109 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.HasValue.605] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.109 = name_ref HasValue, %.loc39_31.4 [concrete = constants.%Optional.HasValue.605] -// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc39_31.3, %HasValue.ref +// CHECK:STDOUT: %.loc39_31.4: ref %Optional.552 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.552 to %.loc39_31.4 = call %bound_method.loc39_31.4(%r.ref, %addr.loc39) +// CHECK:STDOUT: %.loc39_31.5: ref %Optional.552 = temporary %.loc39_31.4, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc39_31.6: %Optional.HasValue.type.109 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.HasValue.605] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.109 = name_ref HasValue, %.loc39_31.6 [concrete = constants.%Optional.HasValue.605] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc39_31.5, %HasValue.ref // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.HasValue.specific_fn] -// CHECK:STDOUT: %bound_method.loc39_31.5: = bound_method %.loc39_31.3, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc39_31.5: %Optional.552 = acquire_value %.loc39_31.3 -// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc39_31.5(%.loc39_31.5) -// CHECK:STDOUT: %.loc39_31.6: bool = value_of_initializer %Optional.HasValue.call -// CHECK:STDOUT: %.loc39_31.7: bool = converted %Optional.HasValue.call, %.loc39_31.6 -// CHECK:STDOUT: if %.loc39_31.7 br !for.body else br !for.done +// CHECK:STDOUT: %bound_method.loc39_31.5: = bound_method %.loc39_31.5, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc39_31.7: %Optional.552 = acquire_value %.loc39_31.5 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc39_31.5(%.loc39_31.7) +// CHECK:STDOUT: %.loc39_31.8: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc39_31.9: bool = converted %Optional.HasValue.call, %.loc39_31.8 +// CHECK:STDOUT: if %.loc39_31.9 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc39_31.8: %Optional.Get.type.135 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.Get.5aa] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.135 = name_ref Get, %.loc39_31.8 [concrete = constants.%Optional.Get.5aa] -// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc39_31.3, %Get.ref +// CHECK:STDOUT: %.loc39_31.10: %Optional.Get.type.135 = specific_constant imports.%Core.import_ref.daba, @Optional(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.Get.5aa] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.135 = name_ref Get, %.loc39_31.10 [concrete = constants.%Optional.Get.5aa] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc39_31.5, %Get.ref // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.7ce) [concrete = constants.%Optional.Get.specific_fn] -// CHECK:STDOUT: %bound_method.loc39_31.6: = bound_method %.loc39_31.3, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc39_31.9: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc39_31.10: %Optional.552 = acquire_value %.loc39_31.3 -// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc39_31.9 = call %bound_method.loc39_31.6(%.loc39_31.10) +// CHECK:STDOUT: %bound_method.loc39_31.6: = bound_method %.loc39_31.5, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc39_31.11: ref %ValueType = temporary_storage +// CHECK:STDOUT: %.loc39_31.12: %Optional.552 = acquire_value %.loc39_31.5 +// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc39_31.11 = call %bound_method.loc39_31.6(%.loc39_31.12) // CHECK:STDOUT: %.loc39_16: type = splice_block %ValueType.ref.loc39 [concrete = constants.%ValueType] { // CHECK:STDOUT: %Cpp.ref.loc39: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc39: = name_ref N, imports.%N [concrete = imports.%N] // CHECK:STDOUT: %ValueType.ref.loc39: type = name_ref ValueType, imports.%ValueType.decl [concrete = constants.%ValueType] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc39_31.11: ref %ValueType = temporary %.loc39_31.9, %Optional.Get.call -// CHECK:STDOUT: %.loc39_31.12: %ValueType = acquire_value %.loc39_31.11 -// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc39_31.12 +// CHECK:STDOUT: %.loc39_31.13: ref %ValueType = temporary %.loc39_31.11, %Optional.Get.call +// CHECK:STDOUT: %.loc39_31.14: %ValueType = acquire_value %.loc39_31.13 +// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc39_31.14 // CHECK:STDOUT: %sum.ref: ref %ValueType = name_ref sum, %sum // CHECK:STDOUT: %i.ref: %ValueType = name_ref i, %i // CHECK:STDOUT: %ValueType.cpp_operator.bound: = bound_method %sum.ref, imports.%ValueType.cpp_operator.decl @@ -3124,14 +3159,15 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %ValueType.Op.bound.loc39: = bound_method %.loc39_31.11, constants.%ValueType.Op.4c94b9.1 +// CHECK:STDOUT: %ValueType.Op.bound.loc39: = bound_method %.loc39_31.13, constants.%ValueType.Op.4c94b9.1 // CHECK:STDOUT: %Op.ref.loc39: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc39: = bound_method %.loc39_31.11, %Op.ref.loc39 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc39: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc39(%.loc39_31.11) -// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc39_31.3, constants.%Destroy.Op.1a2547.7 -// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc39_31.3) -// CHECK:STDOUT: %impl.elem0.loc39_31.1: @Test.%.loc39_31.15 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc39_31.2 (constants.%impl.elem0.c7c)] +// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc39: = bound_method %.loc39_31.13, %Op.ref.loc39 +// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc39: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc39(%.loc39_31.13) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc39_31.5, constants.%Destroy.Op.1a2547.7 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc39_31.5) +// CHECK:STDOUT: %impl.elem0.loc39_31.1: @Test.%.loc39_31.18 (%.bc1) = impl_witness_access constants.%Destroy.lookup_impl_witness.f37, element0 [symbolic = %impl.elem0.loc39_31.2 (constants.%impl.elem0.c7c)] // CHECK:STDOUT: %bound_method.loc39_31.7: = bound_method %var, %impl.elem0.loc39_31.1 +// CHECK:STDOUT: %.loc39_31.15: %Destroy.type = converted constants.%as_type.862, constants.%impl.elem1.46a [symbolic = %impl.elem1 (constants.%impl.elem1.46a)] // CHECK:STDOUT: %specific_impl_fn.loc39_31.3: = specific_impl_function %impl.elem0.loc39_31.1, @Destroy.WithSelf.Op(constants.%impl.elem1.46a) [symbolic = %specific_impl_fn.loc39_31.6 (constants.%specific_impl_fn.cd3)] // CHECK:STDOUT: %bound_method.loc39_31.8: = bound_method %var, %specific_impl_fn.loc39_31.3 // CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc39_31.8(%var) @@ -3180,9 +3216,9 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc35 => constants.%complete_type.357 // CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.a6e -// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.5cc +// CHECK:STDOUT: %Iterate.facet.loc39_31.3 => constants.%Iterate.facet.5cc // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.875 -// CHECK:STDOUT: %.loc39_31.13 => constants.%.7e3 +// CHECK:STDOUT: %.loc39_31.16 => constants.%.7e3 // CHECK:STDOUT: %impl.elem2.loc39_31.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.96c // CHECK:STDOUT: %specific_impl_fn.loc39_31.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.7aa @@ -3190,11 +3226,11 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.1b5 // CHECK:STDOUT: %ptr => constants.%ptr.484 // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.b41 -// CHECK:STDOUT: %.loc39_31.14 => constants.%.fef +// CHECK:STDOUT: %.loc39_31.17 => constants.%.fef // CHECK:STDOUT: %impl.elem3.loc39_31.2 => constants.%R.as_type.as.Iterate.impl.Next.683 // CHECK:STDOUT: %specific_impl_fn.loc39_31.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn // CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b7b -// CHECK:STDOUT: %.loc39_31.15 => constants.%.1ad +// CHECK:STDOUT: %.loc39_31.18 => constants.%.1ad // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.df9cc1.8 // CHECK:STDOUT: %impl.elem0.loc39_31.2 => constants.%Destroy.Op.1a2547.8 // CHECK:STDOUT: %specific_impl_fn.loc39_31.6 => constants.%Destroy.Op.1a2547.8 diff --git a/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon b/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon index 7ca8f05bac09..8aa2faf45061 100644 --- a/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon +++ b/toolchain/check/testdata/interop/cpp/template/non_type_param.carbon @@ -74,7 +74,7 @@ import Cpp library "templates.h"; class C { adapt {}; } impl C as Core.ImplicitAs(i32) { - eval fn Convert[unused self: Self]() -> i32 { return 123; } + eval fn Convert(unused self) -> i32 { return 123; } } var s: Cpp.Simple({} as C) = Cpp.MakeSimple123(); diff --git a/toolchain/check/testdata/named_constraint/invalid_members.carbon b/toolchain/check/testdata/named_constraint/invalid_members.carbon index 6fe064e761e1..ab6d8e549a4b 100644 --- a/toolchain/check/testdata/named_constraint/invalid_members.carbon +++ b/toolchain/check/testdata/named_constraint/invalid_members.carbon @@ -16,13 +16,13 @@ library "[[@TEST_NAME]]"; constraint E { // TODO: Any fn in a non-template constraint is an error. fn DeclaredFunction(); - fn DeclaredMethod[self: Self](b: Self); + fn DeclaredMethod(self, b: Self); } constraint F { // TODO: Any fn in a non-template constraint is an error. fn DefinedFunction() {} - fn DefinedMethod[unused self: Self](unused b: Self) {} + fn DefinedMethod(unused self, unused b: Self) {} } // --- todo_fail_invalid_var.carbon diff --git a/toolchain/check/testdata/operators/builtin/bit_and.carbon b/toolchain/check/testdata/operators/builtin/bit_and.carbon index 2da170912792..09105bc98d29 100644 --- a/toolchain/check/testdata/operators/builtin/bit_and.carbon +++ b/toolchain/check/testdata/operators/builtin/bit_and.carbon @@ -51,7 +51,7 @@ library "[[@TEST_NAME]]"; class J { adapt {}; } impl J as Core.BitAndWith(J) where .Result = J { - fn Op[unused self: Self](unused other: Self) -> Self { return {} as J; } + fn Op(unused self, unused other: Self) -> Self { return {} as J; } } fn F() { diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index b322f6e35281..55b18ce1ae9f 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.AddWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.AddAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/binary_op.carbon.tmpl b/toolchain/check/testdata/operators/overloaded/binary_op.carbon.tmpl index 15da0f9ee409..a1091be22944 100644 --- a/toolchain/check/testdata/operators/overloaded/binary_op.carbon.tmpl +++ b/toolchain/check/testdata/operators/overloaded/binary_op.carbon.tmpl @@ -15,12 +15,12 @@ package User; class C {}; impl C as Core.INTERFACEWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.INTERFACEAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 6466abbb760a..0af34c40cf74 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.BitAndWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.BitAndAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index aa1ea5beb763..96785343b8db 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -19,7 +19,7 @@ package User; class C {}; impl C as Core.BitComplement where .Result = C { - fn Op[unused self: C]() -> C { + fn Op(unused self: C) -> C { return {}; } } diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index 223383031c0d..04b1f7a44b8e 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.BitOrWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.BitOrAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 6177860c4392..6c3adf54b168 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.BitXorWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.BitXorAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 30c3013209c3..ee1fd43a4234 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -19,7 +19,7 @@ package User; class C {}; impl C as Core.Dec { - fn Op[ref self: C](); + fn Op(ref self: C); } fn TestOp() { diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index 70557f42c47c..3e1b9f924dde 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.DivWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.DivAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index fbc84194f130..08a3ce8a84bc 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -19,8 +19,8 @@ package User; class C {}; impl C as Core.EqWith(C) { - fn Equal[self: C](other: C) -> bool; - fn NotEqual[self: C](other: C) -> bool; + fn Equal(self: C, other: C) -> bool; + fn NotEqual(self: C, other: C) -> bool; } fn TestEqual(a: C, b: C) -> bool { @@ -61,8 +61,8 @@ class C {}; class D {}; impl C as Core.EqWith(C) { - fn Equal[self: C](other: C) -> bool; - fn NotEqual[self: C](other: C) -> bool; + fn Equal(self: C, other: C) -> bool; + fn NotEqual(self: C, other: C) -> bool; } fn TestRhsBad(a: C, b: D) -> bool { diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index 095c5b05bc80..b736e6c9bf02 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -17,10 +17,10 @@ package User; class C {}; impl C as Core.Inc { - fn Op[ref self: C](); + fn Op(ref self: C); } impl C as Core.AddAssignWith(C) { - fn Op[ref self: C](other: C); + fn Op(ref self: C, other: C); } fn TestIncNonRef(a: C) { @@ -28,7 +28,7 @@ fn TestIncNonRef(a: C) { // CHECK:STDERR: ++a; // CHECK:STDERR: ^ // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:9: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn Op[ref self: C](); + // CHECK:STDERR: fn Op(ref self: C); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: ++a; @@ -39,7 +39,7 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDERR: a += b; // CHECK:STDERR: ^ // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:9: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn Op[ref self: C](other: C); + // CHECK:STDERR: fn Op(ref self: C, other: C); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: a += b; diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 13ba72f352fb..660c8e7fad63 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -16,10 +16,10 @@ class C {}; class D {}; impl C as Core.AddWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { return {}; } + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.AddAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn Test(a: C, b: D, z: bool) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 9ce785dfd7d0..4ad37322eb93 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -17,11 +17,11 @@ class X { } impl i32 as Core.ImplicitAs(X) { - fn Convert[self: i32]() -> X { return {.n = self}; } + fn Convert(self: i32) -> X { return {.n = self}; } } impl X as Core.ImplicitAs(i32) { - fn Convert[self: X]() -> i32 { return self.n; } + fn Convert(self: X) -> i32 { return self.n; } } // TODO: fn Sink(T:! type, x: T); @@ -35,6 +35,7 @@ fn Test() { Sink_X(Source(i32)); } + // CHECK:STDOUT: --- implicit_as.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -187,7 +188,7 @@ fn Test() { // CHECK:STDOUT: %return.patt: %pattern_type.6cb = return_slot_pattern %return.param_patt, %X.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] -// CHECK:STDOUT: %.loc20_30: Core.Form = init_form %X.ref [concrete = constants.%.325] +// CHECK:STDOUT: %.loc20_28: Core.Form = init_form %X.ref [concrete = constants.%.325] // CHECK:STDOUT: %self.param: %i32 = value_param call_param0 // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] // CHECK:STDOUT: %self: %i32 = value_binding self, %self.param @@ -212,7 +213,7 @@ fn Test() { // CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc24_28: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %.loc24_26: Core.Form = init_form %i32 [concrete = constants.%.795] // CHECK:STDOUT: %self.param: %X = value_param call_param0 // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %self: %X = value_binding self, %self.param @@ -242,30 +243,30 @@ fn Test() { // CHECK:STDOUT: fn @i32.as.ImplicitAs.impl.Convert(%self.param: %i32) -> out %return.param: %X { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %i32 = name_ref self, %self -// CHECK:STDOUT: %.loc20_51.1: %struct_type.n = struct_literal (%self.ref) +// CHECK:STDOUT: %.loc20_49.1: %struct_type.n = struct_literal (%self.ref) // CHECK:STDOUT: %impl.elem0: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] -// CHECK:STDOUT: %bound_method.loc20_47.1: = bound_method %self.ref, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc20_45.1: = bound_method %self.ref, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc20_47.2: = bound_method %self.ref, %specific_fn -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_47.2(%self.ref) -// CHECK:STDOUT: %.loc20_51.2: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc20_51.3: init %i32 to %.loc20_51.2 = in_place_init %Int.as.Copy.impl.Op.call -// CHECK:STDOUT: %.loc20_51.4: init %X to %return.param = class_init (%.loc20_51.3) -// CHECK:STDOUT: %.loc20_52: init %X = converted %.loc20_51.1, %.loc20_51.4 -// CHECK:STDOUT: return %.loc20_52 to %return.param +// CHECK:STDOUT: %bound_method.loc20_45.2: = bound_method %self.ref, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_45.2(%self.ref) +// CHECK:STDOUT: %.loc20_49.2: ref %i32 = class_element_access %return.param, element0 +// CHECK:STDOUT: %.loc20_49.3: init %i32 to %.loc20_49.2 = in_place_init %Int.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc20_49.4: init %X to %return.param = class_init (%.loc20_49.3) +// CHECK:STDOUT: %.loc20_50: init %X = converted %.loc20_49.1, %.loc20_49.4 +// CHECK:STDOUT: return %.loc20_50 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @X.as.ImplicitAs.impl.Convert(%self.param: %X) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %X = name_ref self, %self // CHECK:STDOUT: %n.ref: %X.elem = name_ref n, @X.%.loc16 [concrete = @X.%.loc16] -// CHECK:STDOUT: %.loc24_45.1: ref %i32 = class_element_access %self.ref, element0 -// CHECK:STDOUT: %.loc24_45.2: %i32 = acquire_value %.loc24_45.1 +// CHECK:STDOUT: %.loc24_43.1: ref %i32 = class_element_access %self.ref, element0 +// CHECK:STDOUT: %.loc24_43.2: %i32 = acquire_value %.loc24_43.1 // CHECK:STDOUT: %impl.elem0: %.7a6 = impl_witness_access constants.%Copy.impl_witness.0e0, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] -// CHECK:STDOUT: %bound_method.loc24_45.1: = bound_method %.loc24_45.2, %impl.elem0 +// CHECK:STDOUT: %bound_method.loc24_43.1: = bound_method %.loc24_43.2, %impl.elem0 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_45.2: = bound_method %.loc24_45.2, %specific_fn -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc24_45.2(%.loc24_45.2) +// CHECK:STDOUT: %bound_method.loc24_43.2: = bound_method %.loc24_43.2, %specific_fn +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc24_43.2(%.loc24_43.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 079110e8e7aa..93c03a65a2ac 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -19,7 +19,7 @@ package User; class C {}; impl C as Core.Inc { - fn Op[ref self: C](); + fn Op(ref self: C); } fn TestOp() { diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 082c3cca2c8c..9126e289ef6d 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -45,7 +45,7 @@ fn F() { 0[1]; } package Core library "[[@TEST_NAME]]"; interface IndexWith(SubscriptType:! type, ElementType:! type) { - fn At[self: Self](subscript: SubscriptType) -> ElementType; + fn At(self, subscript: SubscriptType) -> ElementType; } @@ -58,7 +58,7 @@ import Core library "core_wrong_arg_count"; class C {} impl C as Core.IndexWith((), ()) { - fn At[unused self: Self](unused subscript: ()) -> () { + fn At(unused self, unused subscript: ()) -> () { return (); } } @@ -75,6 +75,7 @@ fn F() { c[()]; } + // CHECK:STDOUT: --- core_wrong_index_with.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -236,30 +237,30 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %IndexWith.WithSelf.At.decl: @IndexWith.WithSelf.%IndexWith.WithSelf.At.type (%IndexWith.WithSelf.At.type) = fn_decl @IndexWith.WithSelf.At [symbolic = @IndexWith.WithSelf.%IndexWith.WithSelf.At (constants.%IndexWith.WithSelf.At)] { -// CHECK:STDOUT: %self.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_13 (%pattern_type.962) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_13 (%pattern_type.962) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %subscript.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_30 (%pattern_type.51d) = value_param_pattern [concrete] -// CHECK:STDOUT: %subscript.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_30 (%pattern_type.51d) = at_binding_pattern subscript, %subscript.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_50 (%pattern_type.946) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_50 (%pattern_type.946) = return_slot_pattern %return.param_patt, %ElementType.ref [concrete] +// CHECK:STDOUT: %self.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_9 (%pattern_type.962) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_9 (%pattern_type.962) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %subscript.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_24 (%pattern_type.51d) = value_param_pattern [concrete] +// CHECK:STDOUT: %subscript.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_24 (%pattern_type.51d) = at_binding_pattern subscript, %subscript.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @IndexWith.WithSelf.At.%pattern_type.loc5_44 (%pattern_type.946) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @IndexWith.WithSelf.At.%pattern_type.loc5_44 (%pattern_type.946) = return_slot_pattern %return.param_patt, %ElementType.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, @IndexWith.%ElementType.loc4_54.2 [symbolic = %ElementType (constants.%ElementType)] -// CHECK:STDOUT: %.loc5_50.2: Core.Form = init_form %ElementType.ref [symbolic = %.loc5_50.1 (constants.%.822)] -// CHECK:STDOUT: %self.param: @IndexWith.WithSelf.At.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc5_15.2: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.a54) = specific_constant @IndexWith.%Self.loc4_63.1, @IndexWith(constants.%SubscriptType, constants.%ElementType) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.a54) = name_ref Self, %.loc5_15.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_15.3: type = converted %Self.ref, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_44.2: Core.Form = init_form %ElementType.ref [symbolic = %.loc5_44.1 (constants.%.822)] +// CHECK:STDOUT: %self.param: @IndexWith.WithSelf.At.%Self.as_type.loc5_9.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_9.1: type = splice_block %.loc5_9.3 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc5_9.2: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.a54) = specific_constant @IndexWith.%Self.loc4_63.1, @IndexWith(constants.%SubscriptType, constants.%ElementType) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.a54) = name_ref Self, %.loc5_9.2 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_9.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_9.3: type = converted %Self.ref, %Self.as_type.loc5_9.2 [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @IndexWith.WithSelf.At.%Self.as_type.loc5_15.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @IndexWith.WithSelf.At.%Self.as_type.loc5_9.1 (%Self.as_type) = value_binding self, %self.param // CHECK:STDOUT: %subscript.param: @IndexWith.WithSelf.At.%SubscriptType (%SubscriptType) = value_param call_param1 // CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, @IndexWith.%SubscriptType.loc4_34.2 [symbolic = %SubscriptType (constants.%SubscriptType)] // CHECK:STDOUT: %subscript: @IndexWith.WithSelf.At.%SubscriptType (%SubscriptType) = value_binding subscript, %subscript.param // CHECK:STDOUT: %return.param: ref @IndexWith.WithSelf.At.%ElementType (%ElementType) = out_param call_param2 // CHECK:STDOUT: %return: ref @IndexWith.WithSelf.At.%ElementType (%ElementType) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc5_61.1: @IndexWith.WithSelf.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %IndexWith.WithSelf.At.decl [symbolic = %assoc0.loc5_61.2 (constants.%assoc0)] +// CHECK:STDOUT: %assoc0.loc5_55.1: @IndexWith.WithSelf.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %IndexWith.WithSelf.At.decl [symbolic = %assoc0.loc5_55.2 (constants.%assoc0)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc4_63.1 @@ -267,7 +268,7 @@ fn F() { // CHECK:STDOUT: .ElementType = // CHECK:STDOUT: .SubscriptType = // CHECK:STDOUT: .ElementType = -// CHECK:STDOUT: .At = @IndexWith.WithSelf.%assoc0.loc5_61.1 +// CHECK:STDOUT: .At = @IndexWith.WithSelf.%assoc0.loc5_55.1 // CHECK:STDOUT: witness = (@IndexWith.WithSelf.%IndexWith.WithSelf.At.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: @@ -279,13 +280,13 @@ fn F() { // CHECK:STDOUT: %ElementType: type = symbolic_binding ElementType, 1 [symbolic = %ElementType (constants.%ElementType)] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType, %ElementType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.a54)] // CHECK:STDOUT: %Self: @IndexWith.WithSelf.At.%IndexWith.type (%IndexWith.type.a54) = symbolic_binding Self, 2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type.loc5_13: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type.loc5_13 (constants.%pattern_type.962)] -// CHECK:STDOUT: %pattern_type.loc5_30: type = pattern_type %SubscriptType [symbolic = %pattern_type.loc5_30 (constants.%pattern_type.51d)] -// CHECK:STDOUT: %.loc5_50.1: Core.Form = init_form %ElementType [symbolic = %.loc5_50.1 (constants.%.822)] -// CHECK:STDOUT: %pattern_type.loc5_50: type = pattern_type %ElementType [symbolic = %pattern_type.loc5_50 (constants.%pattern_type.946)] +// CHECK:STDOUT: %Self.as_type.loc5_9.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_9.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type.loc5_9: type = pattern_type %Self.as_type.loc5_9.1 [symbolic = %pattern_type.loc5_9 (constants.%pattern_type.962)] +// CHECK:STDOUT: %pattern_type.loc5_24: type = pattern_type %SubscriptType [symbolic = %pattern_type.loc5_24 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %.loc5_44.1: Core.Form = init_form %ElementType [symbolic = %.loc5_44.1 (constants.%.822)] +// CHECK:STDOUT: %pattern_type.loc5_44: type = pattern_type %ElementType [symbolic = %pattern_type.loc5_44 (constants.%pattern_type.946)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @IndexWith.WithSelf.At.%Self.as_type.loc5_15.1 (%Self.as_type), %subscript.param: @IndexWith.WithSelf.At.%SubscriptType (%SubscriptType)) -> out %return.param: @IndexWith.WithSelf.At.%ElementType (%ElementType); +// CHECK:STDOUT: fn(%self.param: @IndexWith.WithSelf.At.%Self.as_type.loc5_9.1 (%Self.as_type), %subscript.param: @IndexWith.WithSelf.At.%SubscriptType (%SubscriptType)) -> out %return.param: @IndexWith.WithSelf.At.%ElementType (%ElementType); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType, constants.%ElementType) { @@ -300,11 +301,11 @@ fn F() { // CHECK:STDOUT: %ElementType => constants.%ElementType // CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.a54 // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type.loc5_13 => constants.%pattern_type.962 -// CHECK:STDOUT: %pattern_type.loc5_30 => constants.%pattern_type.51d -// CHECK:STDOUT: %.loc5_50.1 => constants.%.822 -// CHECK:STDOUT: %pattern_type.loc5_50 => constants.%pattern_type.946 +// CHECK:STDOUT: %Self.as_type.loc5_9.1 => constants.%Self.as_type +// CHECK:STDOUT: %pattern_type.loc5_9 => constants.%pattern_type.962 +// CHECK:STDOUT: %pattern_type.loc5_24 => constants.%pattern_type.51d +// CHECK:STDOUT: %.loc5_44.1 => constants.%.822 +// CHECK:STDOUT: %pattern_type.loc5_44 => constants.%pattern_type.946 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_wrong_arg_count.carbon @@ -421,18 +422,18 @@ fn F() { // CHECK:STDOUT: %subscript.param_patt: %pattern_type.cb1 = value_param_pattern [concrete] // CHECK:STDOUT: %subscript.patt: %pattern_type.cb1 = at_binding_pattern subscript, %subscript.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc9_54.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc9_48.2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9_54.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_54.2: type = converted %.loc9_54.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc9_54.3: Core.Form = init_form %.loc9_54.2 [concrete = constants.%.262] +// CHECK:STDOUT: %.loc9_48.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_48.2: type = converted %.loc9_48.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_48.3: Core.Form = init_form %.loc9_48.2 [concrete = constants.%.262] // CHECK:STDOUT: %self.param: %C = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.IndexWith.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param // CHECK:STDOUT: %subscript.param: %empty_tuple.type = value_param call_param1 -// CHECK:STDOUT: %.loc9_47.1: type = splice_block %.loc9_47.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc9_47.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc9_47.3: type = converted %.loc9_47.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_41.1: type = splice_block %.loc9_41.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc9_41.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_41.3: type = converted %.loc9_41.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %subscript: %empty_tuple.type = value_binding subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2 diff --git a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon index 877163806590..1c9f6b0b3d93 100644 --- a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon +++ b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon @@ -21,7 +21,7 @@ class ElementType {} class SubscriptType {} impl C as Core.IndexWith(SubscriptType) where .ElementType = ElementType { - fn At[unused self: Self](unused subscript: SubscriptType) -> ElementType { + fn At(unused self, unused subscript: SubscriptType) -> ElementType { return {}; } } @@ -39,7 +39,7 @@ class C { } impl (C, C) as Core.IndexWith(Core.IntLiteral) where .ElementType = C { - fn At[self: Self](unused subscript: Core.IntLiteral) -> C { + fn At(self, unused subscript: Core.IntLiteral) -> C { return self.0; } } @@ -56,7 +56,7 @@ class ElementType {} class SubscriptType {} impl C as Core.IndexWith(SubscriptType) where .ElementType = ElementType { - fn At[unused self: Self](unused subscript: SubscriptType) -> ElementType { + fn At(unused self, unused subscript: SubscriptType) -> ElementType { return {}; } } @@ -82,6 +82,7 @@ let c: C = {}; let x: i32 = c[0]; + // CHECK:STDOUT: --- overloaded_index.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -206,10 +207,10 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %pattern_type.67c = return_slot_pattern %return.param_patt, %ElementType.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.d74 = facet_value @C.as.IndexWith.impl.%C.ref, (constants.%IndexWith.impl_witness) [concrete = constants.%IndexWith.facet] -// CHECK:STDOUT: %.loc9_64.1: %IndexWith.type.d74 = converted @C.as.IndexWith.impl.%C.ref, %IndexWith.facet [concrete = constants.%IndexWith.facet] +// CHECK:STDOUT: %.loc9_58.1: %IndexWith.type.d74 = converted @C.as.IndexWith.impl.%C.ref, %IndexWith.facet [concrete = constants.%IndexWith.facet] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%ElementType] // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %impl.elem0 [concrete = constants.%ElementType] -// CHECK:STDOUT: %.loc9_64.2: Core.Form = init_form %ElementType.ref [concrete = constants.%.4d0] +// CHECK:STDOUT: %.loc9_58.2: Core.Form = init_form %ElementType.ref [concrete = constants.%.4d0] // CHECK:STDOUT: %self.param: %C = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.IndexWith.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param @@ -396,12 +397,12 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %C.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc9_59: Core.Form = init_form %C.ref [concrete = constants.%.a44] +// CHECK:STDOUT: %.loc9_53: Core.Form = init_form %C.ref [concrete = constants.%.a44] // CHECK:STDOUT: %self.param: %tuple.type.748 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @tuple.type.as.IndexWith.impl.%.loc8_11.2 [concrete = constants.%tuple.type.748] // CHECK:STDOUT: %self: %tuple.type.748 = value_binding self, %self.param // CHECK:STDOUT: %subscript.param: Core.IntLiteral = value_param call_param1 -// CHECK:STDOUT: %.loc9_43: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc9_37: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } @@ -572,10 +573,10 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %pattern_type.67c = return_slot_pattern %return.param_patt, %ElementType.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.d74 = facet_value @C.as.IndexWith.impl.%C.ref, (constants.%IndexWith.impl_witness) [concrete = constants.%IndexWith.facet] -// CHECK:STDOUT: %.loc9_64.1: %IndexWith.type.d74 = converted @C.as.IndexWith.impl.%C.ref, %IndexWith.facet [concrete = constants.%IndexWith.facet] +// CHECK:STDOUT: %.loc9_58.1: %IndexWith.type.d74 = converted @C.as.IndexWith.impl.%C.ref, %IndexWith.facet [concrete = constants.%IndexWith.facet] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%ElementType] // CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %impl.elem0 [concrete = constants.%ElementType] -// CHECK:STDOUT: %.loc9_64.2: Core.Form = init_form %ElementType.ref [concrete = constants.%.4d0] +// CHECK:STDOUT: %.loc9_58.2: Core.Form = init_form %ElementType.ref [concrete = constants.%.4d0] // CHECK:STDOUT: %self.param: %C = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.IndexWith.impl.%C.ref [concrete = constants.%C] // CHECK:STDOUT: %self: %C = value_binding self, %self.param diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index 0938cb502574..71083fcf82e0 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.LeftShiftWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.LeftShiftAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 9728abf16680..5ca938eb22eb 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.ModWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.ModAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index f4307196a89f..46eaf5e68766 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.MulWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.MulAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index 7a707da7ee35..f3d919958830 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -19,7 +19,7 @@ package User; class C {}; impl C as Core.Negate where .Result = C { - fn Op[unused self: C]() -> C { + fn Op(unused self: C) -> C { return {}; } } diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 54eab365c82e..6cdb6667dc5d 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -19,10 +19,10 @@ package User; class C {}; impl C as Core.OrderedWith(C) { - fn Less[self: C](other: C) -> bool; - fn LessOrEquivalent[self: C](other: C) -> bool; - fn Greater[self: C](other: C) -> bool; - fn GreaterOrEquivalent[self: C](other: C) -> bool; + fn Less(self: C, other: C) -> bool; + fn LessOrEquivalent(self: C, other: C) -> bool; + fn Greater(self: C, other: C) -> bool; + fn GreaterOrEquivalent(self: C, other: C) -> bool; } fn TestLess(a: C, b: C) -> bool { diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index c2ed374574a1..32d1c6d58479 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.RightShiftWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.RightShiftAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 5a366cf4c9cf..3d94192e8718 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -19,12 +19,12 @@ package User; class C {}; impl C as Core.SubWith(C) where .Result = C { - fn Op[unused self: C](unused other: C) -> C { + fn Op(unused self: C, unused other: C) -> C { return {}; } } impl C as Core.SubAssignWith(C) { - fn Op[unused ref self: C](unused other: C) {} + fn Op(unused ref self: C, unused other: C) {} } fn TestOp(a: C, b: C) -> C { diff --git a/toolchain/check/testdata/operators/overloaded/unary_op.carbon.tmpl b/toolchain/check/testdata/operators/overloaded/unary_op.carbon.tmpl index 861420879500..4288c9bfaadc 100644 --- a/toolchain/check/testdata/operators/overloaded/unary_op.carbon.tmpl +++ b/toolchain/check/testdata/operators/overloaded/unary_op.carbon.tmpl @@ -15,7 +15,7 @@ package User; class C {}; impl C as Core.INTERFACE where .Result = C { - fn Op[unused self: C]() -> C { + fn Op(unused self: C) -> C { return {}; } } diff --git a/toolchain/check/testdata/operators/overloaded/unary_stmt.carbon.tmpl b/toolchain/check/testdata/operators/overloaded/unary_stmt.carbon.tmpl index 8e584fe409a9..20df9671e214 100644 --- a/toolchain/check/testdata/operators/overloaded/unary_stmt.carbon.tmpl +++ b/toolchain/check/testdata/operators/overloaded/unary_stmt.carbon.tmpl @@ -15,7 +15,7 @@ package User; class C {}; impl C as Core.INTERFACE { - fn Op[ref self: C](); + fn Op(ref self: C); } fn TestOp() { diff --git a/toolchain/check/testdata/packages/missing_prelude.carbon b/toolchain/check/testdata/packages/missing_prelude.carbon index 3176e4f45f16..fb144256d097 100644 --- a/toolchain/check/testdata/packages/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/missing_prelude.carbon @@ -47,7 +47,7 @@ class X {} fn Int[T:! type](unused N:! T) -> X { return {}; } interface ImplicitAs(T:! type) { - fn Convert[self: Self]() -> T; + fn Convert(self) -> T; } // --- fail_use_fake_int.carbon @@ -124,6 +124,7 @@ class Core { let n: type = i32; + // CHECK:STDOUT: --- fail_missing_prelude.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -264,31 +265,31 @@ let n: type = i32; // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.decl: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type) = fn_decl @ImplicitAs.WithSelf.Convert [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert)] { -// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc9_18 (%pattern_type.701) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc9_18 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc9_31 (%pattern_type.51d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc9_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] +// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc9_14 (%pattern_type.701) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc9_14 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc9_23 (%pattern_type.51d) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc9_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.loc8_23.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc9_31.2: Core.Form = init_form %T.ref [symbolic = %.loc9_31.1 (constants.%.184)] -// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc9_20.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_20.1: type = splice_block %.loc9_20.3 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc9_20.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc8_32.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc9_20.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc9_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc9_20.3: type = converted %Self.ref, %Self.as_type.loc9_20.2 [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc9_23.2: Core.Form = init_form %T.ref [symbolic = %.loc9_23.1 (constants.%.184)] +// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc9_14.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc9_14.1: type = splice_block %.loc9_14.3 [symbolic = %Self.as_type.loc9_14.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc9_14.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc8_32.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc9_14.2 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc9_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc9_14.3: type = converted %Self.ref, %Self.as_type.loc9_14.2 [symbolic = %Self.as_type.loc9_14.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc9_20.1 (%Self.as_type) = value_binding self, %self.param +// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc9_14.1 (%Self.as_type) = 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.loc9_32.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc9_32.2 (constants.%assoc0)] +// CHECK:STDOUT: %assoc0.loc9_24.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc9_24.2 (constants.%assoc0)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.loc8_32.1 // CHECK:STDOUT: .T = // CHECK:STDOUT: .T = -// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc9_32.1 +// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc9_24.1 // CHECK:STDOUT: witness = (@ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: @@ -323,12 +324,12 @@ let n: type = i32; // 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)] -// CHECK:STDOUT: %Self.as_type.loc9_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_20.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type.loc9_18: type = pattern_type %Self.as_type.loc9_20.1 [symbolic = %pattern_type.loc9_18 (constants.%pattern_type.701)] -// CHECK:STDOUT: %.loc9_31.1: Core.Form = init_form %T [symbolic = %.loc9_31.1 (constants.%.184)] -// CHECK:STDOUT: %pattern_type.loc9_31: type = pattern_type %T [symbolic = %pattern_type.loc9_31 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %Self.as_type.loc9_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_14.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type.loc9_14: type = pattern_type %Self.as_type.loc9_14.1 [symbolic = %pattern_type.loc9_14 (constants.%pattern_type.701)] +// CHECK:STDOUT: %.loc9_23.1: Core.Form = init_form %T [symbolic = %.loc9_23.1 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc9_23: type = pattern_type %T [symbolic = %pattern_type.loc9_23 (constants.%pattern_type.51d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc9_20.1 (%Self.as_type)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%T (%T); +// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc9_14.1 (%Self.as_type)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) { @@ -347,10 +348,10 @@ let n: type = i32; // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3aa // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc9_20.1 => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type.loc9_18 => constants.%pattern_type.701 -// CHECK:STDOUT: %.loc9_31.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc9_31 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc9_14.1 => constants.%Self.as_type +// CHECK:STDOUT: %pattern_type.loc9_14 => constants.%pattern_type.701 +// CHECK:STDOUT: %.loc9_23.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc9_23 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_use_fake_int.carbon diff --git a/toolchain/check/testdata/patterns/unused.carbon b/toolchain/check/testdata/patterns/unused.carbon index da90f5ece8fb..3f7e87456b04 100644 --- a/toolchain/check/testdata/patterns/unused.carbon +++ b/toolchain/check/testdata/patterns/unused.carbon @@ -184,6 +184,17 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: fn F(unused x: i32); +// --- fail_unused_self_decl.carbon +library "[[@TEST_NAME]]"; + +class C { + // CHECK:STDERR: fail_unused_self_decl.carbon:[[@LINE+4]]:15: error: `unused` modifier without a definition [UnusedModifierWithoutDefinition] + // CHECK:STDERR: fn F(unused self); + // CHECK:STDERR: ^~~~ + // CHECK:STDERR: + fn F(unused self); +} + // --- fail_unused_implicit_param_decl.carbon library "[[@TEST_NAME]]"; @@ -197,6 +208,10 @@ library "[[@TEST_NAME]]"; fn F[unused T:! type](); class C { + // CHECK:STDERR: fail_unused_implicit_param_decl.carbon:[[@LINE+8]]:15: error: `self` must be declared in the explicit parameter list [SelfInImplicitParamList] + // CHECK:STDERR: fn G[unused self: Self](); + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: // CHECK:STDERR: fail_unused_implicit_param_decl.carbon:[[@LINE+4]]:15: error: `unused` modifier without a definition [UnusedModifierWithoutDefinition] // CHECK:STDERR: fn G[unused self: Self](); // CHECK:STDERR: ^~~~~~~~~~ diff --git a/toolchain/check/testdata/pointer/arrow.carbon b/toolchain/check/testdata/pointer/arrow.carbon index b4378eb3c768..76fcf6ffe0db 100644 --- a/toolchain/check/testdata/pointer/arrow.carbon +++ b/toolchain/check/testdata/pointer/arrow.carbon @@ -13,7 +13,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/arrow.carbon class C { - fn Member[self: Self](); + fn Member(self); var field: C*; } diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index 0216f3edaed2..b4b8c946623c 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -17,6 +17,7 @@ fn F(p: const (const (const i32*)*)) -> const i32 { return **p; } + // CHECK:STDOUT: --- nested_const.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -106,6 +107,8 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: %.loc17_10.2: %const.6a8 = acquire_value %.loc17_10.1 // CHECK:STDOUT: %impl.elem0: %.367 = impl_witness_access constants.%Copy.impl_witness.0b0, element0 [concrete = constants.%const.as.Copy.impl.Op.9cf] // CHECK:STDOUT: %bound_method.loc17_10.1: = bound_method %.loc17_10.2, %impl.elem0 +// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value constants.%i32, (constants.%Copy.impl_witness.0e0) [concrete = constants.%Copy.facet.987] +// CHECK:STDOUT: %.loc17_10.3: %Copy.type = converted constants.%i32, %Copy.facet [concrete = constants.%Copy.facet.987] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @const.as.Copy.impl.Op(constants.%Copy.facet.987) [concrete = constants.%const.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc17_10.2: = bound_method %.loc17_10.2, %specific_fn // CHECK:STDOUT: %const.as.Copy.impl.Op.call: init %const.6a8 = call %bound_method.loc17_10.2(%.loc17_10.2) diff --git a/toolchain/check/testdata/return/import_convert_function.carbon b/toolchain/check/testdata/return/import_convert_function.carbon index 8fb9b2952896..31da74135241 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -20,14 +20,14 @@ class C(N:! i32) {} class D { var n: i32; var m: i32; } fn Make() -> D { return {.n = 0, .m = 0}; } -impl C(0) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } -impl C(1) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } -impl C(2) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } -impl C(3) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } -impl C(4) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } -impl C(5) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } -impl C(6) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } -impl C(7) as Core.ImplicitAs(D) { fn Convert[unused self: Self]() -> D { return Make(); } } +impl C(0) as Core.ImplicitAs(D) { fn Convert(unused self) -> D { return Make(); } } +impl C(1) as Core.ImplicitAs(D) { fn Convert(unused self) -> D { return Make(); } } +impl C(2) as Core.ImplicitAs(D) { fn Convert(unused self) -> D { return Make(); } } +impl C(3) as Core.ImplicitAs(D) { fn Convert(unused self) -> D { return Make(); } } +impl C(4) as Core.ImplicitAs(D) { fn Convert(unused self) -> D { return Make(); } } +impl C(5) as Core.ImplicitAs(D) { fn Convert(unused self) -> D { return Make(); } } +impl C(6) as Core.ImplicitAs(D) { fn Convert(unused self) -> D { return Make(); } } +impl C(7) as Core.ImplicitAs(D) { fn Convert(unused self) -> D { return Make(); } } // --- user.carbon @@ -47,6 +47,7 @@ fn F0(unused n: i32) -> P.D { return P.Make(); } + // CHECK:STDOUT: --- library.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -340,7 +341,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %pattern_type.b22 = return_slot_pattern %return.param_patt, %D.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc8_70.2: Core.Form = init_form %D.ref [concrete = constants.%.128] +// CHECK:STDOUT: %.loc8_62.2: Core.Form = init_form %D.ref [concrete = constants.%.128] // CHECK:STDOUT: %self.param: %C.771 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.0e1.%C [concrete = constants.%C.771] // CHECK:STDOUT: %self: %C.771 = value_binding self, %self.param @@ -366,7 +367,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %pattern_type.b22 = return_slot_pattern %return.param_patt, %D.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc9_70.2: Core.Form = init_form %D.ref [concrete = constants.%.128] +// CHECK:STDOUT: %.loc9_62.2: Core.Form = init_form %D.ref [concrete = constants.%.128] // CHECK:STDOUT: %self.param: %C.83b = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.f6a.%C [concrete = constants.%C.83b] // CHECK:STDOUT: %self: %C.83b = value_binding self, %self.param @@ -392,7 +393,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %pattern_type.b22 = return_slot_pattern %return.param_patt, %D.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc10_70.2: Core.Form = init_form %D.ref [concrete = constants.%.128] +// CHECK:STDOUT: %.loc10_62.2: Core.Form = init_form %D.ref [concrete = constants.%.128] // CHECK:STDOUT: %self.param: %C.5ce = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.aab.%C [concrete = constants.%C.5ce] // CHECK:STDOUT: %self: %C.5ce = value_binding self, %self.param @@ -418,7 +419,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %pattern_type.b22 = return_slot_pattern %return.param_patt, %D.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc11_70.2: Core.Form = init_form %D.ref [concrete = constants.%.128] +// CHECK:STDOUT: %.loc11_62.2: Core.Form = init_form %D.ref [concrete = constants.%.128] // CHECK:STDOUT: %self.param: %C.b3e = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.203.%C [concrete = constants.%C.b3e] // CHECK:STDOUT: %self: %C.b3e = value_binding self, %self.param @@ -444,7 +445,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %pattern_type.b22 = return_slot_pattern %return.param_patt, %D.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc12_70.2: Core.Form = init_form %D.ref [concrete = constants.%.128] +// CHECK:STDOUT: %.loc12_62.2: Core.Form = init_form %D.ref [concrete = constants.%.128] // CHECK:STDOUT: %self.param: %C.8ee = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.371.%C [concrete = constants.%C.8ee] // CHECK:STDOUT: %self: %C.8ee = value_binding self, %self.param @@ -470,7 +471,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %pattern_type.b22 = return_slot_pattern %return.param_patt, %D.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc13_70.2: Core.Form = init_form %D.ref [concrete = constants.%.128] +// CHECK:STDOUT: %.loc13_62.2: Core.Form = init_form %D.ref [concrete = constants.%.128] // CHECK:STDOUT: %self.param: %C.5c1 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.c73.%C [concrete = constants.%C.5c1] // CHECK:STDOUT: %self: %C.5c1 = value_binding self, %self.param @@ -496,7 +497,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %pattern_type.b22 = return_slot_pattern %return.param_patt, %D.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc14_70.2: Core.Form = init_form %D.ref [concrete = constants.%.128] +// CHECK:STDOUT: %.loc14_62.2: Core.Form = init_form %D.ref [concrete = constants.%.128] // CHECK:STDOUT: %self.param: %C.57b = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.2f3.%C [concrete = constants.%C.57b] // CHECK:STDOUT: %self: %C.57b = value_binding self, %self.param @@ -522,7 +523,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %return.patt: %pattern_type.b22 = return_slot_pattern %return.param_patt, %D.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %.loc15_70.2: Core.Form = init_form %D.ref [concrete = constants.%.128] +// CHECK:STDOUT: %.loc15_62.2: Core.Form = init_form %D.ref [concrete = constants.%.128] // CHECK:STDOUT: %self.param: %C.b0a = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @C.as.ImplicitAs.impl.28a.%C [concrete = constants.%C.b0a] // CHECK:STDOUT: %self: %C.b0a = value_binding self, %self.param @@ -595,64 +596,64 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc8(%self.param: %C.771) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc8_70.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc8_70.1 = call %Make.ref() +// CHECK:STDOUT: %.loc8_62.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc8_62.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc9(%self.param: %C.83b) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc9_70.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc9_70.1 = call %Make.ref() +// CHECK:STDOUT: %.loc9_62.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc9_62.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc10(%self.param: %C.5ce) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc10_70.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc10_70.1 = call %Make.ref() +// CHECK:STDOUT: %.loc10_62.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc10_62.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc11(%self.param: %C.b3e) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc11_70.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc11_70.1 = call %Make.ref() +// CHECK:STDOUT: %.loc11_62.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc11_62.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc12(%self.param: %C.8ee) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc12_70.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc12_70.1 = call %Make.ref() +// CHECK:STDOUT: %.loc12_62.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc12_62.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc13(%self.param: %C.5c1) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc13_70.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc13_70.1 = call %Make.ref() +// CHECK:STDOUT: %.loc13_62.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc13_62.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc14(%self.param: %C.57b) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc14_70.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc14_70.1 = call %Make.ref() +// CHECK:STDOUT: %.loc14_62.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc14_62.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.loc15(%self.param: %C.b0a) -> out %return.param: %D { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %.loc15_70.1: ref %D = splice_block %return.param {} -// CHECK:STDOUT: %Make.call: init %D to %.loc15_70.1 = call %Make.ref() +// CHECK:STDOUT: %.loc15_62.1: ref %D = splice_block %return.param {} +// CHECK:STDOUT: %Make.call: init %D to %.loc15_62.1 = call %Make.ref() // CHECK:STDOUT: return %Make.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: @@ -937,22 +938,22 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %P.import_ref.2b7: = import_ref P//library, loc15_33, loaded [concrete = constants.%ImplicitAs.impl_witness.82a] // CHECK:STDOUT: %P.import_ref.584: type = import_ref P//library, loc15_9, loaded [concrete = constants.%C.b0a] // CHECK:STDOUT: %P.import_ref.4efc12.8: type = import_ref P//library, loc15_31, loaded [concrete = constants.%ImplicitAs.type.24d] -// CHECK:STDOUT: %P.import_ref.b89e2b.1: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.1 = import_ref P//library, loc8_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.1] +// CHECK:STDOUT: %P.import_ref.b89e2b.1: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.1 = import_ref P//library, loc8_64, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.1] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.f81 = impl_witness_table (%P.import_ref.b89e2b.1), @C.as.ImplicitAs.impl.fa9 [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %P.import_ref.b89e2b.2: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.2 = import_ref P//library, loc9_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.2] +// CHECK:STDOUT: %P.import_ref.b89e2b.2: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.2 = import_ref P//library, loc9_64, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.2] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.032 = impl_witness_table (%P.import_ref.b89e2b.2), @C.as.ImplicitAs.impl.c89 [concrete] -// CHECK:STDOUT: %P.import_ref.b89e2b.3: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.3 = import_ref P//library, loc10_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.3] +// CHECK:STDOUT: %P.import_ref.b89e2b.3: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.3 = import_ref P//library, loc10_64, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.3] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.93f = impl_witness_table (%P.import_ref.b89e2b.3), @C.as.ImplicitAs.impl.cc3 [concrete] -// CHECK:STDOUT: %P.import_ref.b89e2b.4: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.4 = import_ref P//library, loc11_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.4] +// CHECK:STDOUT: %P.import_ref.b89e2b.4: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.4 = import_ref P//library, loc11_64, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.4] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.62c = impl_witness_table (%P.import_ref.b89e2b.4), @C.as.ImplicitAs.impl.2a2 [concrete] -// CHECK:STDOUT: %P.import_ref.b89e2b.5: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.5 = import_ref P//library, loc12_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.5] +// CHECK:STDOUT: %P.import_ref.b89e2b.5: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.5 = import_ref P//library, loc12_64, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.5] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.3ac = impl_witness_table (%P.import_ref.b89e2b.5), @C.as.ImplicitAs.impl.862 [concrete] -// CHECK:STDOUT: %P.import_ref.b89e2b.6: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.6 = import_ref P//library, loc13_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.6] +// CHECK:STDOUT: %P.import_ref.b89e2b.6: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.6 = import_ref P//library, loc13_64, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.6] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a96 = impl_witness_table (%P.import_ref.b89e2b.6), @C.as.ImplicitAs.impl.6ea [concrete] -// CHECK:STDOUT: %P.import_ref.b89e2b.7: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.7 = import_ref P//library, loc14_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.7] +// CHECK:STDOUT: %P.import_ref.b89e2b.7: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.7 = import_ref P//library, loc14_64, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.7] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.91e = impl_witness_table (%P.import_ref.b89e2b.7), @C.as.ImplicitAs.impl.36b [concrete] -// CHECK:STDOUT: %P.import_ref.b89e2b.8: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.8 = import_ref P//library, loc15_72, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.8] +// CHECK:STDOUT: %P.import_ref.b89e2b.8: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.8 = import_ref P//library, loc15_64, loaded [concrete = constants.%C.as.ImplicitAs.impl.Convert.3cefb0.8] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.990 = impl_witness_table (%P.import_ref.b89e2b.8), @C.as.ImplicitAs.impl.550 [concrete] // CHECK:STDOUT: %P.Make: %Make.type = import_ref P//library, Make, loaded [concrete = constants.%Make] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/element_access.carbon b/toolchain/check/testdata/tuple/element_access.carbon index 27955a1f82f6..eb29f108dcfe 100644 --- a/toolchain/check/testdata/tuple/element_access.carbon +++ b/toolchain/check/testdata/tuple/element_access.carbon @@ -33,11 +33,11 @@ var d: i32 = a.({.index = 1 as i32}.index); library "[[@TEST_NAME]]"; interface I { - fn F[self: Self](); + fn F(self); } impl (i32, i32) as I { - fn F[unused self: Self]() {} + fn F(unused self) {} } fn G(x: (i32, i32)) { @@ -51,7 +51,7 @@ base class Base {} class Derived { extend base: Base; } interface I { - fn F[self: Self]() -> Base*; + fn F(self) -> Base*; } var d: Derived; @@ -60,7 +60,7 @@ impl (i32, i32) as I { // This requires a thunk due to the return type mismatch. // The thunk internally contains an element access of the form // `self.(RealF)()`. - fn F[unused self: Self]() -> Derived* { return &d; } + fn F(unused self) -> Derived* { return &d; } } fn G(x: (i32, i32)) { @@ -71,7 +71,7 @@ fn G(x: (i32, i32)) { library "[[@TEST_NAME]]"; class C { - fn F[self: (i32, i32)](); + fn F(self: (i32, i32)); } fn G(x: (i32, i32)) { @@ -147,8 +147,8 @@ var b: i32 = 0; // CHECK:STDERR: var c: i32 = a.(b); // CHECK:STDERR: ^ // CHECK:STDERR: min_prelude/parts/int.carbon:27:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] -// CHECK:STDERR: fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Convert(self) -> IntLiteral = "int.convert_checked"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+4]]:14: error: tuple index must be a constant [TupleIndexNotConstant] // CHECK:STDERR: var c: i32 = a.(b); diff --git a/toolchain/check/testdata/var/initialization.carbon b/toolchain/check/testdata/var/initialization.carbon index f7ded69bf3f7..8b559b68aba2 100644 --- a/toolchain/check/testdata/var/initialization.carbon +++ b/toolchain/check/testdata/var/initialization.carbon @@ -19,7 +19,7 @@ interface DefaultOrUnformed { } interface Destroy { - fn Op[ref self: Self](); + fn Op(ref self); } impl () as DefaultOrUnformed { diff --git a/toolchain/check/testdata/var/var_pattern.carbon b/toolchain/check/testdata/var/var_pattern.carbon index 25c371b99b82..b3e217792d47 100644 --- a/toolchain/check/testdata/var/var_pattern.carbon +++ b/toolchain/check/testdata/var/var_pattern.carbon @@ -110,7 +110,7 @@ fn f() { library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:10: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant] +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:10: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant] // CHECK:STDERR: fn F[var u: ()](); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -131,7 +131,7 @@ fn G[var T:! type](); library "[[@TEST_NAME]]"; class C { - fn F[var self: Self](); + fn F(var self); } // --- nested_match.carbon @@ -866,12 +866,14 @@ fn Call() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %C.F.decl: %C.F.type = fn_decl @C.F [concrete = constants.%C.F] { -// CHECK:STDOUT: %self.patt: %pattern_type = ref_binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type = var_param_pattern %self.patt [concrete] +// CHECK:STDOUT: %self.param_patt.loc5_12: %pattern_type = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: %pattern_type = at_binding_pattern self, %self.param_patt.loc5_12 [concrete] +// CHECK:STDOUT: %self.param_patt.loc5_8: %pattern_type = var_param_pattern %self.patt [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self.param.loc5_8: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self.param.loc5_12: %C = value_param call_param1 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C] -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: %self: %C = value_binding self, %self.param.loc5_12 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type @@ -881,7 +883,7 @@ fn Call() { // CHECK:STDOUT: .F = %C.F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C.F(%self.param: ref %C); +// CHECK:STDOUT: fn @C.F(%self.param.loc5_8: ref %C, %self.param.loc5_12: %C); // CHECK:STDOUT: // CHECK:STDOUT: --- nested_match.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/dot_self_impls.carbon b/toolchain/check/testdata/where_expr/dot_self_impls.carbon index 327555edc244..c00b86347512 100644 --- a/toolchain/check/testdata/where_expr/dot_self_impls.carbon +++ b/toolchain/check/testdata/where_expr/dot_self_impls.carbon @@ -15,12 +15,12 @@ library "[[@TEST_NAME]]"; interface I { fn FNonInstance(); - fn FSelf[self: Self](); + fn FSelf(self); } interface J { fn GNonInstance(); - fn GSelf[self: Self](); + fn GSelf(self); } fn INotJ[T:! I where .Self impls J](x: T) { @@ -119,12 +119,12 @@ library "[[@TEST_NAME]]"; interface I { fn FNonInstance(); - fn FSelf[self: Self](); + fn FSelf(self); } interface J { fn GNonInstance(); - fn GSelf[self: Self](); + fn GSelf(self); } fn INotJ[T:! I where .Self impls J](x: T) { diff --git a/toolchain/check/thunk.cpp b/toolchain/check/thunk.cpp index 0da0b57ffbda..9da18f53306b 100644 --- a/toolchain/check/thunk.cpp +++ b/toolchain/check/thunk.cpp @@ -226,7 +226,8 @@ static auto CloneFunctionDecl(Context& context, SemIR::LocId loc_id, signature.return_type_inst_id); auto return_form_inst_id = CloneInstId(context, signature_specific_id, signature.return_form_inst_id); - auto self_param_id = FindSelfPattern(context, implicit_param_patterns_id); + auto self_param_id = + FindSelfPattern(context, implicit_param_patterns_id, param_patterns_id); auto pattern_block_id = context.pattern_block_stack().Pop(); // Perform callee-side pattern matching to rebuild the parameter list. @@ -286,8 +287,8 @@ auto PerformThunkCall(Context& context, SemIR::LocId loc_id, SemIR::TypeId override_self_type_id) -> SemIR::InstId { auto& function = context.functions().Get(function_id); - auto [args_vec, ignored_call_args] = ThunkPatternMatch( - context, function.self_param_id, param_pattern_ids, call_arg_ids); + auto [args_vec, ignored_call_args] = + ThunkPatternMatch(context, param_pattern_ids, call_arg_ids); llvm::ArrayRef args = args_vec; if (override_self_type_id.has_value()) { diff --git a/toolchain/diagnostics/kind.def b/toolchain/diagnostics/kind.def index b84727dd444a..fbe3269954ff 100644 --- a/toolchain/diagnostics/kind.def +++ b/toolchain/diagnostics/kind.def @@ -273,9 +273,7 @@ CARBON_DIAGNOSTIC_KIND(GenericParamMustBeConstant) CARBON_DIAGNOSTIC_KIND(ImplictParamMustBeConstant) CARBON_DIAGNOSTIC_KIND(IncompleteReturnTypeHere) CARBON_DIAGNOSTIC_KIND(InCallToEntity) -CARBON_DIAGNOSTIC_KIND(InCallToFunction) CARBON_DIAGNOSTIC_KIND(InCallToFunctionParam) -CARBON_DIAGNOSTIC_KIND(MissingObjectInMethodCall) CARBON_DIAGNOSTIC_KIND(RefParamNoRefTag) CARBON_DIAGNOSTIC_KIND(RefTagNoRefParam) CARBON_DIAGNOSTIC_KIND(SelfParameterNotAllowed) @@ -487,7 +485,9 @@ CARBON_DIAGNOSTIC_KIND(NegativeIntInUnsignedType) CARBON_DIAGNOSTIC_KIND(NonConstantCallToCompTimeOnlyFunction) CARBON_DIAGNOSTIC_KIND(NonRegularBindingInVarDecl) CARBON_DIAGNOSTIC_KIND(CompTimeOnlyFunctionHere) -CARBON_DIAGNOSTIC_KIND(SelfOutsideImplicitParamList) +CARBON_DIAGNOSTIC_KIND(SelfOutsideParamList) +CARBON_DIAGNOSTIC_KIND(SelfInImplicitParamList) +CARBON_DIAGNOSTIC_KIND(SelfNotFirstParam) CARBON_DIAGNOSTIC_KIND(StringAtIndexOutOfBounds) CARBON_DIAGNOSTIC_KIND(StringAtIndexNegative) CARBON_DIAGNOSTIC_KIND(StringLiteralTooLong) diff --git a/toolchain/docs/adding_features.md b/toolchain/docs/adding_features.md index 06f73e568299..aa7c824a53f5 100644 --- a/toolchain/docs/adding_features.md +++ b/toolchain/docs/adding_features.md @@ -615,10 +615,10 @@ omitted. ``` //@dump-sem-ir-begin class Bar { - fn ImportantCall[self: Self] { ... } + fn ImportantCall(self) { ... } //@dump-sem-ir-end - fn UnimportantCall[self: Self]() { ... } + fn UnimportantCall(self) { ... } } ``` diff --git a/toolchain/docs/diagnostics.md b/toolchain/docs/diagnostics.md index d8c4261cf776..3e9f78633af6 100644 --- a/toolchain/docs/diagnostics.md +++ b/toolchain/docs/diagnostics.md @@ -155,14 +155,14 @@ have their own location information. A diagnostic with a note looks like: ```cpp CARBON_DIAGNOSTIC(CallArgCountMismatch, Error, - "{0} argument{0:s} passed to `{1}` expecting " - "{2} argument{2:s}", - IntAsSelect, std::string, IntAsSelect); + "{0} argument{0:s} passed to function expecting " + "{1} argument{1:s}", + IntAsSelect, IntAsSelect); CARBON_DIAGNOSTIC(InCallToFunction, Note, "calling function declared here"); context.emitter() .Build(call_parse_node, CallArgCountMismatch, - arg_refs.size(), fn_name, aram_refs.size()) + arg_refs.size(), param_refs.size()) .Note(param_parse_node, InCallToFunction) .Emit(); ``` diff --git a/toolchain/docs/lower.md b/toolchain/docs/lower.md index 537406b0f3e2..4e2d4e967678 100644 --- a/toolchain/docs/lower.md +++ b/toolchain/docs/lower.md @@ -175,7 +175,7 @@ The scope mangling scheme is as follows: ```carbon package P1; interface Interface { - fn Op[self: Self](); + fn Op(self); } ``` @@ -185,7 +185,7 @@ class NameSpace.Implementation { // Mangled as: // `_COp.Implementation.NameSpace.Main:Interface.P1` impl as P1.Interface { - fn Op[self: Self]() { + fn Op(self) { } } } diff --git a/toolchain/driver/testdata/compile/optimize/optimize_none.carbon b/toolchain/driver/testdata/compile/optimize/optimize_none.carbon index b9b9ae782986..98e4bd887b7e 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_none.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_none.carbon @@ -182,4 +182,4 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !55 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !35, line: 58, type: !49, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) // CHECK:STDOUT: !56 = !{!57} // CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !7) -// CHECK:STDOUT: !58 = !DILocation(line: 58, column: 36, scope: !55) +// CHECK:STDOUT: !58 = !DILocation(line: 58, column: 28, scope: !55) diff --git a/toolchain/driver/testdata/compile/optimize/optimize_size.carbon b/toolchain/driver/testdata/compile/optimize/optimize_size.carbon index 2ea688cdceab..d32db0da3d72 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_size.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_size.carbon @@ -182,4 +182,4 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !55 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !35, line: 58, type: !49, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) // CHECK:STDOUT: !56 = !{!57} // CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !7) -// CHECK:STDOUT: !58 = !DILocation(line: 58, column: 36, scope: !55) +// CHECK:STDOUT: !58 = !DILocation(line: 58, column: 28, scope: !55) diff --git a/toolchain/lex/token_kind.def b/toolchain/lex/token_kind.def index a2f55d3fda84..96e2ce32f255 100644 --- a/toolchain/lex/token_kind.def +++ b/toolchain/lex/token_kind.def @@ -214,7 +214,8 @@ CARBON_KEYWORD_TOKEN(Ref, "ref") CARBON_KEYWORD_TOKEN(Return, "return") CARBON_KEYWORD_TOKEN(Returned, "returned") CARBON_KEYWORD_TOKEN(SelfTypeIdentifier, "Self") -CARBON_KEYWORD_TOKEN(SelfValueIdentifier, "self") +CARBON_TOKEN_WITH_VIRTUAL_NODE( + CARBON_KEYWORD_TOKEN(SelfValueIdentifier, "self")) CARBON_KEYWORD_TOKEN(Static, "static") // TODO: Although we provide a `str` type literal, it's not standardized. CARBON_KEYWORD_TOKEN(Str, "str") diff --git a/toolchain/lower/testdata/array/field.carbon b/toolchain/lower/testdata/array/field.carbon index 4a4eac3b536f..159bec8ced65 100644 --- a/toolchain/lower/testdata/array/field.carbon +++ b/toolchain/lower/testdata/array/field.carbon @@ -15,11 +15,11 @@ class A { fn Init() -> A { return {.v = (1, 2)}; } - fn Access[self: Self]() -> i32 { + fn Access(self) -> i32 { return self.v[0]; } - fn Use[ref self: Self]() -> i32 { + fn Use(ref self) -> i32 { self.v[0] = 1; return self.v[1]; } diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index ae0c01183b0c..77e6f3819c8e 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -32,7 +32,7 @@ fn F() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_43.3.temp = alloca [6 x i32], align 4, !dbg !7 // CHECK:STDOUT: %var = alloca i32, align 4, !dbg !8 -// CHECK:STDOUT: %.loc17_19.1.temp = alloca <{ i32, i1 }>, align 4, !dbg !8 +// CHECK:STDOUT: %.loc17_19.3.temp = alloca <{ i32, i1 }>, align 4, !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc16_43.3.temp), !dbg !7 // CHECK:STDOUT: %.loc16_43.4.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 0, !dbg !7 // CHECK:STDOUT: %.loc16_43.7.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 1, !dbg !7 @@ -46,18 +46,18 @@ fn F() { // CHECK:STDOUT: br label %for.next, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.next: ; preds = %for.body, %entry -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_19.1.temp), !dbg !8 -// CHECK:STDOUT: call void @"_CNext.e163a239f9fa927c:Iterate.Core.620427d555024fe2"(ptr %.loc17_19.1.temp, ptr @array.loc16_43.24, ptr %var), !dbg !8 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.18012f5191ea64dc(ptr %.loc17_19.1.temp), !dbg !8 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_19.3.temp), !dbg !8 +// CHECK:STDOUT: call void @"_CNext.e163a239f9fa927c:Iterate.Core.620427d555024fe2"(ptr %.loc17_19.3.temp, ptr @array.loc16_43.24, ptr %var), !dbg !8 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.18012f5191ea64dc(ptr %.loc17_19.3.temp), !dbg !8 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.18012f5191ea64dc(ptr %.loc17_19.1.temp), !dbg !8 +// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.18012f5191ea64dc(ptr %.loc17_19.3.temp), !dbg !8 // CHECK:STDOUT: call void @_CG.Main(i32 %Optional.Get.call), !dbg !9 // CHECK:STDOUT: br label %for.next, !dbg !10 // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %for.next -// CHECK:STDOUT: call void @"_COp.ab782c7eec490fc7:core.Destroy.Core"(ptr %.loc17_19.1.temp), !dbg !8 +// CHECK:STDOUT: call void @"_COp.ab782c7eec490fc7:core.Destroy.Core"(ptr %.loc17_19.3.temp), !dbg !8 // CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %var), !dbg !8 // CHECK:STDOUT: call void @"_COp.3a5df7cec745952b:core.Destroy.Core"(ptr @array), !dbg !7 // CHECK:STDOUT: ret void, !dbg !11 @@ -276,7 +276,7 @@ fn F() { // CHECK:STDOUT: !49 = !{!15, !22} // CHECK:STDOUT: !50 = !{!51} // CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !46, type: !22) -// CHECK:STDOUT: !52 = !DILocation(line: 23, column: 46, scope: !46) +// CHECK:STDOUT: !52 = !DILocation(line: 23, column: 38, scope: !46) // CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.e163a239f9fa927c:Iterate.Core.620427d555024fe2", scope: null, file: !47, line: 24, type: !54, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !56) // CHECK:STDOUT: !54 = !DISubroutineType(types: !55) // CHECK:STDOUT: !55 = !{!22, !22, !22} @@ -360,4 +360,4 @@ fn F() { // CHECK:STDOUT: !133 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !82, line: 58, type: !127, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !134) // CHECK:STDOUT: !134 = !{!135} // CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !133, type: !15) -// CHECK:STDOUT: !136 = !DILocation(line: 58, column: 36, scope: !133) +// CHECK:STDOUT: !136 = !DILocation(line: 58, column: 28, scope: !133) diff --git a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon index 500fa2446731..d8c4a21c04a6 100644 --- a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon +++ b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon @@ -11,7 +11,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon fn AddNonmethod(a: i32, b: i32) -> i32 = "int.sadd"; -fn AddMethod[self: i32](b: i32) -> i32 = "int.sadd"; +fn AddMethod(self: i32, b: i32) -> i32 = "int.sadd"; fn TestAddNonmethod(a: i32, b: i32) -> i32 { return AddNonmethod(a, b); } fn TestAddMethod(a: i32, b: i32) -> i32 { return a.(AddMethod)(b); } diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 89d06a865a88..038f595e664d 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -30,7 +30,7 @@ class PairAdapter { return PairOfInts.Make() as Self; } - fn GetB[self: Self]() -> i32 { + fn GetB(self) -> i32 { let pi: PairOfInts = self as PairOfInts; return pi.b; } @@ -49,7 +49,7 @@ class Int { adapt i32; impl as Core.Copy { - fn Op[self: Self]() -> Self { return (self as i32).(Core.Copy.Op)() as Int; } + fn Op(self) -> Self { return (self as i32).(Core.Copy.Op)() as Int; } } } @@ -212,7 +212,7 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 8, column: 35, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 8, column: 27, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "DoStuff", linkageName: "_CDoStuff.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !12) // CHECK:STDOUT: !12 = !{!13} // CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !11, type: !7) diff --git a/toolchain/lower/testdata/class/convert.carbon b/toolchain/lower/testdata/class/convert.carbon index 1fc54aed8a86..795701c39f4f 100644 --- a/toolchain/lower/testdata/class/convert.carbon +++ b/toolchain/lower/testdata/class/convert.carbon @@ -15,7 +15,7 @@ class IntWrapper { } impl IntWrapper as Core.ImplicitAs(i32) { - fn Convert[self: Self]() -> i32 { return self.n; } + fn Convert(self) -> i32 { return self.n; } } fn Consume(_: i32) {} @@ -33,9 +33,9 @@ fn DoIt() { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define i32 @"_CConvert.IntWrapper.Main:ImplicitAs.84588f41d61dafba.Core"(ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_48.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: %.loc18_48.2 = load i32, ptr %.loc18_48.1.n, align 4, !dbg !11 -// CHECK:STDOUT: ret i32 %.loc18_48.2, !dbg !12 +// CHECK:STDOUT: %.loc18_40.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: %.loc18_40.2 = load i32, ptr %.loc18_40.1.n, align 4, !dbg !11 +// CHECK:STDOUT: ret i32 %.loc18_40.2, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind @@ -98,8 +98,8 @@ fn DoIt() { // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !9 = !{!10} // CHECK:STDOUT: !10 = !DILocalVariable(arg: 1, scope: !4, type: !8) -// CHECK:STDOUT: !11 = !DILocation(line: 18, column: 44, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 18, column: 37, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 18, column: 36, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 18, column: 29, scope: !4) // CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Consume", linkageName: "_CConsume.Main", scope: null, file: !3, line: 21, type: !14, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16) // CHECK:STDOUT: !14 = !DISubroutineType(types: !15) // CHECK:STDOUT: !15 = !{null, !7} diff --git a/toolchain/lower/testdata/class/generic.carbon b/toolchain/lower/testdata/class/generic.carbon index e1b8383f947c..54133ac517af 100644 --- a/toolchain/lower/testdata/class/generic.carbon +++ b/toolchain/lower/testdata/class/generic.carbon @@ -72,10 +72,10 @@ fn Tuples() -> A((i32, i32)) { library "[[@TEST_NAME]]"; class C(T:! Core.Copy) { - fn GetBool[self: Self]() -> bool { + fn GetBool(self) -> bool { return self.v; } - fn GetT[self: Self]() -> T { + fn GetT(self) -> T { return self.w; } var v: bool; diff --git a/toolchain/lower/testdata/class/method.carbon b/toolchain/lower/testdata/class/method.carbon index f28126b15548..1bc45cb67344 100644 --- a/toolchain/lower/testdata/class/method.carbon +++ b/toolchain/lower/testdata/class/method.carbon @@ -13,8 +13,8 @@ class C { var a: i32; - fn Get[self: C]() -> i32; - fn Set[ref self: C](n: i32); + fn Get(self: C) -> i32; + fn Set(ref self: C, n: i32); } fn F(p: C*) { diff --git a/toolchain/lower/testdata/class/self.carbon b/toolchain/lower/testdata/class/self.carbon index c87bd0e394d0..8e67a02fe3e9 100644 --- a/toolchain/lower/testdata/class/self.carbon +++ b/toolchain/lower/testdata/class/self.carbon @@ -13,15 +13,15 @@ class C { var a: i32; - fn Get[self: C]() -> i32; - fn Set[ref self: C](); + fn Get(self: C) -> i32; + fn Set(ref self: C); } -fn C.Get[self: C]() -> i32 { +fn C.Get(self: C) -> i32 { return self.a; } -fn C.Set[ref self: C]() { +fn C.Set(ref self: C) { self.a = 1; } diff --git a/toolchain/lower/testdata/class/virtual.carbon b/toolchain/lower/testdata/class/virtual.carbon index 52f05c30976e..4e3dae86bc5f 100644 --- a/toolchain/lower/testdata/class/virtual.carbon +++ b/toolchain/lower/testdata/class/virtual.carbon @@ -19,12 +19,12 @@ base class Base { base class Intermediate { extend base: Base; - virtual fn Fn[unused self: Self]() { } + virtual fn Fn(unused self) { } } class Derived { extend base: Intermediate; - override fn Fn[unused self: Self]() { } + override fn Fn(unused self) { } } // --- create.carbon @@ -82,7 +82,7 @@ package MemberInit; base class Base { var m: i32; - virtual fn Fn[unused self: Self]() { } + virtual fn Fn(unused self) { } } fn Fn() { @@ -97,7 +97,7 @@ fn Fn() { library "[[@TEST_NAME]]"; base class Base { - virtual fn F[self: Self](); + virtual fn F(self); } class Derived { @@ -113,7 +113,7 @@ fn Use() { library "[[@TEST_NAME]]"; base class Base { - virtual fn F[self: Self](); + virtual fn F(self); } fn Use(b: Base) { @@ -125,12 +125,12 @@ fn Use(b: Base) { library "[[@TEST_NAME]]"; base class Base { - virtual fn F[self: Self](); + virtual fn F(self); } class Derived { extend base: Base; - override fn F[self: Self](); + override fn F(self); } fn Use() { @@ -143,7 +143,7 @@ fn Use() { library "[[@TEST_NAME]]"; base class Base(T:! type) { - virtual fn F[unused self: Self]() { } + virtual fn F(unused self) { } } // --- generic_use.carbon @@ -151,7 +151,7 @@ base class Base(T:! type) { library "[[@TEST_NAME]]"; base class Base(T:! Core.Destroy) { - virtual fn F[unused self: Self]() { + virtual fn F(unused self) { var _: T; } } @@ -171,7 +171,7 @@ fn F() { library "[[@TEST_NAME]]"; base class Base(T:! type) { - virtual fn F[unused self: Self]() { } + virtual fn F(unused self) { } } class T1; @@ -192,16 +192,16 @@ class From {} class To {} impl From as Core.ImplicitAs(To) { - fn Convert[self: From]() -> To; + fn Convert(self: From) -> To; } base class Base { - virtual fn F[ref self: Self](n: From) -> To; + virtual fn F(ref self, n: From) -> To; } class Derived { extend base: Base; - override fn F[unused self: Self](unused n: To) -> From { + override fn F(unused self, unused n: To) -> From { return {}; } } @@ -1119,15 +1119,15 @@ fn Use() { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define void @"_CF:thunk:Base.Main:Derived.Main"(ptr sret({}) %return, ptr %self, ptr %n) #1 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_58.2.temp = alloca {}, align 1, !dbg !16 -// CHECK:STDOUT: %.loc12_33.1.temp = alloca {}, align 1, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_58.2.temp), !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_33.1.temp), !dbg !17 -// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %.loc12_33.1.temp, ptr %n), !dbg !17 -// CHECK:STDOUT: call void @_CF.Derived.Main(ptr %.loc17_58.2.temp, ptr %self, ptr %.loc12_33.1.temp), !dbg !16 -// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %return, ptr %.loc17_58.2.temp), !dbg !16 -// CHECK:STDOUT: call void @"_COp.419398171642b7b7:core.Destroy.Core"(ptr %.loc17_58.2.temp), !dbg !16 -// CHECK:STDOUT: call void @"_COp.41ca6508118965ec:core.Destroy.Core"(ptr %.loc12_33.1.temp), !dbg !17 +// CHECK:STDOUT: %.loc17_52.2.temp = alloca {}, align 1, !dbg !16 +// CHECK:STDOUT: %.loc12_27.1.temp = alloca {}, align 1, !dbg !17 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_52.2.temp), !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_27.1.temp), !dbg !17 +// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %.loc12_27.1.temp, ptr %n), !dbg !17 +// CHECK:STDOUT: call void @_CF.Derived.Main(ptr %.loc17_52.2.temp, ptr %self, ptr %.loc12_27.1.temp), !dbg !16 +// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %return, ptr %.loc17_52.2.temp), !dbg !16 +// CHECK:STDOUT: call void @"_COp.419398171642b7b7:core.Destroy.Core"(ptr %.loc17_52.2.temp), !dbg !16 +// CHECK:STDOUT: call void @"_COp.41ca6508118965ec:core.Destroy.Core"(ptr %.loc12_27.1.temp), !dbg !17 // CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1230,7 +1230,7 @@ fn Use() { // CHECK:STDOUT: !14 = !DILocalVariable(arg: 1, scope: !12, type: !7) // CHECK:STDOUT: !15 = !DILocalVariable(arg: 2, scope: !12, type: !7) // CHECK:STDOUT: !16 = !DILocation(line: 17, column: 3, scope: !12) -// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 32, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 26, scope: !12) // CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.419398171642b7b7:core.Destroy.Core", scope: null, file: !3, line: 17, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !21) // CHECK:STDOUT: !19 = !DISubroutineType(types: !20) // CHECK:STDOUT: !20 = !{null, !7} @@ -1240,7 +1240,7 @@ fn Use() { // CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.41ca6508118965ec:core.Destroy.Core", scope: null, file: !3, line: 12, type: !19, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !25) // CHECK:STDOUT: !25 = !{!26} // CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !7) -// CHECK:STDOUT: !27 = !DILocation(line: 12, column: 32, scope: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 12, column: 26, scope: !24) // CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !3, line: 22, type: !29, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !29 = !DISubroutineType(types: !30) // CHECK:STDOUT: !30 = !{null} diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index 8938f374c16b..db7800cb27e5 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -12,10 +12,10 @@ class EmptyRange(T:! Core.Copy & Core.Destroy) { impl as Core.Iterate where .CursorType = {} and .ElementType = T { - fn NewCursor[unused self: Self]() -> {} { + fn NewCursor(unused self) -> {} { return {}; } - fn Next[unused self: Self](_: {}*) -> Core.Optional(T) { + fn Next(unused self, _: {}*) -> Core.Optional(T) { return Core.Optional(T).None(); } } diff --git a/toolchain/lower/testdata/for/break_continue.carbon b/toolchain/lower/testdata/for/break_continue.carbon index 5ef99d7e4ca0..5a4c71f404b1 100644 --- a/toolchain/lower/testdata/for/break_continue.carbon +++ b/toolchain/lower/testdata/for/break_continue.carbon @@ -318,8 +318,8 @@ fn For() { // CHECK:STDOUT: !59 = !{!22, !29} // CHECK:STDOUT: !60 = !{!61} // CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !57, type: !29) -// CHECK:STDOUT: !62 = !DILocation(line: 25, column: 51, scope: !57) -// CHECK:STDOUT: !63 = !DILocation(line: 25, column: 44, scope: !57) +// CHECK:STDOUT: !62 = !DILocation(line: 25, column: 43, scope: !57) +// CHECK:STDOUT: !63 = !DILocation(line: 25, column: 36, scope: !57) // CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 26, type: !65, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !67) // CHECK:STDOUT: !65 = !DISubroutineType(types: !66) // CHECK:STDOUT: !66 = !{!29, !29, !29} @@ -405,4 +405,4 @@ fn For() { // CHECK:STDOUT: !146 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !95, line: 58, type: !140, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !147) // CHECK:STDOUT: !147 = !{!148} // CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !146, type: !22) -// CHECK:STDOUT: !149 = !DILocation(line: 58, column: 36, scope: !146) +// CHECK:STDOUT: !149 = !DILocation(line: 58, column: 28, scope: !146) diff --git a/toolchain/lower/testdata/for/for.carbon b/toolchain/lower/testdata/for/for.carbon index 71f87a7127e9..da2c720c0d7b 100644 --- a/toolchain/lower/testdata/for/for.carbon +++ b/toolchain/lower/testdata/for/for.carbon @@ -302,8 +302,8 @@ fn For() { // CHECK:STDOUT: !55 = !{!18, !25} // CHECK:STDOUT: !56 = !{!57} // CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !53, type: !25) -// CHECK:STDOUT: !58 = !DILocation(line: 25, column: 51, scope: !53) -// CHECK:STDOUT: !59 = !DILocation(line: 25, column: 44, scope: !53) +// CHECK:STDOUT: !58 = !DILocation(line: 25, column: 43, scope: !53) +// CHECK:STDOUT: !59 = !DILocation(line: 25, column: 36, scope: !53) // CHECK:STDOUT: !60 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !15, line: 26, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !63) // CHECK:STDOUT: !61 = !DISubroutineType(types: !62) // CHECK:STDOUT: !62 = !{!25, !25, !25} @@ -389,4 +389,4 @@ fn For() { // CHECK:STDOUT: !142 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !91, line: 58, type: !136, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !143) // CHECK:STDOUT: !143 = !{!144} // CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !142, type: !18) -// CHECK:STDOUT: !145 = !DILocation(line: 58, column: 36, scope: !142) +// CHECK:STDOUT: !145 = !DILocation(line: 58, column: 28, scope: !142) diff --git a/toolchain/lower/testdata/function/generic/call_basic.carbon b/toolchain/lower/testdata/function/generic/call_basic.carbon index 9e41df7b71bb..ba6040cf2993 100644 --- a/toolchain/lower/testdata/function/generic/call_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_basic.carbon @@ -12,7 +12,7 @@ class C { impl as Core.Copy { - fn Op[unused self: Self]() -> Self { return {}; } + fn Op(unused self) -> Self { return {}; } } } @@ -60,12 +60,12 @@ fn M() { // CHECK:STDOUT: // CHECK:STDOUT: %type = type {} // CHECK:STDOUT: -// CHECK:STDOUT: @C.val.loc15_51 = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc15_43 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_COp.C.Main:Copy.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_51, i64 0, i1 false), !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_43, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -284,7 +284,7 @@ fn M() { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 42, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 34, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !3, line: 43, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) // CHECK:STDOUT: !13 = !{null, !7} diff --git a/toolchain/lower/testdata/function/generic/call_method.carbon b/toolchain/lower/testdata/function/generic/call_method.carbon index 10825b11b0b1..2ae21b958b2c 100644 --- a/toolchain/lower/testdata/function/generic/call_method.carbon +++ b/toolchain/lower/testdata/function/generic/call_method.carbon @@ -11,7 +11,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/function/generic/call_method.carbon class C { - fn F[unused self: Self, T:! Core.Copy](x: T) -> T { + fn F[T:! Core.Copy](unused self, x: T) -> T { return x; } } diff --git a/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon b/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon index 4f5c1989714d..3c9fd3c7e7dd 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon @@ -12,7 +12,7 @@ class C { impl as Core.Copy { - fn Op[unused self: Self]() -> Self { return {}; } + fn Op(unused self) -> Self { return {}; } } } @@ -43,12 +43,12 @@ fn M() { // CHECK:STDOUT: ; ModuleID = 'call_recursive_basic.carbon' // CHECK:STDOUT: source_filename = "call_recursive_basic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @C.val.loc15_51 = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc15_43 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_COp.C.Main:Copy.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_51, i64 0, i1 false), !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc15_43, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -78,7 +78,7 @@ fn M() { // CHECK:STDOUT: %.loc37_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !26 // CHECK:STDOUT: %F.call.loc37 = call ptr @_CF.Main.2621742a01881e29(ptr %.loc37_5, i32 0), !dbg !27 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !18 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.loc15_51, i64 0, i1 false), !dbg !18 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.loc15_43, i64 0, i1 false), !dbg !18 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc40_9.2.temp), !dbg !19 // CHECK:STDOUT: call void @_CF.Main.4d597ec621e4ba00(ptr %.loc40_9.2.temp, ptr %c.var, i32 0), !dbg !19 // CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %.loc40_9.2.temp), !dbg !19 @@ -195,7 +195,7 @@ fn M() { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 42, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 34, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 28, type: !12, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) // CHECK:STDOUT: !13 = !{null} diff --git a/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon b/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon index 2baeb35aa081..7868db470d2a 100644 --- a/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon +++ b/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon @@ -15,7 +15,7 @@ // generic function for an object, from a generic context. // The specifics with a pointer type could be deduplicated here. class C { - fn Cfn[unused self: Self, T:! Core.Copy](x: T) -> T { + fn Cfn[T:! Core.Copy](unused self, x: T) -> T { return x; } } diff --git a/toolchain/lower/testdata/function/generic/import_unused_def.carbon b/toolchain/lower/testdata/function/generic/import_unused_def.carbon index e0ad104546c0..feee4b4ce4c2 100644 --- a/toolchain/lower/testdata/function/generic/import_unused_def.carbon +++ b/toolchain/lower/testdata/function/generic/import_unused_def.carbon @@ -22,7 +22,7 @@ class Foo { // This test verifies how the emitted definition is marked. Right now it is: // `_COp.a9f4dd835fff2161:core.Destroy.Core` impl Foo as Core.Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return (self as i32).(Core.Copy.Op)() as Foo; } } diff --git a/toolchain/lower/testdata/function/generic/type_representation.carbon b/toolchain/lower/testdata/function/generic/type_representation.carbon index 16cd28f48f20..48d0d3c93dc4 100644 --- a/toolchain/lower/testdata/function/generic/type_representation.carbon +++ b/toolchain/lower/testdata/function/generic/type_representation.carbon @@ -11,7 +11,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/function/generic/type_representation.carbon interface Copy { - fn Op[self: Self]() -> Self; + fn Op(self) -> Self; } fn F[T:! Copy & Core.Destroy](a: T) -> T { @@ -20,7 +20,7 @@ fn F[T:! Copy & Core.Destroy](a: T) -> T { } impl i32 as Copy { - fn Op[self: i32]() -> i32 { + fn Op(self: i32) -> i32 { return self; } } @@ -34,7 +34,7 @@ class X { var b: i32; impl as Copy { - fn Op[self: X]() -> X { + fn Op(self: X) -> X { return {.a = self.a, .b = self.b}; } } @@ -45,7 +45,7 @@ fn F_X(a: X) -> X { } impl () as Copy { - fn Op[unused self: ()]() -> () { + fn Op(unused self: ()) -> () { return (); } } @@ -55,7 +55,7 @@ fn F_empty_tuple(a: ()) -> () { } impl (i32, i32) as Copy { - fn Op[self: (i32, i32)]() -> (i32, i32) { + fn Op(self: (i32, i32)) -> (i32, i32) { return self; } } @@ -65,7 +65,7 @@ fn F_two_tuple(a: (i32, i32)) -> (i32, i32) { } impl ((i32, i32), X) as Copy { - fn Op[self: ((i32, i32), X)]() -> ((i32, i32), X) { + fn Op(self: ((i32, i32), X)) -> ((i32, i32), X) { return (self.0.(Copy.Op)(), self.1.(Copy.Op)()); } } diff --git a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon index c5094e217ee1..33c359b3aca6 100644 --- a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon +++ b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon @@ -11,7 +11,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/impl/assoc_fn_alias.carbon interface I { - fn F[self: Self]() -> i32; + fn F(self) -> i32; } class A { @@ -20,7 +20,7 @@ class A { } impl A as I { - fn F[self: A]() -> i32 { + fn F(self: A) -> i32 { return self.n; } } diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index cc34719222b8..24ed00dd9ce4 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; interface I { - fn F[self: Self]() -> i32; + fn F(self) -> i32; } class A { @@ -23,7 +23,7 @@ class A { } impl A as I { - fn F[self: A]() -> i32 { + fn F(self: A) -> i32 { return self.n; } } @@ -41,15 +41,15 @@ class B {} class C {} interface I(T:! type) { - fn F[self: Self]() -> T; + fn F(self) -> T; } impl C as I(A) { - fn F[unused self: C]() -> A { return {}; } + fn F(unused self: C) -> A { return {}; } } impl C as I(B) { - fn F[unused self: C]() -> B { return {}; } + fn F(unused self: C) -> B { return {}; } } fn F1(x: C, y: C) { @@ -127,20 +127,20 @@ impl C(B) as I { // CHECK:STDOUT: ; ModuleID = 'generic_impls.carbon' // CHECK:STDOUT: source_filename = "generic_impls.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @A.val.loc13_42 = internal constant {} zeroinitializer -// CHECK:STDOUT: @B.val.loc17_42 = internal constant {} zeroinitializer +// CHECK:STDOUT: @A.val.loc13_40 = internal constant {} zeroinitializer +// CHECK:STDOUT: @B.val.loc17_40 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CF.C.Main:I.bd4fb75a414fe858.Main"(ptr sret({}) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc13_42, i64 0, i1 false), !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc13_40, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CF.C.Main:I.a6a60dfee2d7d273.Main"(ptr sret({}) %return, ptr %self) #0 !dbg !11 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc17_42, i64 0, i1 false), !dbg !14 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc17_40, i64 0, i1 false), !dbg !14 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -196,11 +196,11 @@ impl C(B) as I { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 33, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 13, column: 31, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main:I.a6a60dfee2d7d273.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !12) // CHECK:STDOUT: !12 = !{!13} // CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !11, type: !7) -// CHECK:STDOUT: !14 = !DILocation(line: 17, column: 33, scope: !11) +// CHECK:STDOUT: !14 = !DILocation(line: 17, column: 31, scope: !11) // CHECK:STDOUT: !15 = distinct !DISubprogram(name: "F1", linkageName: "_CF1.Main", scope: null, file: !3, line: 20, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) // CHECK:STDOUT: !16 = !DISubroutineType(types: !17) // CHECK:STDOUT: !17 = !{null, !7, !7} diff --git a/toolchain/lower/testdata/impl/import.carbon b/toolchain/lower/testdata/impl/import.carbon index b6ac97a763d6..29a4266e7d3f 100644 --- a/toolchain/lower/testdata/impl/import.carbon +++ b/toolchain/lower/testdata/impl/import.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; interface I { - fn F[self: Self]() -> i32; + fn F(self) -> i32; } class A { @@ -23,7 +23,7 @@ class A { } impl A as I { - fn F[self: A]() -> i32 { + fn F(self: A) -> i32 { return self.n; } } diff --git a/toolchain/lower/testdata/impl/import_facet.carbon b/toolchain/lower/testdata/impl/import_facet.carbon index 14acdd10bcf6..7ccb710b57f3 100644 --- a/toolchain/lower/testdata/impl/import_facet.carbon +++ b/toolchain/lower/testdata/impl/import_facet.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; class C(T:! Core.Copy & Core.UnformedInit & Core.Destroy) { - fn GetC[unused self: Self]() -> T { + fn GetC(unused self) -> T { var value: T; return value; } @@ -29,7 +29,7 @@ export import library "a"; interface I { let T:! Core.Copy & Core.UnformedInit & Core.Destroy; - fn GetI[self: Self]() -> C(T); + fn GetI(self) -> C(T); } // --- c.carbon @@ -38,7 +38,7 @@ export import library "b"; class D(U:! type) { impl as I where .T = U* { - fn GetI[unused self: Self]() -> C(U*) { + fn GetI(unused self) -> C(U*) { return {}; } } diff --git a/toolchain/lower/testdata/impl/import_thunk.carbon b/toolchain/lower/testdata/impl/import_thunk.carbon index df76ddff46b4..c6f74a6e16c2 100644 --- a/toolchain/lower/testdata/impl/import_thunk.carbon +++ b/toolchain/lower/testdata/impl/import_thunk.carbon @@ -19,10 +19,10 @@ class B { var b: i32; } class C { var c: i32; } impl A as Core.ImplicitAs(B) { - fn Convert[self: A]() -> B { return {.b = self.a}; } + fn Convert(self: A) -> B { return {.b = self.a}; } } impl B as Core.ImplicitAs(C) { - fn Convert[self: B]() -> C { return {.c = self.b}; } + fn Convert(self: B) -> C { return {.c = self.b}; } } interface I { @@ -72,20 +72,20 @@ fn Test(a: A) -> C { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr sret({ i32 }) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_49.1.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: %.loc9_49.2 = load i32, ptr %.loc9_49.1.a, align 4, !dbg !10 -// CHECK:STDOUT: %.loc9_51.2.b = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: store i32 %.loc9_49.2, ptr %.loc9_51.2.b, align 4, !dbg !11 +// CHECK:STDOUT: %.loc9_47.1.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: %.loc9_47.2 = load i32, ptr %.loc9_47.1.a, align 4, !dbg !10 +// CHECK:STDOUT: %.loc9_49.2.b = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: store i32 %.loc9_47.2, ptr %.loc9_49.2.b, align 4, !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr sret({ i32 }) %return, ptr %self) #0 !dbg !13 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_49.1.b = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !16 -// CHECK:STDOUT: %.loc12_49.2 = load i32, ptr %.loc12_49.1.b, align 4, !dbg !16 -// CHECK:STDOUT: %.loc12_51.2.c = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: store i32 %.loc12_49.2, ptr %.loc12_51.2.c, align 4, !dbg !17 +// CHECK:STDOUT: %.loc12_47.1.b = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !16 +// CHECK:STDOUT: %.loc12_47.2 = load i32, ptr %.loc12_47.1.b, align 4, !dbg !16 +// CHECK:STDOUT: %.loc12_49.2.c = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !17 +// CHECK:STDOUT: store i32 %.loc12_47.2, ptr %.loc12_49.2.c, align 4, !dbg !17 // CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -156,15 +156,15 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 9, column: 45, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 9, column: 39, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 32, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 9, column: 43, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 9, column: 37, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 30, scope: !4) // CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) // CHECK:STDOUT: !14 = !{!15} // CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !13, type: !7) -// CHECK:STDOUT: !16 = !DILocation(line: 12, column: 45, scope: !13) -// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 39, scope: !13) -// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 32, scope: !13) +// CHECK:STDOUT: !16 = !DILocation(line: 12, column: 43, scope: !13) +// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 37, scope: !13) +// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 30, scope: !13) // CHECK:STDOUT: !19 = distinct !DISubprogram(name: "F", linkageName: "_CF.61ea2aba74ab3bf1:I.Main", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) // CHECK:STDOUT: !20 = !{!21} // CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !7) diff --git a/toolchain/lower/testdata/impl/instance_method.carbon b/toolchain/lower/testdata/impl/instance_method.carbon index 076f8c474edd..a1d16977a67c 100644 --- a/toolchain/lower/testdata/impl/instance_method.carbon +++ b/toolchain/lower/testdata/impl/instance_method.carbon @@ -13,12 +13,12 @@ class A; interface GetSelf { - fn Get[ref self: Self]() -> Self*; + fn Get(ref self) -> Self*; } class A { extend impl as GetSelf { - fn Get[ref self: Self]() -> Self* { + fn Get(ref self) -> Self* { return &self; } } diff --git a/toolchain/lower/testdata/impl/period_self.carbon b/toolchain/lower/testdata/impl/period_self.carbon index 0ab5016ef989..4d0bbc9ce10c 100644 --- a/toolchain/lower/testdata/impl/period_self.carbon +++ b/toolchain/lower/testdata/impl/period_self.carbon @@ -22,7 +22,7 @@ class B {} impl forall [T:! type] A(T) as J {} impl forall [T:! type where A(.Self) impls J] A(T) as Core.As(T*) { - fn Convert[self: A(T)]() -> T* { + fn Convert(self) -> T* { return self as T*; } } diff --git a/toolchain/lower/testdata/impl/thunk.carbon b/toolchain/lower/testdata/impl/thunk.carbon index 7910509c6865..70459e607f0e 100644 --- a/toolchain/lower/testdata/impl/thunk.carbon +++ b/toolchain/lower/testdata/impl/thunk.carbon @@ -19,10 +19,10 @@ class B { var b: i32; } class C { var c: i32; } impl A as Core.ImplicitAs(B) { - fn Convert[self: A]() -> B { return {.b = self.a}; } + fn Convert(self: A) -> B { return {.b = self.a}; } } impl B as Core.ImplicitAs(C) { - fn Convert[self: B]() -> C { return {.c = self.b}; } + fn Convert(self: B) -> C { return {.c = self.b}; } } interface I { @@ -44,18 +44,18 @@ library "[[@TEST_NAME]]"; class A {} class B { impl as Core.ImplicitAs(A) { - fn Convert[unused self: Self]() -> A { return {}; } + fn Convert(unused self) -> A { return {}; } } } interface I(T:! type) { - fn F[self: Self](x: B) -> A; + fn F(self, x: B) -> A; } class C(U:! type) {} impl forall [V:! type] C(V) as I(V) { - fn F[unused self: Self](_: A) -> B { return {}; } + fn F(unused self, _: A) -> B { return {}; } } fn Call(c: C(()), b: B) -> A { @@ -76,20 +76,20 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr sret({ i32 }) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_49.1.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !10 -// CHECK:STDOUT: %.loc9_49.2 = load i32, ptr %.loc9_49.1.a, align 4, !dbg !10 -// CHECK:STDOUT: %.loc9_51.2.b = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !11 -// CHECK:STDOUT: store i32 %.loc9_49.2, ptr %.loc9_51.2.b, align 4, !dbg !11 +// CHECK:STDOUT: %.loc9_47.1.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !10 +// CHECK:STDOUT: %.loc9_47.2 = load i32, ptr %.loc9_47.1.a, align 4, !dbg !10 +// CHECK:STDOUT: %.loc9_49.2.b = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !11 +// CHECK:STDOUT: store i32 %.loc9_47.2, ptr %.loc9_49.2.b, align 4, !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr sret({ i32 }) %return, ptr %self) #0 !dbg !13 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_49.1.b = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !16 -// CHECK:STDOUT: %.loc12_49.2 = load i32, ptr %.loc12_49.1.b, align 4, !dbg !16 -// CHECK:STDOUT: %.loc12_51.2.c = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: store i32 %.loc12_49.2, ptr %.loc12_51.2.c, align 4, !dbg !17 +// CHECK:STDOUT: %.loc12_47.1.b = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !16 +// CHECK:STDOUT: %.loc12_47.2 = load i32, ptr %.loc12_47.1.b, align 4, !dbg !16 +// CHECK:STDOUT: %.loc12_49.2.c = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !17 +// CHECK:STDOUT: store i32 %.loc12_47.2, ptr %.loc12_49.2.c, align 4, !dbg !17 // CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -177,15 +177,15 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 9, column: 45, scope: !4) -// CHECK:STDOUT: !11 = !DILocation(line: 9, column: 39, scope: !4) -// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 32, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 9, column: 43, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 9, column: 37, scope: !4) +// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 30, scope: !4) // CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) // CHECK:STDOUT: !14 = !{!15} // CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !13, type: !7) -// CHECK:STDOUT: !16 = !DILocation(line: 12, column: 45, scope: !13) -// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 39, scope: !13) -// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 32, scope: !13) +// CHECK:STDOUT: !16 = !DILocation(line: 12, column: 43, scope: !13) +// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 37, scope: !13) +// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 30, scope: !13) // CHECK:STDOUT: !19 = distinct !DISubprogram(name: "F", linkageName: "_CF.61ea2aba74ab3bf1:I.Main", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) // CHECK:STDOUT: !20 = !{!21} // CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !7) @@ -223,13 +223,13 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: ; ModuleID = 'generic_thunk.carbon' // CHECK:STDOUT: source_filename = "generic_thunk.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @A.val.loc7_53 = internal constant {} zeroinitializer -// CHECK:STDOUT: @B.val.loc18_49 = internal constant {} zeroinitializer +// CHECK:STDOUT: @A.val.loc7_45 = internal constant {} zeroinitializer +// CHECK:STDOUT: @B.val.loc18_43 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc7_53, i64 0, i1 false), !dbg !10 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc7_45, i64 0, i1 false), !dbg !10 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -278,7 +278,7 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define linkonce_odr void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %_) #0 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc18_49, i64 0, i1 false), !dbg !40 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc18_43, i64 0, i1 false), !dbg !40 // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -292,15 +292,15 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define linkonce_odr void @"_CF:thunk:I.eb750e4e5cfbbe32.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %x) #2 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_38.2.temp = alloca {}, align 1, !dbg !51 -// CHECK:STDOUT: %.loc12_21.1.temp = alloca {}, align 1, !dbg !52 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_38.2.temp), !dbg !51 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_21.1.temp), !dbg !52 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.loc12_21.1.temp, ptr %x), !dbg !52 -// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_38.2.temp, ptr %self, ptr %.loc12_21.1.temp), !dbg !51 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %return, ptr %.loc18_38.2.temp), !dbg !51 -// CHECK:STDOUT: call void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %.loc18_38.2.temp), !dbg !51 -// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %.loc12_21.1.temp), !dbg !52 +// CHECK:STDOUT: %.loc18_32.2.temp = alloca {}, align 1, !dbg !51 +// CHECK:STDOUT: %.loc12_15.1.temp = alloca {}, align 1, !dbg !52 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_32.2.temp), !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_15.1.temp), !dbg !52 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.loc12_15.1.temp, ptr %x), !dbg !52 +// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_32.2.temp, ptr %self, ptr %.loc12_15.1.temp), !dbg !51 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %return, ptr %.loc18_32.2.temp), !dbg !51 +// CHECK:STDOUT: call void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %.loc18_32.2.temp), !dbg !51 +// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %.loc12_15.1.temp), !dbg !52 // CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -324,7 +324,7 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !8 = !{!9} // CHECK:STDOUT: !9 = !DILocalVariable(arg: 1, scope: !4, type: !7) -// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 44, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 36, scope: !4) // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6c3865e9cbd9f6de:core.Destroy.Core", scope: null, file: !3, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !14) // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) // CHECK:STDOUT: !13 = !{null, !7} @@ -334,7 +334,7 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !3, line: 12, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !18) // CHECK:STDOUT: !18 = !{!19} // CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !17, type: !7) -// CHECK:STDOUT: !20 = !DILocation(line: 12, column: 20, scope: !17) +// CHECK:STDOUT: !20 = !DILocation(line: 12, column: 14, scope: !17) // CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 21, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24) // CHECK:STDOUT: !22 = !DISubroutineType(types: !23) // CHECK:STDOUT: !23 = !{!7, !7, !7} @@ -354,7 +354,7 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !37 = !{!38, !39} // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !7) // CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !36, type: !7) -// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 40, scope: !36) +// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 34, scope: !36) // CHECK:STDOUT: !41 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main.311465f47f92d67a", scope: null, file: !3, line: 25, type: !22, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) // CHECK:STDOUT: !42 = !{!43, !44} // CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !7) @@ -366,4 +366,4 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !7) // CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !47, type: !7) // CHECK:STDOUT: !51 = !DILocation(line: 18, column: 3, scope: !47) -// CHECK:STDOUT: !52 = !DILocation(line: 12, column: 20, scope: !47) +// CHECK:STDOUT: !52 = !DILocation(line: 12, column: 14, scope: !47) diff --git a/toolchain/lower/testdata/interface/where.carbon b/toolchain/lower/testdata/interface/where.carbon index 304a9f59b3fd..7d1c940533bb 100644 --- a/toolchain/lower/testdata/interface/where.carbon +++ b/toolchain/lower/testdata/interface/where.carbon @@ -34,7 +34,7 @@ class C {} class D {} class E {} -interface I(T:! type) { fn F[self: Self](); } +interface I(T:! type) { fn F(self); } interface J(T:! type) {} impl D as J(E) {} @@ -42,7 +42,7 @@ impl D as J(E) {} // The type of `T` is not `.Self`-dependent, because `.Self` appears after // `where`. impl forall [T:! type where D impls J(.Self)] C as I(T) { - fn F[unused self: Self]() {} + fn F(unused self) {} } fn F(a: C) { diff --git a/toolchain/lower/testdata/interop/cpp/class/export/method.carbon b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon index 5fc0bdca67ef..ea2e68b85a66 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; import Cpp; class A { - fn F[self: Self]() { self; } + fn F(self) { self; } } inline Cpp ''' @@ -32,7 +32,7 @@ library "[[@TEST_NAME]]"; import Cpp; class A { - fn F[self: Self](a: i32) -> i32 { + fn F(self, a: i32) -> i32 { self; return a; } @@ -251,8 +251,8 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_35.2 = load i32, ptr %_, align 4, !dbg !40 -// CHECK:STDOUT: %A.F.call = call i32 @_CF.A.Main(ptr %self, i32 %.loc6_35.2), !dbg !40 +// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !40 +// CHECK:STDOUT: %A.F.call = call i32 @_CF.A.Main(ptr %self, i32 %.loc6_29.2), !dbg !40 // CHECK:STDOUT: store i32 %A.F.call, ptr %_1, align 4, !dbg !40 // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon b/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon index 8fc39ce14375..d1ba6a0f8219 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon @@ -34,9 +34,9 @@ __attribute__((optnone)) auto Use(Base& b) { base class Derived { extend base: Cpp.Base; - virtual fn other_func[unused self: Self]() { + virtual fn other_func(unused self) { } - override fn func[unused ref self: Self]() { + override fn func(unused ref self) { } } diff --git a/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon b/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon index 278abeed612d..1012ae86e484 100644 --- a/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon @@ -25,12 +25,12 @@ struct A { class Final { extend base: Cpp.A; - override fn F[self: Self](); + override fn F(self); } base class Base { extend base: Cpp.A; - override fn F[self: Self](); + override fn F(self); } inline Cpp ''' diff --git a/toolchain/lower/testdata/operators/increment.carbon b/toolchain/lower/testdata/operators/increment.carbon index 7caeb31141e1..d283ad2d5ab2 100644 --- a/toolchain/lower/testdata/operators/increment.carbon +++ b/toolchain/lower/testdata/operators/increment.carbon @@ -116,4 +116,4 @@ fn IncrSigned() { // CHECK:STDOUT: !38 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !18, line: 58, type: !32, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !39) // CHECK:STDOUT: !39 = !{!40} // CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !13) -// CHECK:STDOUT: !41 = !DILocation(line: 58, column: 36, scope: !38) +// CHECK:STDOUT: !41 = !DILocation(line: 58, column: 28, scope: !38) diff --git a/toolchain/lower/testdata/operators/overloaded.carbon b/toolchain/lower/testdata/operators/overloaded.carbon index 121f325cda4f..6c65f4ce1bd6 100644 --- a/toolchain/lower/testdata/operators/overloaded.carbon +++ b/toolchain/lower/testdata/operators/overloaded.carbon @@ -15,12 +15,12 @@ class Number { } impl Number as Core.Negate where .Result = Number { - fn Op[self: Number]() -> Number { + fn Op(self: Number) -> Number { return {.is_positive = not self.is_positive}; } } impl Number as Core.MulWith(Number) where .Result = Number { - fn Op[self: Number](other: Number) -> Number { + fn Op(self: Number, other: Number) -> Number { return {.is_positive = (self.is_positive and other.is_positive) or (not self.is_positive and not other.is_positive)}; } diff --git a/toolchain/lower/testdata/packages/imported_type_completeness.carbon b/toolchain/lower/testdata/packages/imported_type_completeness.carbon index 86fd167b0ae0..d388be07b3ed 100644 --- a/toolchain/lower/testdata/packages/imported_type_completeness.carbon +++ b/toolchain/lower/testdata/packages/imported_type_completeness.carbon @@ -53,8 +53,8 @@ library "[[@TEST_NAME]]"; base class C(T:! type) { // Require Core.Int(11) and Core.Int(12) to be complete. - virtual fn F[unused self: Self]() -> Core.Int(11) { return 11; } - virtual fn G[unused self: Self](unused t: T) -> Core.Int(12) { return 12; } + virtual fn F(unused self) -> Core.Int(11) { return 11; } + virtual fn G(unused self, unused t: T) -> Core.Int(12) { return 12; } } // --- use_without_completion_in_vtable.carbon @@ -378,7 +378,7 @@ fn CallF() { // CHECK:STDOUT: !38 = !DIBasicType(name: "int", size: 11, encoding: DW_ATE_signed) // CHECK:STDOUT: !39 = !{!40} // CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !34, type: !13) -// CHECK:STDOUT: !41 = !DILocation(line: 6, column: 55, scope: !34) +// CHECK:STDOUT: !41 = !DILocation(line: 6, column: 47, scope: !34) // CHECK:STDOUT: !42 = distinct !DISubprogram(name: "G", linkageName: "_CG.C.Main.9522ff908e97e267", scope: null, file: !35, line: 7, type: !43, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !46) // CHECK:STDOUT: !43 = !DISubroutineType(types: !44) // CHECK:STDOUT: !44 = !{!45, !13, !13} @@ -386,4 +386,4 @@ fn CallF() { // CHECK:STDOUT: !46 = !{!47, !48} // CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !42, type: !13) // CHECK:STDOUT: !48 = !DILocalVariable(arg: 2, scope: !42, type: !13) -// CHECK:STDOUT: !49 = !DILocation(line: 7, column: 66, scope: !42) +// CHECK:STDOUT: !49 = !DILocation(line: 7, column: 60, scope: !42) diff --git a/toolchain/lower/testdata/packages/separate_compilation_witness.carbon b/toolchain/lower/testdata/packages/separate_compilation_witness.carbon index 15413272586a..60a5f59a96e0 100644 --- a/toolchain/lower/testdata/packages/separate_compilation_witness.carbon +++ b/toolchain/lower/testdata/packages/separate_compilation_witness.carbon @@ -22,13 +22,13 @@ class Vector { } impl Vector as Core.AddWith(Vector) where .Result = Vector { - fn Op[self: Vector](other: Vector) -> Vector { + fn Op(self, other: Vector) -> Vector { return {.x = self.x + other.x}; } } impl Vector as Core.MulWith(i32) where .Result = Vector { - fn Op[self: Vector](n: i32) -> Vector { + fn Op(self, n: i32) -> Vector { return {.x = self.x * n}; } } diff --git a/toolchain/lower/testdata/primitives/char.carbon b/toolchain/lower/testdata/primitives/char.carbon index dfba0db3c294..98e39b1ae4e6 100644 --- a/toolchain/lower/testdata/primitives/char.carbon +++ b/toolchain/lower/testdata/primitives/char.carbon @@ -12,7 +12,7 @@ class CharLike { impl as Core.ImplicitAs(char) { - fn Convert[unused self: Self]() -> char { return 'x'; } + fn Convert(unused self) -> char { return 'x'; } } } @@ -568,7 +568,7 @@ fn AddSubUInt32(c: char, i: u32) { // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !9 = !{!10} // CHECK:STDOUT: !10 = !DILocalVariable(arg: 1, scope: !4, type: !8) -// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 47, scope: !4) +// CHECK:STDOUT: !11 = !DILocation(line: 15, column: 39, scope: !4) // CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !3, line: 21, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !15) // CHECK:STDOUT: !13 = !DISubroutineType(types: !14) // CHECK:STDOUT: !14 = !{null, !7, !7} @@ -1010,4 +1010,4 @@ fn AddSubUInt32(c: char, i: u32) { // CHECK:STDOUT: !450 = !{!7, !7} // CHECK:STDOUT: !451 = !{!452} // CHECK:STDOUT: !452 = !DILocalVariable(arg: 1, scope: !448, type: !7) -// CHECK:STDOUT: !453 = !DILocation(line: 59, column: 37, scope: !448) +// CHECK:STDOUT: !453 = !DILocation(line: 59, column: 29, scope: !448) diff --git a/toolchain/lower/testdata/primitives/int_types.carbon b/toolchain/lower/testdata/primitives/int_types.carbon index ae77951087b8..d5eb4f487f7f 100644 --- a/toolchain/lower/testdata/primitives/int_types.carbon +++ b/toolchain/lower/testdata/primitives/int_types.carbon @@ -355,7 +355,7 @@ fn ImplicitWidenUnsignedCustom(a: Core.UInt(4)) -> Core.UInt(5) { return a; } // CHECK:STDOUT: !73 = !{!8, !8} // CHECK:STDOUT: !74 = !{!75} // CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !71, type: !8) -// CHECK:STDOUT: !76 = !DILocation(line: 58, column: 36, scope: !71) +// CHECK:STDOUT: !76 = !DILocation(line: 58, column: 28, scope: !71) // CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.UInt.9452f4c51951679b.Core:FromUInt.a1a82301830d1e08.Core.d93106ca8c7912cd", scope: null, file: !50, line: 71, type: !13, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !78) // CHECK:STDOUT: !78 = !{!79} // CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !77, type: !16) @@ -373,7 +373,7 @@ fn ImplicitWidenUnsignedCustom(a: Core.UInt(4)) -> Core.UInt(5) { return a; } // CHECK:STDOUT: !91 = !{!30, !30} // CHECK:STDOUT: !92 = !{!93} // CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !89, type: !30) -// CHECK:STDOUT: !94 = !DILocation(line: 58, column: 36, scope: !89) +// CHECK:STDOUT: !94 = !DILocation(line: 58, column: 28, scope: !89) // CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.UInt.9452f4c51951679b.Core:FromUInt.a1a82301830d1e08.Core.cc82cccb0d5a8ccf", scope: null, file: !50, line: 71, type: !35, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !96) // CHECK:STDOUT: !96 = !{!97} // CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !95, type: !38) @@ -385,10 +385,10 @@ fn ImplicitWidenUnsignedCustom(a: Core.UInt(4)) -> Core.UInt(5) { return a; } // CHECK:STDOUT: !103 = !{!16, !16} // CHECK:STDOUT: !104 = !{!105} // CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !101, type: !16) -// CHECK:STDOUT: !106 = !DILocation(line: 59, column: 37, scope: !101) +// CHECK:STDOUT: !106 = !DILocation(line: 59, column: 29, scope: !101) // CHECK:STDOUT: !107 = distinct !DISubprogram(name: "AsUInt", linkageName: "_CAsUInt.UInt.9452f4c51951679b.Core:AnyUInt.Core.044c7d430ddd4fd6", scope: null, file: !50, line: 59, type: !108, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !110) // CHECK:STDOUT: !108 = !DISubroutineType(types: !109) // CHECK:STDOUT: !109 = !{!38, !38} // CHECK:STDOUT: !110 = !{!111} // CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !107, type: !38) -// CHECK:STDOUT: !112 = !DILocation(line: 59, column: 37, scope: !107) +// CHECK:STDOUT: !112 = !DILocation(line: 59, column: 29, scope: !107) diff --git a/toolchain/lower/testdata/primitives/optional.carbon b/toolchain/lower/testdata/primitives/optional.carbon index 0856252c9103..f9c61ec30576 100644 --- a/toolchain/lower/testdata/primitives/optional.carbon +++ b/toolchain/lower/testdata/primitives/optional.carbon @@ -39,7 +39,7 @@ library "[[@TEST_NAME]]"; class Copyable { impl as Core.Copy { - fn Op[self: Self]() -> Self; + fn Op(self) -> Self; } } @@ -492,8 +492,8 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: !117 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") // CHECK:STDOUT: !118 = !{!119} // CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !116, type: !7) -// CHECK:STDOUT: !120 = !DILocation(line: 42, column: 45, scope: !116) -// CHECK:STDOUT: !121 = !DILocation(line: 42, column: 38, scope: !116) +// CHECK:STDOUT: !120 = !DILocation(line: 42, column: 40, scope: !116) +// CHECK:STDOUT: !121 = !DILocation(line: 42, column: 33, scope: !116) // CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6f97602f44c068f9", scope: null, file: !94, line: 105, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !123) // CHECK:STDOUT: !123 = !{!124} // CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !122, type: !7) @@ -502,28 +502,28 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.7e715d26c6bb9daa", scope: null, file: !117, line: 42, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !128) // CHECK:STDOUT: !128 = !{!129} // CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !127, type: !7) -// CHECK:STDOUT: !130 = !DILocation(line: 42, column: 45, scope: !127) -// CHECK:STDOUT: !131 = !DILocation(line: 42, column: 38, scope: !127) +// CHECK:STDOUT: !130 = !DILocation(line: 42, column: 40, scope: !127) +// CHECK:STDOUT: !131 = !DILocation(line: 42, column: 33, scope: !127) // CHECK:STDOUT: !132 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.36d191ed69f42abb", scope: null, file: !117, line: 46, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !133) // CHECK:STDOUT: !133 = !{!134} // CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !132, type: !7) -// CHECK:STDOUT: !135 = !DILocation(line: 46, column: 45, scope: !132) -// CHECK:STDOUT: !136 = !DILocation(line: 46, column: 38, scope: !132) +// CHECK:STDOUT: !135 = !DILocation(line: 46, column: 34, scope: !132) +// CHECK:STDOUT: !136 = !DILocation(line: 46, column: 27, scope: !132) // CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.bd2b2818aef220bf", scope: null, file: !117, line: 46, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !138) // CHECK:STDOUT: !138 = !{!139} // CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !137, type: !7) -// CHECK:STDOUT: !140 = !DILocation(line: 46, column: 45, scope: !137) -// CHECK:STDOUT: !141 = !DILocation(line: 46, column: 38, scope: !137) +// CHECK:STDOUT: !140 = !DILocation(line: 46, column: 34, scope: !137) +// CHECK:STDOUT: !141 = !DILocation(line: 46, column: 27, scope: !137) // CHECK:STDOUT: !142 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7e715d26c6bb9daa", scope: null, file: !117, line: 46, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !143) // CHECK:STDOUT: !143 = !{!144} // CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !142, type: !7) -// CHECK:STDOUT: !145 = !DILocation(line: 46, column: 45, scope: !142) -// CHECK:STDOUT: !146 = !DILocation(line: 46, column: 38, scope: !142) +// CHECK:STDOUT: !145 = !DILocation(line: 46, column: 34, scope: !142) +// CHECK:STDOUT: !146 = !DILocation(line: 46, column: 27, scope: !142) // CHECK:STDOUT: !147 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.7f331ac9d2b85055", scope: null, file: !117, line: 46, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !148) // CHECK:STDOUT: !148 = !{!149} // CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !147, type: !7) -// CHECK:STDOUT: !150 = !DILocation(line: 46, column: 45, scope: !147) -// CHECK:STDOUT: !151 = !DILocation(line: 46, column: 38, scope: !147) +// CHECK:STDOUT: !150 = !DILocation(line: 46, column: 34, scope: !147) +// CHECK:STDOUT: !151 = !DILocation(line: 46, column: 27, scope: !147) // CHECK:STDOUT: !152 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !94, line: 172, type: !12, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !153) // CHECK:STDOUT: !153 = !{!154} // CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !152, type: !14) @@ -556,8 +556,8 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: !181 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.a1e92423fb5cda0f", scope: null, file: !117, line: 42, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !182) // CHECK:STDOUT: !182 = !{!183} // CHECK:STDOUT: !183 = !DILocalVariable(arg: 1, scope: !181, type: !7) -// CHECK:STDOUT: !184 = !DILocation(line: 42, column: 45, scope: !181) -// CHECK:STDOUT: !185 = !DILocation(line: 42, column: 38, scope: !181) +// CHECK:STDOUT: !184 = !DILocation(line: 42, column: 40, scope: !181) +// CHECK:STDOUT: !185 = !DILocation(line: 42, column: 33, scope: !181) // CHECK:STDOUT: !186 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.442ff502447e2586", scope: null, file: !94, line: 33, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !187) // CHECK:STDOUT: !187 = !{!188} // CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !186, type: !7) @@ -587,12 +587,12 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: !212 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !198, line: 58, type: !199, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !213) // CHECK:STDOUT: !213 = !{!214} // CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !212, type: !7) -// CHECK:STDOUT: !215 = !DILocation(line: 58, column: 36, scope: !212) +// CHECK:STDOUT: !215 = !DILocation(line: 58, column: 28, scope: !212) // CHECK:STDOUT: !216 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7c16f707f533a23:Copy.Core.5bd8d5767580997a", scope: null, file: !217, line: 23, type: !105, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !218) // CHECK:STDOUT: !217 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") // CHECK:STDOUT: !218 = !{!219} // CHECK:STDOUT: !219 = !DILocalVariable(arg: 1, scope: !216, type: !7) -// CHECK:STDOUT: !220 = !DILocation(line: 23, column: 33, scope: !216) +// CHECK:STDOUT: !220 = !DILocation(line: 23, column: 25, scope: !216) // CHECK:STDOUT: ; ModuleID = 'copy.carbon' // CHECK:STDOUT: source_filename = "copy.carbon" // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/param.carbon b/toolchain/lower/testdata/var/param.carbon index 6a6f97f14b54..baaca0319976 100644 --- a/toolchain/lower/testdata/var/param.carbon +++ b/toolchain/lower/testdata/var/param.carbon @@ -17,7 +17,7 @@ library "[[@TEST_NAME]]"; class C { // TODO: Change to Core.Destructor when possible. impl as Core.Destroy { - fn Op[ref self: Self](); + fn Op(ref self); } fn Make() -> Self; @@ -36,7 +36,7 @@ library "[[@TEST_NAME]]"; class C { // TODO: Change to Core.Destructor when possible. impl as Core.Destroy { - fn Op[ref self: Self](); + fn Op(ref self); } } diff --git a/toolchain/parse/handle_binding_pattern.cpp b/toolchain/parse/handle_binding_pattern.cpp index a0800716a794..0e6aab2e0570 100644 --- a/toolchain/parse/handle_binding_pattern.cpp +++ b/toolchain/parse/handle_binding_pattern.cpp @@ -35,13 +35,15 @@ auto HandleBindingPattern(Context& context) -> void { } // The first item should be an identifier, the placeholder `_`, or `self`. + std::optional self_token; if (auto identifier = context.ConsumeIf(Lex::TokenKind::Identifier)) { context.AddLeafNode(NodeKind::IdentifierNameNotBeforeSignature, *identifier); } else if (auto self = context.ConsumeIf(Lex::TokenKind::SelfValueIdentifier)) { - // Checking will validate the `self` is only declared in the implicit - // parameter list of a function. + // Checking will validate where `self` may be declared. Its type may be + // omitted, in which case it defaults to `Self` (see below). + self_token = *self; context.AddLeafNode(NodeKind::SelfValueName, *self); } else if (auto underscore = context.ConsumeIf(Lex::TokenKind::Underscore)) { context.AddLeafNode(NodeKind::UnderscoreName, *underscore); @@ -116,6 +118,17 @@ auto HandleBindingPattern(Context& context) -> void { context.PushState(state); context.PushStateForExpr(PrecedenceGroup::ForType()); + } else if (self_token && !template_token) { + // A `self` binding may omit its type; checking supplies the implicit `Self` + // type. There is no type node, so this produces a `SelfBindingPattern` + // rather than a `LetBindingPattern`. + if (ref_token) { + context.AddNode(NodeKind::RefBindingName, *ref_token, state.has_error); + } + context.AddNode(NodeKind::SelfBindingPattern, *self_token, state.has_error); + if (state.has_error) { + context.ReturnErrorOnState(); + } } else { on_error(/*expected_name=*/false); // Add a substitute for a type node. diff --git a/toolchain/parse/handle_pattern.cpp b/toolchain/parse/handle_pattern.cpp index d3f54cdd27be..de51c8111b6c 100644 --- a/toolchain/parse/handle_pattern.cpp +++ b/toolchain/parse/handle_pattern.cpp @@ -27,6 +27,9 @@ auto HandlePattern(Context& context) -> void { break; case Lex::TokenKind::Template: case Lex::TokenKind::Ref: + // `self` is always a binding, even when its type is omitted (and so is not + // followed by a `:`). + case Lex::TokenKind::SelfValueIdentifier: context.PushStateForPattern(StateKind::BindingPattern, state.in_var_pattern, state.in_unused_pattern, state.ambient_precedence); diff --git a/toolchain/parse/node_kind.def b/toolchain/parse/node_kind.def index 30ff46c06411..812cb19c039e 100644 --- a/toolchain/parse/node_kind.def +++ b/toolchain/parse/node_kind.def @@ -181,6 +181,7 @@ CARBON_PARSE_NODE_KIND(ArrayExpr) CARBON_PARSE_NODE_KIND(RefBindingName) CARBON_PARSE_NODE_KIND(UnusedPattern) CARBON_PARSE_NODE_KIND(LetBindingPattern) +CARBON_PARSE_NODE_KIND(SelfBindingPattern) CARBON_PARSE_NODE_KIND(AssociatedConstantNameAndType) CARBON_PARSE_NODE_KIND(VarBindingPattern) CARBON_PARSE_NODE_KIND(FormBindingPattern) diff --git a/toolchain/parse/testdata/class/fn_definitions.carbon b/toolchain/parse/testdata/class/fn_definitions.carbon index d48b3906c0e6..47331e95fe19 100644 --- a/toolchain/parse/testdata/class/fn_definitions.carbon +++ b/toolchain/parse/testdata/class/fn_definitions.carbon @@ -11,9 +11,9 @@ class Foo { fn Make() -> Self { return {.x = 0}; } - fn Baz[self: Self]() -> i32 { return self.x; } + fn Baz(self) -> i32 { return self.x; } - fn Modify[ref self: Self]() { self->x = 1; } + fn Modify(ref self) { self->x = 1; } } // CHECK:STDOUT: - filename: fn_definitions.carbon @@ -40,40 +40,34 @@ class Foo { // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 16}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Baz'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 4}, // CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 12}, +// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 9}, // CHECK:STDOUT: {kind: 'ReturnStatementStart', text: 'return'}, // CHECK:STDOUT: {kind: 'SelfValueNameExpr', text: 'self'}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'x'}, // CHECK:STDOUT: {kind: 'MemberAccessExpr', text: '.', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ReturnStatement', text: ';', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 18}, +// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 15}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Modify'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, +// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, // CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, // CHECK:STDOUT: {kind: 'RefBindingName', text: 'ref', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 4}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 11}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 8}, // CHECK:STDOUT: {kind: 'SelfValueNameExpr', text: 'self'}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'x'}, // CHECK:STDOUT: {kind: 'PointerMemberAccessExpr', text: '->', subtree_size: 3}, // CHECK:STDOUT: {kind: 'IntLiteral', text: '1'}, // CHECK:STDOUT: {kind: 'InfixOperatorEqual', text: '=', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExprStatement', text: ';', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 18}, -// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 56}, +// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 50}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/impl/basic.carbon b/toolchain/parse/testdata/generics/impl/basic.carbon index 72f66ef307c1..6101f12ec3d0 100644 --- a/toolchain/parse/testdata/generics/impl/basic.carbon +++ b/toolchain/parse/testdata/generics/impl/basic.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/impl/basic.carbon impl i32 as Interface { - fn Add[self: Self](b: Self) -> Self; + fn Add(self, b: Self) -> Self; } // CHECK:STDOUT: - filename: basic.carbon @@ -22,19 +22,17 @@ impl i32 as Interface { // CHECK:STDOUT: {kind: 'ImplDefinitionStart', text: '{', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Add'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 8}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, -// CHECK:STDOUT: {kind: 'ImplDefinition', text: '}', subtree_size: 21}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 13}, +// CHECK:STDOUT: {kind: 'ImplDefinition', text: '}', subtree_size: 19}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/basic.carbon b/toolchain/parse/testdata/generics/interface/basic.carbon index 7988723ed1db..29f5d5e82c54 100644 --- a/toolchain/parse/testdata/generics/interface/basic.carbon +++ b/toolchain/parse/testdata/generics/interface/basic.carbon @@ -9,8 +9,8 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/basic.carbon interface Foo { - fn Add[self: Self](b: Self) -> Self; - fn Add[self: foo](b: Self) -> Self; + fn Add(self, b: Self) -> Self; + fn Add(self: foo, b: Self) -> Self; } // CHECK:STDOUT: - filename: basic.carbon @@ -21,34 +21,31 @@ interface Foo { // CHECK:STDOUT: {kind: 'InterfaceDefinitionStart', text: '{', subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Add'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 8}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 13}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Add'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, +// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, // CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'foo'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 9}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, -// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 34}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 14}, +// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 31}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/default_fn.carbon b/toolchain/parse/testdata/generics/interface/default_fn.carbon index 74857fd38f38..cc9aa6293275 100644 --- a/toolchain/parse/testdata/generics/interface/default_fn.carbon +++ b/toolchain/parse/testdata/generics/interface/default_fn.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/default_fn.carbon interface Foo { - fn Scale[self: Self](s: i32) -> Self; + fn Scale(self, s: i32) -> Self; // Default definition of `Invert` calls `Scale`. - default fn Invert[self: Self]() -> Self { + default fn Invert(self) -> Self { return self.Scale(-1); } } @@ -25,32 +25,27 @@ interface Foo { // CHECK:STDOUT: {kind: 'InterfaceDefinitionStart', text: '{', subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Scale'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 's'}, // CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 8}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 13}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'DefaultModifier', text: 'default'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Invert'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 4}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 13}, +// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 10}, // CHECK:STDOUT: {kind: 'ReturnStatementStart', text: 'return'}, // CHECK:STDOUT: {kind: 'SelfValueNameExpr', text: 'self'}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'Scale'}, @@ -60,7 +55,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'PrefixOperatorMinus', text: '-', subtree_size: 2}, // CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 7}, // CHECK:STDOUT: {kind: 'ReturnStatement', text: ';', subtree_size: 9}, -// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 23}, -// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 42}, +// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 20}, +// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 37}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/final_fn.carbon b/toolchain/parse/testdata/generics/interface/final_fn.carbon index 81f9f33c5eb1..0e491c16752c 100644 --- a/toolchain/parse/testdata/generics/interface/final_fn.carbon +++ b/toolchain/parse/testdata/generics/interface/final_fn.carbon @@ -9,8 +9,8 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/final_fn.carbon interface Order { - fn Less[self: Self](right: Self) -> bool; - final fn Greater[self: Self](right: Self) -> bool { + fn Less(self, right: Self) -> bool; + final fn Greater(self, right: Self) -> bool { return right.Less(self); } } @@ -23,35 +23,31 @@ interface Order { // CHECK:STDOUT: {kind: 'InterfaceDefinitionStart', text: '{', subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Less'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'right'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 8}, // CHECK:STDOUT: {kind: 'BoolTypeLiteral', text: 'bool'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 13}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'FinalModifier', text: 'final'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Greater'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'right'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 8}, // CHECK:STDOUT: {kind: 'BoolTypeLiteral', text: 'bool'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 16}, +// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 14}, // CHECK:STDOUT: {kind: 'ReturnStatementStart', text: 'return'}, // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'right'}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'Less'}, @@ -60,7 +56,7 @@ interface Order { // CHECK:STDOUT: {kind: 'SelfValueNameExpr', text: 'self'}, // CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 6}, // CHECK:STDOUT: {kind: 'ReturnStatement', text: ';', subtree_size: 8}, -// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 25}, -// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 44}, +// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 23}, +// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 40}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/final_member_definition.carbon b/toolchain/parse/testdata/generics/interface/final_member_definition.carbon index 9c62c26d8ece..5af3e41ee301 100644 --- a/toolchain/parse/testdata/generics/interface/final_member_definition.carbon +++ b/toolchain/parse/testdata/generics/interface/final_member_definition.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/final_member_definition.carbon interface Foo { - final fn Add[unused self: Self](b: Self) -> Self { + final fn Add(unused self, b: Self) -> Self { print("Allowed."); } } @@ -23,26 +23,24 @@ interface Foo { // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'FinalModifier', text: 'final'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Add'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'UnusedPattern', text: 'unused', subtree_size: 4}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 6}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'UnusedPattern', text: 'unused', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 9}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 17}, +// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 15}, // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'print'}, // CHECK:STDOUT: {kind: 'CallExprStart', text: '(', subtree_size: 2}, // CHECK:STDOUT: {kind: 'StringLiteral', text: '"Allowed."'}, // CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 4}, // CHECK:STDOUT: {kind: 'ExprStatement', text: ';', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 23}, -// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 27}, +// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 21}, +// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 25}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/self_ref.carbon b/toolchain/parse/testdata/generics/interface/self_ref.carbon index ec47f9f957b3..3e0b91c90e9e 100644 --- a/toolchain/parse/testdata/generics/interface/self_ref.carbon +++ b/toolchain/parse/testdata/generics/interface/self_ref.carbon @@ -9,8 +9,8 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/self_ref.carbon interface Foo { - fn Sub[ref self: Self](b: Self) -> Self; - fn Sub[ref self: foo](b: Self) -> Self; + fn Sub(ref self, b: Self) -> Self; + fn Sub(ref self: foo, b: Self) -> Self; } // CHECK:STDOUT: - filename: self_ref.carbon @@ -21,36 +21,33 @@ interface Foo { // CHECK:STDOUT: {kind: 'InterfaceDefinitionStart', text: '{', subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Sub'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, +// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, // CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, // CHECK:STDOUT: {kind: 'RefBindingName', text: 'ref', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 4}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 9}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 16}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 14}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'Sub'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, +// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, // CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, // CHECK:STDOUT: {kind: 'RefBindingName', text: 'ref', subtree_size: 2}, // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'foo'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 4}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 10}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 16}, -// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 36}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 33}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/named_constraint/invalid_method.carbon b/toolchain/parse/testdata/generics/named_constraint/invalid_method.carbon index 6f17a1d8bfde..1f4f005c8208 100644 --- a/toolchain/parse/testdata/generics/named_constraint/invalid_method.carbon +++ b/toolchain/parse/testdata/generics/named_constraint/invalid_method.carbon @@ -10,12 +10,12 @@ constraint E { // This is an error in the check phase. - fn DeclaredMethod[self: Self](b: Self) -> Self; + fn DeclaredMethod(self, b: Self) -> Self; } constraint Foo { // This is an error in the check phase. - fn DefinedMethod[unused self: Self](b: Self) -> Self {} + fn DefinedMethod(unused self, b: Self) -> Self {} } // CHECK:STDOUT: - filename: invalid_method.carbon @@ -26,40 +26,36 @@ constraint Foo { // CHECK:STDOUT: {kind: 'NamedConstraintDefinitionStart', text: '{', subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'DeclaredMethod'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 8}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, -// CHECK:STDOUT: {kind: 'NamedConstraintDefinition', text: '}', subtree_size: 19}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 13}, +// CHECK:STDOUT: {kind: 'NamedConstraintDefinition', text: '}', subtree_size: 17}, // CHECK:STDOUT: {kind: 'NamedConstraintIntroducer', text: 'constraint'}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'Foo'}, // CHECK:STDOUT: {kind: 'NamedConstraintDefinitionStart', text: '{', subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'IdentifierNameMaybeBeforeSignature', text: 'DefinedMethod'}, -// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['}, -// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, -// CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, -// CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'UnusedPattern', text: 'unused', subtree_size: 4}, -// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 6}, // CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('}, +// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'}, +// CHECK:STDOUT: {kind: 'SelfBindingPattern', text: 'self', subtree_size: 2}, +// CHECK:STDOUT: {kind: 'UnusedPattern', text: 'unused', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'PatternListComma', text: ','}, // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'b'}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'LetBindingPattern', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 9}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 16}, -// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 17}, -// CHECK:STDOUT: {kind: 'NamedConstraintDefinition', text: '}', subtree_size: 21}, +// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 14}, +// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'NamedConstraintDefinition', text: '}', subtree_size: 19}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/typed_nodes.h b/toolchain/parse/typed_nodes.h index f847c7f1964e..653b41829378 100644 --- a/toolchain/parse/typed_nodes.h +++ b/toolchain/parse/typed_nodes.h @@ -370,6 +370,18 @@ struct LetBindingPattern { AnyExprId type; }; +// A `self` binding whose type is omitted, such as `fn F(self)` or +// `fn F(ref self)`. The type is implicitly `Self`; checking treats this exactly +// like a `self: Self` binding. There is no type node, so the whole binding +// sits on the one `self` token. +struct SelfBindingPattern { + static constexpr auto Kind = NodeKind::SelfBindingPattern.Define( + {.category = NodeCategory::Pattern, .child_count = 1}); + + Lex::SelfValueIdentifierTokenIndex token; + NodeIdOneOf name; +}; + // A binding pattern, such as `name: Type`, that is inside a `var` pattern. struct VarBindingPattern { static constexpr auto Kind = NodeKind::VarBindingPattern.Define( diff --git a/toolchain/sem_ir/function.h b/toolchain/sem_ir/function.h index dfd9039305c3..5847dd2aa32b 100644 --- a/toolchain/sem_ir/function.h +++ b/toolchain/sem_ir/function.h @@ -142,8 +142,8 @@ struct FunctionFields { // function. EvaluationMode evaluation_mode = EvaluationMode::None; - // The implicit self parameter pattern, if any, in - // implicit_param_patterns_id from EntityWithParamsBase. + // The `self` parameter pattern, if any. This is the first pattern in + // `param_patterns_id` (from EntityWithParamsBase). InstId self_param_id = InstId::None; // Data that is specific to the special function kind. Use diff --git a/toolchain/testing/testdata/min_prelude/parts/as.carbon b/toolchain/testing/testdata/min_prelude/parts/as.carbon index b840549b9c99..0227a2e5de7c 100644 --- a/toolchain/testing/testdata/min_prelude/parts/as.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/as.carbon @@ -15,23 +15,23 @@ export import library "prelude/parts/destroy"; export import library "prelude/parts/form"; interface UnsafeAs(Dest:! type) { - fn Convert[self: Self]() -> Dest; + fn Convert(self) -> Dest; } interface As(Dest:! type) { // TODO: extend UnsafeAs(Dest); - fn Convert[self: Self]() -> Dest; + fn Convert(self) -> Dest; } interface ImplicitAs(Dest:! type) { // TODO: extend As(Dest); - fn Convert[self: Self]() -> Dest; + fn Convert(self) -> Dest; } interface BitAndWith(Other:! type) { - fn Op[self: Self](other: Other) -> Self; + fn Op(self, other: Other) -> Self; } impl type as BitAndWith(type) { - fn Op[self: Self](other: Self) -> Self = "type.and"; + fn Op(self, other: Self) -> Self = "type.and"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/char.carbon b/toolchain/testing/testdata/min_prelude/parts/char.carbon index aa0434e0d781..8f458d278784 100644 --- a/toolchain/testing/testdata/min_prelude/parts/char.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/char.carbon @@ -18,5 +18,5 @@ class Char { } impl CharLiteral as ImplicitAs(Char) { - fn Convert[self: Self]() -> Char = "char.convert_checked"; + fn Convert(self) -> Char = "char.convert_checked"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/copy.carbon b/toolchain/testing/testdata/min_prelude/parts/copy.carbon index 1c1bb43e6496..fcf26df69fc6 100644 --- a/toolchain/testing/testdata/min_prelude/parts/copy.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/copy.carbon @@ -9,7 +9,7 @@ package Core library "prelude/parts/copy"; // Copying an object, which is a conversion from a value representation to an // initializing representation. interface Copy { - fn Op[self: Self]() -> Self; + fn Op(self) -> Self; } private fn MakeBool() -> type = "bool.make_type"; @@ -22,45 +22,45 @@ private fn MakeIntLiteral() -> type = "int_literal.make_type"; private alias IntLiteral = MakeIntLiteral(); impl forall [T:! Copy] const T as Copy { - fn Op[self: Self]() -> Self { return (self as T).(Copy.Op)() as const T; } + fn Op(self) -> Self { return (self as T).(Copy.Op)() as const T; } } impl Bool as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl CharLiteral as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl FloatLiteral as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl IntLiteral as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl forall [T:! type] T* as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl type as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl () as Copy { - fn Op[self: Self]() -> Self = "no_op"; + fn Op(self) -> Self = "no_op"; } impl forall [T:! Copy, U:! Copy] (T, U) as Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return (self.0.Op(), self.1.Op()); } } impl forall [T:! Copy, U:! Copy, V:! Copy] (T, U, V) as Copy { - fn Op[self: Self]() -> Self { + fn Op(self) -> Self { return (self.0.Op(), self.1.Op(), self.2.Op()); } } diff --git a/toolchain/testing/testdata/min_prelude/parts/destroy.carbon b/toolchain/testing/testdata/min_prelude/parts/destroy.carbon index 536cb7ad65f7..142787fc7bae 100644 --- a/toolchain/testing/testdata/min_prelude/parts/destroy.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/destroy.carbon @@ -8,12 +8,12 @@ package Core library "prelude/parts/destroy"; // TODO: Add `Destructor`, as in: // interface Destructor { -// private fn Op[ref self: Self](); +// private fn Op(ref self); // } // Destroys objects. This will invoke `Destructor` impls recursively on members; // it does not deallocate memory. interface Destroy { - // TODO: This should be `final fn Op[ref self: Self]() = "type.destroy"`. - fn Op[ref self: Self](); + // TODO: This should be `final fn Op(ref self) = "type.destroy"`. + fn Op(ref self); } diff --git a/toolchain/testing/testdata/min_prelude/parts/float.carbon b/toolchain/testing/testdata/min_prelude/parts/float.carbon index 874a6a8570c5..01c57fcc3259 100644 --- a/toolchain/testing/testdata/min_prelude/parts/float.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/float.carbon @@ -23,14 +23,14 @@ class Float(N:! IntLiteral) { } impl forall [N:! IntLiteral] Float(N) as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } impl forall [To:! IntLiteral] FloatLiteral as ImplicitAs(Float(To)) { - fn Convert[self: Self]() -> Float(To) = "float.convert_checked"; + fn Convert(self) -> Float(To) = "float.convert_checked"; } // TODO: Remove this once ImplicitAs extends As. impl forall [To:! IntLiteral] FloatLiteral as As(Float(To)) { - fn Convert[self: Self]() -> Float(To) = "float.convert_checked"; + fn Convert(self) -> Float(To) = "float.convert_checked"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/int.carbon b/toolchain/testing/testdata/min_prelude/parts/int.carbon index 94dcc35a2ea5..ce3b328fab9d 100644 --- a/toolchain/testing/testdata/min_prelude/parts/int.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/int.carbon @@ -23,31 +23,31 @@ class Int(N:! IntLiteral) { // Copy. impl forall [N:! IntLiteral] Int(N) as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } // Conversions. impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(Int(To)) { - fn Convert[self: Self]() -> Int(To) = "int.convert_checked"; + fn Convert(self) -> Int(To) = "int.convert_checked"; } final impl forall [From:! IntLiteral] Int(From) as ImplicitAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. impl forall [To:! IntLiteral] IntLiteral as As(Int(To)) { - fn Convert[self: Self]() -> Int(To) = "int.convert_checked"; + fn Convert(self) -> Int(To) = "int.convert_checked"; } final impl forall [From:! IntLiteral] Int(From) as As(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // Negate. final impl forall [N:! IntLiteral] Int(N) as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "int.snegate"; + fn Op(self) -> Self = "int.snegate"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/int_literal.carbon b/toolchain/testing/testdata/min_prelude/parts/int_literal.carbon index a6bf809654fe..a60d20d2d8e7 100644 --- a/toolchain/testing/testdata/min_prelude/parts/int_literal.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/int_literal.carbon @@ -13,9 +13,9 @@ alias IntLiteral = MakeIntLiteral(); interface Negate { let Result:! type; - fn Op[self: Self]() -> Result; + fn Op(self) -> Result; } impl IntLiteral as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "int.snegate"; + fn Op(self) -> Self = "int.snegate"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/iterate.carbon b/toolchain/testing/testdata/min_prelude/parts/iterate.carbon index 0aae03be0c5d..600b71b38fb1 100644 --- a/toolchain/testing/testdata/min_prelude/parts/iterate.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/iterate.carbon @@ -15,6 +15,6 @@ import library "prelude/parts/optional"; interface Iterate { let ElementType:! Copy; let CursorType:! type; - fn NewCursor[self: Self]() -> CursorType; - fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); + fn NewCursor(self) -> CursorType; + fn Next(self, cursor: CursorType*) -> Optional(ElementType); } diff --git a/toolchain/testing/testdata/min_prelude/parts/optional.carbon b/toolchain/testing/testdata/min_prelude/parts/optional.carbon index 0b5f4995ead6..134a53d214c0 100644 --- a/toolchain/testing/testdata/min_prelude/parts/optional.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/optional.carbon @@ -27,8 +27,8 @@ class Optional(T:! Copy) { return {.has_value = true, .value = value}; } - fn HasValue[self: Self]() -> bool { return self.has_value; } - fn Get[self: Self]() -> T { return self.value; } + fn HasValue(self) -> bool { return self.has_value; } + fn Get(self) -> T { return self.value; } var has_value: bool; var value: T; diff --git a/toolchain/testing/testdata/min_prelude/parts/uint.carbon b/toolchain/testing/testdata/min_prelude/parts/uint.carbon index 2f6a50781d9e..89da313f774d 100644 --- a/toolchain/testing/testdata/min_prelude/parts/uint.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/uint.carbon @@ -23,31 +23,31 @@ class UInt(N:! IntLiteral) { // Copy. impl forall [N:! IntLiteral] UInt(N) as Copy { - fn Op[self: Self]() -> Self = "primitive_copy"; + fn Op(self) -> Self = "primitive_copy"; } // Conversions. impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(UInt(To)) { - fn Convert[self: Self]() -> UInt(To) = "int.convert_checked"; + fn Convert(self) -> UInt(To) = "int.convert_checked"; } final impl forall [From:! IntLiteral] UInt(From) as ImplicitAs(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. impl forall [To:! IntLiteral] IntLiteral as As(UInt(To)) { - fn Convert[self: Self]() -> UInt(To) = "int.convert_checked"; + fn Convert(self) -> UInt(To) = "int.convert_checked"; } final impl forall [From:! IntLiteral] UInt(From) as As(IntLiteral) { - fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; + fn Convert(self) -> IntLiteral = "int.convert_checked"; } // Negate. final impl forall [N:! IntLiteral] UInt(N) as Negate where .Result = Self { - fn Op[self: Self]() -> Self = "int.unegate"; + fn Op(self) -> Self = "int.unegate"; } diff --git a/utils/textmate/Samples/main.carbon b/utils/textmate/Samples/main.carbon index fe1a2d711437..380fe968ec5e 100644 --- a/utils/textmate/Samples/main.carbon +++ b/utils/textmate/Samples/main.carbon @@ -7,11 +7,11 @@ package Carbon api; interface HasValueParam(T:! type, V:! T) { - fn Go[self: Self]() -> T; + fn Go(self) -> T; } impl () as HasValueParam(i32, 5) { - fn Go[self: Self]() -> i32 { return 42; } + fn Go(self) -> i32 { return 42; } } class Point {