From 19d59b2a8df4d8b4ee917ebbbba26fdc62dcfd9d Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 17 Jun 2025 13:58:59 -0400 Subject: [PATCH] Reduce use of the prelude in tests (#5683) Remove use of i32/bool when a builtin type or test-define class type can work. Make `Sub` user-defines in a test that is testing builtin functions and not trying to test the prelude, in the same way that it defines its own Negate. Reduce use of the + operator when it isn't contributing to the test's coverage, since the + operator needs the full prelude. Remove use of Core.Print when it's not required for the test. Move `deduce_nested_facet_value.carbon` to its own file since it uses TypeAnd, and the rest of deduce.carbon does not, but uses i32. This means they can each use a different min-prelude. --------- Co-authored-by: Jon Ross-Perkins --- .../builtins/int/make_type_signed.carbon | 2 +- .../testdata/builtins/int/snegate.carbon | 5 +- .../class/fail_convert_to_invalid.carbon | 63 +- .../testdata/class/fail_generic_method.carbon | 168 +--- .../testdata/class/fail_incomplete.carbon | 350 +-------- .../testdata/class/fail_member_of_let.carbon | 80 +- .../check/testdata/class/fail_scope.carbon | 115 +-- .../testdata/class/fail_self_param.carbon | 63 +- .../testdata/class/generic/redeclare.carbon | 223 +++--- .../check/testdata/class/redeclaration.carbon | 43 +- .../testdata/function/generic/deduce.carbon | 263 ------- .../generic/deduce_nested_facet_value.carbon | 276 +++++++ .../testdata/impl/use_assoc_const.carbon | 719 ++++++++---------- .../generic/call_impl_function.carbon | 56 +- ...ross_library_name_collision_private.carbon | 23 +- 15 files changed, 769 insertions(+), 1680 deletions(-) create mode 100644 toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 7dda03f2494c..5fceac41ee18 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -78,7 +78,7 @@ library "[[@TEST_NAME]]"; import library "types"; -fn Negate(n: i32) -> i32 = "int.snegate"; +fn Negate(a: IntLiteral()) -> IntLiteral() = "int.snegate"; // CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: error: integer type width of -1 is not positive [IntWidthNotPositive] // CHECK:STDERR: var n: Int(Negate(1)); diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index a03c27f6ea87..950eef260da1 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -30,14 +30,15 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { library "[[@TEST_NAME]]"; fn Negate(a: Core.IntLiteral()) -> Core.IntLiteral() = "int.snegate"; +fn Sub(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.ssub"; class Expect(N:! Core.IntLiteral()) {} fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } fn F() { Test(Negate(0)) as Expect(0); - Test(Negate(1)) as Expect(0 - 1); - Test(Negate(0 - 0x8000_0000_0000_0000)) as Expect(0x8000_0000_0000_0000); + Test(Negate(1)) as Expect(Sub(0, 1)); + Test(Negate(Sub(0, 0x8000_0000_0000_0000))) as Expect(0x8000_0000_0000_0000); } // --- fail_too_few.carbon diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index f642e0e14c1e..f5746f92492e 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -2,9 +2,6 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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/fail_convert_to_invalid.carbon @@ -20,63 +17,5 @@ class C { } fn Make() -> C { - return {.a = 123}; + return {.a = ()}; } - -// CHECK:STDOUT: --- fail_convert_to_invalid.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete] -// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] -// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] -// CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: Core.IntLiteral} [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: .C = %C.decl -// CHECK:STDOUT: .NoSuchType = -// CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [concrete = constants.%Make] { -// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %return.param: ref %C = out_param call_param0 -// CHECK:STDOUT: %return: ref %C = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %NoSuchType.ref: = name_ref NoSuchType, [concrete = ] -// CHECK:STDOUT: %.loc19: = field_decl a, element0 [concrete] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: } [concrete = ] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.a [concrete = ] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .NoSuchType = -// CHECK:STDOUT: .a = %.loc19 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Make() -> %return.param: %C { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123] -// CHECK:STDOUT: %.loc23: %struct_type.a = struct_literal (%int_123) -// CHECK:STDOUT: return to %return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 9e2d425a2e06..20d7c55fe55a 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -2,15 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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/fail_generic_method.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_generic_method.carbon +class I {} + class Class(T:! type) { var a: T; fn F[self: Self](n: T); @@ -18,164 +17,19 @@ class Class(T:! type) { // 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]]:10: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] -// CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+15]]:10: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] +// CHECK:STDERR: fn Class(N:! I).F[self: Self](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]]:27: error: name `Self` not found [NameNotFound] -// CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+8]]:25: error: name `Self` not found [NameNotFound] +// CHECK:STDERR: fn Class(N:! I).F[self: Self](n: T) {} +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:36: error: name `T` not found [NameNotFound] -// CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} -// CHECK:STDERR: ^ +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:34: error: name `T` not found [NameNotFound] +// CHECK:STDERR: fn Class(N:! I).F[self: Self](n: T) {} +// CHECK:STDERR: ^ // CHECK:STDERR: -fn Class(N:! i32).F[self: Self](n: T) {} - -// CHECK:STDOUT: --- fail_generic_method.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete] -// CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic] -// CHECK:STDOUT: %require_complete.4ae: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic] -// CHECK:STDOUT: %pattern_type.3c1: type = pattern_type %Class [symbolic] -// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic] -// CHECK:STDOUT: %F.type.6d6: type = fn_type @F.1, @Class(%T) [symbolic] -// CHECK:STDOUT: %F.cca: %F.type.6d6 = struct_value () [symbolic] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic] -// CHECK:STDOUT: %complete_type.f1b: = complete_type_witness %struct_type.a [symbolic] -// 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: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [concrete] -// CHECK:STDOUT: %F.c41: %F.type.b25 = 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: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .T = -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [concrete = constants.%Class.generic] { -// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %T.loc14_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_13.2 (constants.%T)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type.b25 = fn_decl @F.2 [concrete = constants.%F.c41] { -// CHECK:STDOUT: %self.patt: = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %n.patt: = binding_pattern n [concrete] -// CHECK:STDOUT: %n.param_patt: = value_param_pattern %n.patt, call_param1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc36: type = splice_block %i32 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc36_10.1: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc36_10.2 (constants.%N.51e)] -// CHECK:STDOUT: %self.param: = value_param call_param0 -// CHECK:STDOUT: %Self.ref: = name_ref Self, [concrete = ] -// CHECK:STDOUT: %self: = bind_name self, %self.param [concrete = ] -// CHECK:STDOUT: %n.param: = value_param call_param1 -// CHECK:STDOUT: %T.ref: = name_ref T, [concrete = ] -// CHECK:STDOUT: %n: = bind_name n, %n.param [concrete = ] -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(%T.loc14_13.1: type) { -// CHECK:STDOUT: %T.loc14_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_13.2 (constants.%T)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc14_13.2 [symbolic = %require_complete (constants.%require_complete.4ae)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc14_13.2) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.loc14_13.2 [symbolic = %Class.elem (constants.%Class.elem)] -// CHECK:STDOUT: %F.type: type = fn_type @F.1, @Class(%T.loc14_13.2) [symbolic = %F.type (constants.%F.type.6d6)] -// CHECK:STDOUT: %F: @Class.%F.type (%F.type.6d6) = struct_value () [symbolic = %F (constants.%F.cca)] -// CHECK:STDOUT: %struct_type.a.loc17_1.2: type = struct_type {.a: @Class.%T.loc14_13.2 (%T)} [symbolic = %struct_type.a.loc17_1.2 (constants.%struct_type.a)] -// CHECK:STDOUT: %complete_type.loc17_1.2: = complete_type_witness %struct_type.a.loc17_1.2 [symbolic = %complete_type.loc17_1.2 (constants.%complete_type.f1b)] -// CHECK:STDOUT: -// CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc14_13.1 [symbolic = %T.loc14_13.2 (constants.%T)] -// CHECK:STDOUT: %.loc15: @Class.%Class.elem (%Class.elem) = field_decl a, element0 [concrete] -// CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type.6d6) = fn_decl @F.1 [symbolic = @Class.%F (constants.%F.cca)] { -// CHECK:STDOUT: %self.patt: @F.1.%pattern_type.loc16_8 (%pattern_type.3c1) = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type.loc16_8 (%pattern_type.3c1) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %n.patt: @F.1.%pattern_type.loc16_20 (%pattern_type.7dc) = binding_pattern n [concrete] -// CHECK:STDOUT: %n.param_patt: @F.1.%pattern_type.loc16_20 (%pattern_type.7dc) = value_param_pattern %n.patt, call_param1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @F.1.%Class (%Class) = value_param call_param0 -// CHECK:STDOUT: %.loc16_14.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] { -// CHECK:STDOUT: %.loc16_14.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc16_14.2 [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @F.1.%Class (%Class) = bind_name self, %self.param -// CHECK:STDOUT: %n.param: @F.1.%T (%T) = value_param call_param1 -// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc14_13.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %n: @F.1.%T (%T) = bind_name n, %n.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %struct_type.a.loc17_1.1: type = struct_type {.a: %T} [symbolic = %struct_type.a.loc17_1.2 (constants.%struct_type.a)] -// CHECK:STDOUT: %complete_type.loc17_1.1: = complete_type_witness %struct_type.a.loc17_1.1 [symbolic = %complete_type.loc17_1.2 (constants.%complete_type.f1b)] -// CHECK:STDOUT: complete_type_witness = %complete_type.loc17_1.1 -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .T = -// CHECK:STDOUT: .a = %.loc15 -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(@Class.%T.loc14_13.1: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)] -// CHECK:STDOUT: %pattern_type.loc16_8: type = pattern_type %Class [symbolic = %pattern_type.loc16_8 (constants.%pattern_type.3c1)] -// CHECK:STDOUT: %pattern_type.loc16_20: type = pattern_type %T [symbolic = %pattern_type.loc16_20 (constants.%pattern_type.7dc)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @F.1.%Class (%Class), %n.param: @F.1.%T (%T)); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.2(%N.loc36_10.1: %i32) { -// CHECK:STDOUT: %N.loc36_10.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc36_10.2 (constants.%N.51e)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: , %n.param: ) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T.loc14_13.2 => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %Class => constants.%Class -// CHECK:STDOUT: %pattern_type.loc16_8 => constants.%pattern_type.3c1 -// CHECK:STDOUT: %pattern_type.loc16_20 => constants.%pattern_type.7dc -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @F.2(constants.%N.51e) { -// CHECK:STDOUT: %N.loc36_10.2 => constants.%N.51e -// CHECK:STDOUT: } -// CHECK:STDOUT: +fn Class(N:! I).F[self: Self](n: T) {} diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 9bb6511561bc..75e72556a94d 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -2,9 +2,6 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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/fail_incomplete.carbon @@ -55,7 +52,7 @@ var global_var: Class; // CHECK:STDERR: fn ConvertFromStruct() -> Class { return {}; } -fn G(p: Class*) -> i32 { +fn G(p: Class*) -> () { // CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+7]]:10: error: member access into object of incomplete type `Class` [IncompleteTypeInMemberAccess] // CHECK:STDERR: return p->n; // CHECK:STDERR: ^~~~ @@ -66,7 +63,7 @@ fn G(p: Class*) -> i32 { return p->n; } -fn MemberAccess(p: Class*) -> i32 { +fn MemberAccess(p: Class*) -> () { // CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+7]]:11: error: member access into object of incomplete type `Class` [IncompleteTypeInMemberAccess] // CHECK:STDERR: return (*p).n; // CHECK:STDERR: ^~ @@ -176,346 +173,3 @@ class C { // CHECK:STDERR: var c: C; } - -// CHECK:STDOUT: --- fail_forward_decl.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Class: type = class_type @Class [concrete] -// CHECK:STDOUT: %Function.type: type = fn_type @Function [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %Function: %Function.type = struct_value () [concrete] -// CHECK:STDOUT: %CallClassFunction.type: type = fn_type @CallClassFunction [concrete] -// CHECK:STDOUT: %CallClassFunction: %CallClassFunction.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.761: type = pattern_type %Class [concrete] -// CHECK:STDOUT: %ConvertFromStruct.type: type = fn_type @ConvertFromStruct [concrete] -// CHECK:STDOUT: %ConvertFromStruct: %ConvertFromStruct.type = struct_value () [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %ptr.e71: type = ptr_type %Class [concrete] -// CHECK:STDOUT: %pattern_type.796: type = pattern_type %ptr.e71 [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: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %G.type: type = fn_type @G [concrete] -// CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %MemberAccess.type: type = fn_type @MemberAccess [concrete] -// CHECK:STDOUT: %MemberAccess: %MemberAccess.type = struct_value () [concrete] -// CHECK:STDOUT: %Copy.type: type = fn_type @Copy [concrete] -// CHECK:STDOUT: %Copy: %Copy.type = struct_value () [concrete] -// CHECK:STDOUT: %Let.type: type = fn_type @Let [concrete] -// CHECK:STDOUT: %Let: %Let.type = struct_value () [concrete] -// CHECK:STDOUT: %TakeIncomplete.type: type = fn_type @TakeIncomplete [concrete] -// CHECK:STDOUT: %TakeIncomplete: %TakeIncomplete.type = struct_value () [concrete] -// CHECK:STDOUT: %ReturnIncomplete.type: type = fn_type @ReturnIncomplete [concrete] -// CHECK:STDOUT: %ReturnIncomplete: %ReturnIncomplete.type = struct_value () [concrete] -// CHECK:STDOUT: %CallTakeIncomplete.type: type = fn_type @CallTakeIncomplete [concrete] -// CHECK:STDOUT: %CallTakeIncomplete: %CallTakeIncomplete.type = struct_value () [concrete] -// CHECK:STDOUT: %CallReturnIncomplete.type: type = fn_type @CallReturnIncomplete [concrete] -// CHECK:STDOUT: %CallReturnIncomplete: %CallReturnIncomplete.type = struct_value () [concrete] -// CHECK:STDOUT: %IncompleteAddrSelf: type = class_type @IncompleteAddrSelf [concrete] -// CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete] -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %CallIncompleteAddrSelf.type: type = fn_type @CallIncompleteAddrSelf [concrete] -// CHECK:STDOUT: %CallIncompleteAddrSelf: %CallIncompleteAddrSelf.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: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .CallClassFunction = %CallClassFunction.decl -// CHECK:STDOUT: .global_var = %global_var -// CHECK:STDOUT: .ConvertFromStruct = %ConvertFromStruct.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .MemberAccess = %MemberAccess.decl -// CHECK:STDOUT: .Copy = %Copy.decl -// CHECK:STDOUT: .Let = %Let.decl -// CHECK:STDOUT: .TakeIncomplete = %TakeIncomplete.decl -// CHECK:STDOUT: .ReturnIncomplete = %ReturnIncomplete.decl -// CHECK:STDOUT: .CallTakeIncomplete = %CallTakeIncomplete.decl -// CHECK:STDOUT: .CallReturnIncomplete = %CallReturnIncomplete.decl -// CHECK:STDOUT: .IncompleteAddrSelf = %IncompleteAddrSelf.decl -// CHECK:STDOUT: .CallIncompleteAddrSelf = %CallIncompleteAddrSelf.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {} -// CHECK:STDOUT: %Function.decl: %Function.type = fn_decl @Function [concrete = constants.%Function] {} {} -// CHECK:STDOUT: %CallClassFunction.decl: %CallClassFunction.type = fn_decl @CallClassFunction [concrete = constants.%CallClassFunction] {} {} -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %global_var.patt: = binding_pattern global_var [concrete] -// CHECK:STDOUT: %global_var.var_patt: = var_pattern %global_var.patt [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %global_var.var: ref = var %global_var.var_patt [concrete = ] -// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %global_var: = bind_name global_var, [concrete = ] -// CHECK:STDOUT: %ConvertFromStruct.decl: %ConvertFromStruct.type = fn_decl @ConvertFromStruct [concrete = constants.%ConvertFromStruct] { -// CHECK:STDOUT: %return.patt: %pattern_type.761 = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.761 = out_param_pattern %return.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %return.param: ref %Class = out_param call_param0 -// CHECK:STDOUT: %return: ref %Class = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { -// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete] -// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0 -// CHECK:STDOUT: %.loc44: type = splice_block %ptr [concrete = constants.%ptr.e71] { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref [concrete = constants.%ptr.e71] -// CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.e71 = bind_name 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: %MemberAccess.decl: %MemberAccess.type = fn_decl @MemberAccess [concrete = constants.%MemberAccess] { -// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete] -// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0 -// CHECK:STDOUT: %.loc55: type = splice_block %ptr [concrete = constants.%ptr.e71] { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref [concrete = constants.%ptr.e71] -// CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.e71 = bind_name 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: %Copy.decl: %Copy.type = fn_decl @Copy [concrete = constants.%Copy] { -// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete] -// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.761 = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.761 = out_param_pattern %return.patt, call_param1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref.loc73_23: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0 -// CHECK:STDOUT: %.loc73: type = splice_block %ptr [concrete = constants.%ptr.e71] { -// CHECK:STDOUT: %Class.ref.loc73_12: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref.loc73_12 [concrete = constants.%ptr.e71] -// CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param -// CHECK:STDOUT: %return.param: ref %Class = out_param call_param1 -// CHECK:STDOUT: %return: ref %Class = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Let.decl: %Let.type = fn_decl @Let [concrete = constants.%Let] { -// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete] -// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0 -// CHECK:STDOUT: %.loc77: type = splice_block %ptr [concrete = constants.%ptr.e71] { -// CHECK:STDOUT: %Class.ref.loc77: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref.loc77 [concrete = constants.%ptr.e71] -// CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %TakeIncomplete.decl: %TakeIncomplete.type = fn_decl @TakeIncomplete [concrete = constants.%TakeIncomplete] { -// CHECK:STDOUT: %c.patt: %pattern_type.761 = binding_pattern c [concrete] -// CHECK:STDOUT: %c.param_patt: %pattern_type.761 = value_param_pattern %c.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %c.param: %Class = value_param call_param0 -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %c: %Class = bind_name c, %c.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %ReturnIncomplete.decl: %ReturnIncomplete.type = fn_decl @ReturnIncomplete [concrete = constants.%ReturnIncomplete] { -// CHECK:STDOUT: %return.patt: %pattern_type.761 = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.761 = out_param_pattern %return.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %return.param: ref %Class = out_param call_param0 -// CHECK:STDOUT: %return: ref %Class = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %CallTakeIncomplete.decl: %CallTakeIncomplete.type = fn_decl @CallTakeIncomplete [concrete = constants.%CallTakeIncomplete] { -// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete] -// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0 -// CHECK:STDOUT: %.loc92: type = splice_block %ptr [concrete = constants.%ptr.e71] { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref [concrete = constants.%ptr.e71] -// CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %CallReturnIncomplete.decl: %CallReturnIncomplete.type = fn_decl @CallReturnIncomplete [concrete = constants.%CallReturnIncomplete] {} {} -// CHECK:STDOUT: %IncompleteAddrSelf.decl: type = class_decl @IncompleteAddrSelf [concrete = constants.%IncompleteAddrSelf] {} {} -// CHECK:STDOUT: %CallIncompleteAddrSelf.decl: %CallIncompleteAddrSelf.type = fn_decl @CallIncompleteAddrSelf [concrete = constants.%CallIncompleteAddrSelf] { -// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete] -// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0 -// CHECK:STDOUT: %.loc136: type = splice_block %ptr [concrete = constants.%ptr.e71] { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref [concrete = constants.%ptr.e71] -// CHECK:STDOUT: } -// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @Class; -// CHECK:STDOUT: -// CHECK:STDOUT: class @IncompleteAddrSelf { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { -// CHECK:STDOUT: %self.patt: %pattern_type.796 = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type.796 = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %.loc133_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ptr.e71 = value_param call_param0 -// CHECK:STDOUT: %.loc133_24: type = splice_block %ptr [concrete = constants.%ptr.e71] { -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref [concrete = constants.%ptr.e71] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: %ptr.e71 = bind_name self, %self.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%IncompleteAddrSelf -// CHECK:STDOUT: .Class = -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Function() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @CallClassFunction() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %Function.ref: = name_ref Function, [concrete = ] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertFromStruct() -> %Class { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc42: %empty_struct_type = struct_literal () -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p.param: %ptr.e71) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p -// CHECK:STDOUT: %.loc52: ref %Class = deref %p.ref -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @MemberAccess(%p.param: %ptr.e71) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p -// CHECK:STDOUT: %.loc63: ref %Class = deref %p.ref -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Copy(%p.param: %ptr.e71) -> %Class { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p -// CHECK:STDOUT: %.loc74: ref %Class = deref %p.ref -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Let(%p.param: %ptr.e71) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %c.patt: = binding_pattern c [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p -// CHECK:STDOUT: %.loc85: ref %Class = deref %p.ref -// CHECK:STDOUT: %Class.ref.loc85: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: %c: = bind_name c, [concrete = ] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TakeIncomplete(%c.param: %Class); -// CHECK:STDOUT: -// CHECK:STDOUT: fn @ReturnIncomplete() -> %Class; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @CallTakeIncomplete(%p.param: %ptr.e71) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TakeIncomplete.ref.loc103: %TakeIncomplete.type = name_ref TakeIncomplete, file.%TakeIncomplete.decl [concrete = constants.%TakeIncomplete] -// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p -// CHECK:STDOUT: %.loc103: ref %Class = deref %p.ref -// CHECK:STDOUT: %TakeIncomplete.call.loc103: init %empty_tuple.type = call %TakeIncomplete.ref.loc103() -// CHECK:STDOUT: %TakeIncomplete.ref.loc115: %TakeIncomplete.type = name_ref TakeIncomplete, file.%TakeIncomplete.decl [concrete = constants.%TakeIncomplete] -// CHECK:STDOUT: %.loc115: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %TakeIncomplete.call.loc115: init %empty_tuple.type = call %TakeIncomplete.ref.loc115() -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @CallReturnIncomplete() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %ReturnIncomplete.ref: %ReturnIncomplete.type = name_ref ReturnIncomplete, file.%ReturnIncomplete.decl [concrete = constants.%ReturnIncomplete] -// CHECK:STDOUT: %ReturnIncomplete.call: init = call %ReturnIncomplete.ref() -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%self.param: %ptr.e71); -// CHECK:STDOUT: -// CHECK:STDOUT: fn @CallIncompleteAddrSelf(%p.param: %ptr.e71) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p -// CHECK:STDOUT: %IncompleteAddrSelf.ref: type = name_ref IncompleteAddrSelf, file.%IncompleteAddrSelf.decl [concrete = constants.%IncompleteAddrSelf] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, @IncompleteAddrSelf.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc148: ref %Class = deref %p.ref -// CHECK:STDOUT: %F.bound: = bound_method %.loc148, %F.ref -// CHECK:STDOUT: %addr: = addr_of [concrete = ] -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound() -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_in_definition.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [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: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc12: = field_decl c, element0 [concrete] -// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: } [concrete = ] -// CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.c [concrete = ] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .C = -// CHECK:STDOUT: .c = %.loc12 -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 92f699964673..1b491eaa02ad 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -2,9 +2,6 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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/fail_member_of_let.carbon @@ -12,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_member_of_let.carbon class Class { - fn F() -> i32; + fn F() -> (); } // TODO: Use `:!` here once it is available. @@ -28,78 +25,3 @@ let T: type = Class; // CHECK:STDERR: ^ // CHECK:STDERR: fn T.F() {} - -// CHECK:STDOUT: --- fail_member_of_let.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Class: type = class_type @Class [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: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %F.type.f1b: type = fn_type @F.1 [concrete] -// CHECK:STDOUT: %F.1f2: %F.type.f1b = struct_value () [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [concrete] -// CHECK:STDOUT: %F.c41: %F.type.b25 = 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: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .T = %T -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {} -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %T.patt: %pattern_type.98f = binding_pattern T [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %T: type = bind_name T, @__global_init.%Class.ref -// CHECK:STDOUT: %F.decl: %F.type.b25 = fn_decl @F.2 [concrete = constants.%F.c41] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %F.decl: %F.type.f1b = fn_decl @F.1 [concrete = constants.%F.1f2] { -// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F.1() -> %i32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 04274303d39c..82e68dc60fb7 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -2,9 +2,6 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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/fail_scope.carbon @@ -12,121 +9,15 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_scope.carbon class Class { - fn F() -> i32 { - return 1; + fn F() -> () { + return (); } } -fn G() -> i32 { +fn G() -> () { // CHECK:STDERR: fail_scope.carbon:[[@LINE+4]]:10: error: name `F` not found [NameNotFound] // CHECK:STDERR: return F(); // CHECK:STDERR: ^ // CHECK:STDERR: return F(); } - -// CHECK:STDOUT: --- fail_scope.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Class: type = class_type @Class [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: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] -// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] -// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.3, @impl.4f9(%To.c80) [symbolic] -// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] -// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.4f9(%int_32) [concrete] -// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] -// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.3(%int_32) [concrete] -// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] -// CHECK:STDOUT: %G.type: type = fn_type @G [concrete] -// CHECK:STDOUT: %G: %G.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: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .F = -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {} -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { -// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @Class { -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { -// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc16_13.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_13.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc16_13.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc16_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc16_13.2: %i32 = converted %int_1, %.loc16_13.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: return %.loc16_13.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @G() -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: = name_ref F, [concrete = ] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_self_param.carbon b/toolchain/check/testdata/class/fail_self_param.carbon index 960fa0e136bb..a624ea7b0df2 100644 --- a/toolchain/check/testdata/class/fail_self_param.carbon +++ b/toolchain/check/testdata/class/fail_self_param.carbon @@ -2,9 +2,6 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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/fail_self_param.carbon @@ -16,62 +13,4 @@ // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: class C[self:! type](x:! self) {} -var v: C(0); - -// CHECK:STDOUT: --- fail_self_param.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete] -// CHECK:STDOUT: %C.generic: %C.type = 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: %int_0: Core.IntLiteral = int_value 0 [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: .C = %C.decl -// CHECK:STDOUT: .v = %v -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] { -// CHECK:STDOUT: %x.patt: = symbolic_binding_pattern x, 0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %self.ref: = name_ref self, [concrete = ] -// CHECK:STDOUT: %x: = bind_symbolic_name x, 0 [concrete = ] -// CHECK:STDOUT: } -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: = binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt: = var_pattern %v.patt [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %v.var: ref = var %v.var_patt [concrete = ] -// CHECK:STDOUT: %.1: = splice_block [concrete = ] { -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: } -// CHECK:STDOUT: %v: = bind_name v, [concrete = ] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(%x: ) { -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: class { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @C() {} -// CHECK:STDOUT: +var v: C(()); diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index d9cdf7e0daa3..cefd2a3108a2 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -38,13 +38,15 @@ class A(T:! type) {} library "[[@TEST_NAME]]"; -class B(N:! i32); +class A {} + +class B(N:! A); // CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE+7]]:1: error: redeclaration differs because of implicit parameter list [RedeclParamListDiffers] // CHECK:STDERR: class B[T:! type](N:! T) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE-4]]:1: note: previously declared without implicit parameter list [RedeclParamListPrevious] -// CHECK:STDERR: class B(N:! i32); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: class B(N:! A); +// CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: class B[T:! type](N:! T) {} @@ -52,29 +54,33 @@ class B[T:! type](N:! T) {} library "[[@TEST_NAME]]"; +class A {} + class C(T:! type); // CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 2 [RedeclParamCountDiffers] -// CHECK:STDERR: class C(T:! type, U:! i32) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: class C(T:! type, U:! A) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 1 [RedeclParamCountPrevious] // CHECK:STDERR: class C(T:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -class C(T:! type, U:! i32) {} +class C(T:! type, U:! A) {} // --- fail_mismatch_param_type.carbon library "[[@TEST_NAME]]"; +class A {} + class D(T:! type); -// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] -// CHECK:STDERR: class D(T:! i32) {} +// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error: type `` of parameter 1 in redeclaration differs from previous parameter type `` [RedeclParamDiffersType] +// CHECK:STDERR: class D(T:! A) {} // CHECK:STDERR: ^ // CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: class D(T:! type); // CHECK:STDERR: ^ // CHECK:STDERR: -class D(T:! i32) {} +class D(T:! A) {} // --- fail_mismatch_param_name.carbon @@ -204,12 +210,11 @@ class E(U:! type) {} // CHECK:STDOUT: --- fail_mismatch_implicit_param_list.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// 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: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %A: type = class_type @A [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %N.9e6: %A = bind_symbolic_name N, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete] // CHECK:STDOUT: %B.type.844c0f.1: type = generic_class_type @B.1 [concrete] // CHECK:STDOUT: %B.generic.ba299b.1: %B.type.844c0f.1 = struct_value () [concrete] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] @@ -219,60 +224,64 @@ class E(U:! type) {} // CHECK:STDOUT: %B.type.844c0f.2: type = generic_class_type @B.2 [concrete] // CHECK:STDOUT: %B.generic.ba299b.2: %B.type.844c0f.2 = struct_value () [concrete] // CHECK:STDOUT: %B.828: type = class_type @B.2, @B.2(%T, %N.f22) [symbolic] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .B = %B.decl.loc4 +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.decl.loc4: %B.type.844c0f.1 = class_decl @B.1 [concrete = constants.%B.generic.ba299b.1] { -// CHECK:STDOUT: %N.patt: %pattern_type.7ce = symbolic_binding_pattern N, 0 [concrete] +// CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {} +// CHECK:STDOUT: %B.decl.loc6: %B.type.844c0f.1 = class_decl @B.1 [concrete = constants.%B.generic.ba299b.1] { +// CHECK:STDOUT: %N.patt: %pattern_type.c10 = symbolic_binding_pattern N, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4: type = splice_block %i32 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.51e)] +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %N.loc6_9.1: %A = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N.9e6)] // CHECK:STDOUT: } -// CHECK:STDOUT: %B.decl.loc12: %B.type.844c0f.2 = class_decl @B.2 [concrete = constants.%B.generic.ba299b.2] { +// CHECK:STDOUT: %B.decl.loc14: %B.type.844c0f.2 = class_decl @B.2 [concrete = constants.%B.generic.ba299b.2] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: %N.patt: @B.2.%pattern_type (%pattern_type.7dc) = symbolic_binding_pattern N, 1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_9.1 [symbolic = %T.loc12_9.2 (constants.%T)] -// CHECK:STDOUT: %N.loc12_19.1: @B.2.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc12_19.2 (constants.%N.f22)] +// CHECK:STDOUT: %T.loc14_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc14_9.1 [symbolic = %T.loc14_9.2 (constants.%T)] +// CHECK:STDOUT: %N.loc14_19.1: @B.2.%T.loc14_9.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc14_19.2 (constants.%N.f22)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @B.1(%N.loc4_9.1: %i32) { -// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.51e)] +// CHECK:STDOUT: class @A { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%A +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @B.1(%N.loc6_9.1: %A) { +// CHECK:STDOUT: %N.loc6_9.2: %A = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N.9e6)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @B.2(%T.loc12_9.1: type, %N.loc12_19.1: @B.2.%T.loc12_9.2 (%T)) { -// CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] -// CHECK:STDOUT: %N.loc12_19.2: @B.2.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc12_19.2 (constants.%N.f22)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc12_9.2 [symbolic = %pattern_type (constants.%pattern_type.7dc)] +// CHECK:STDOUT: generic class @B.2(%T.loc14_9.1: type, %N.loc14_19.1: @B.2.%T.loc14_9.2 (%T)) { +// CHECK:STDOUT: %T.loc14_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T)] +// CHECK:STDOUT: %N.loc14_19.2: @B.2.%T.loc14_9.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc14_19.2 (constants.%N.f22)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc14_9.2 [symbolic = %pattern_type (constants.%pattern_type.7dc)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -280,178 +289,184 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @B.1(constants.%N.51e) { -// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.51e +// CHECK:STDOUT: specific @B.1(constants.%N.9e6) { +// CHECK:STDOUT: %N.loc6_9.2 => constants.%N.9e6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @B.2(constants.%T, constants.%N.f22) { -// CHECK:STDOUT: %T.loc12_9.2 => constants.%T -// CHECK:STDOUT: %N.loc12_19.2 => constants.%N.f22 +// CHECK:STDOUT: %T.loc14_9.2 => constants.%T +// CHECK:STDOUT: %N.loc14_19.2 => constants.%N.f22 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_count.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %A: type = class_type @A [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %C.type.e6e560.1: type = generic_class_type @C.1 [concrete] // CHECK:STDOUT: %C.generic.965b12.1: %C.type.e6e560.1 = struct_value () [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: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %U: %i32 = bind_symbolic_name U, 1 [symbolic] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %U: %A = bind_symbolic_name U, 1 [symbolic] +// CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete] // CHECK:STDOUT: %C.type.e6e560.2: type = generic_class_type @C.2 [concrete] // CHECK:STDOUT: %C.generic.965b12.2: %C.type.e6e560.2 = struct_value () [concrete] -// CHECK:STDOUT: %C.9d5: type = class_type @C.2, @C.2(%T, %U) [symbolic] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %C.3d8: type = class_type @C.2, @C.2(%T, %U) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .C = %C.decl.loc4 +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .C = %C.decl.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl.loc4: %C.type.e6e560.1 = class_decl @C.1 [concrete = constants.%C.generic.965b12.1] { +// CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {} +// CHECK:STDOUT: %C.decl.loc6: %C.type.e6e560.1 = class_decl @C.1 [concrete = constants.%C.generic.965b12.1] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: %T.loc6_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %C.decl.loc12: %C.type.e6e560.2 = class_decl @C.2 [concrete = constants.%C.generic.965b12.2] { +// CHECK:STDOUT: %C.decl.loc14: %C.type.e6e560.2 = class_decl @C.2 [concrete = constants.%C.generic.965b12.2] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %U.patt: %pattern_type.7ce = symbolic_binding_pattern U, 1 [concrete] +// CHECK:STDOUT: %U.patt: %pattern_type.c10 = symbolic_binding_pattern U, 1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] -// CHECK:STDOUT: %.loc12: type = splice_block %i32 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc12_19.1: %i32 = bind_symbolic_name U, 1 [symbolic = %U.loc12_19.2 (constants.%U)] +// CHECK:STDOUT: %T.loc14_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T)] +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %U.loc14_19.1: %A = bind_symbolic_name U, 1 [symbolic = %U.loc14_19.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C.1(%T.loc4_9.1: type) { -// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)] +// CHECK:STDOUT: class @A { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%A +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @C.1(%T.loc6_9.1: type) { +// CHECK:STDOUT: %T.loc6_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C.2(%T.loc12_9.1: type, %U.loc12_19.1: %i32) { -// CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)] -// CHECK:STDOUT: %U.loc12_19.2: %i32 = bind_symbolic_name U, 1 [symbolic = %U.loc12_19.2 (constants.%U)] +// CHECK:STDOUT: generic class @C.2(%T.loc14_9.1: type, %U.loc14_19.1: %A) { +// CHECK:STDOUT: %T.loc14_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T)] +// CHECK:STDOUT: %U.loc14_19.2: %A = bind_symbolic_name U, 1 [symbolic = %U.loc14_19.2 (constants.%U)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C.9d5 +// CHECK:STDOUT: .Self = constants.%C.3d8 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.1(constants.%T) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T +// CHECK:STDOUT: %T.loc6_9.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.2(constants.%T, constants.%U) { -// CHECK:STDOUT: %T.loc12_9.2 => constants.%T -// CHECK:STDOUT: %U.loc12_19.2 => constants.%U +// CHECK:STDOUT: %T.loc14_9.2 => constants.%T +// CHECK:STDOUT: %U.loc14_19.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %A: type = class_type @A [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %D.type.bbd080.1: type = generic_class_type @D.1 [concrete] // CHECK:STDOUT: %D.generic.4e2319.1: %D.type.bbd080.1 = struct_value () [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: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %T.51e: %i32 = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %T.9e6: %A = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete] // CHECK:STDOUT: %D.type.bbd080.2: type = generic_class_type @D.2 [concrete] // CHECK:STDOUT: %D.generic.4e2319.2: %D.type.bbd080.2 = struct_value () [concrete] -// CHECK:STDOUT: %D.022: type = class_type @D.2, @D.2(%T.51e) [symbolic] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %D.384: type = class_type @D.2, @D.2(%T.9e6) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .D = %D.decl.loc4 +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .D = %D.decl.loc6 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %D.decl.loc4: %D.type.bbd080.1 = class_decl @D.1 [concrete = constants.%D.generic.4e2319.1] { +// CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {} +// CHECK:STDOUT: %D.decl.loc6: %D.type.bbd080.1 = class_decl @D.1 [concrete = constants.%D.generic.4e2319.1] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T.8b3)] +// CHECK:STDOUT: %T.loc6_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T.8b3)] // CHECK:STDOUT: } -// CHECK:STDOUT: %D.decl.loc12: %D.type.bbd080.2 = class_decl @D.2 [concrete = constants.%D.generic.4e2319.2] { -// CHECK:STDOUT: %T.patt: %pattern_type.7ce = symbolic_binding_pattern T, 0 [concrete] +// CHECK:STDOUT: %D.decl.loc14: %D.type.bbd080.2 = class_decl @D.2 [concrete = constants.%D.generic.4e2319.2] { +// CHECK:STDOUT: %T.patt: %pattern_type.c10 = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc12: type = splice_block %i32 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc12_9.1: %i32 = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T.51e)] +// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A] +// CHECK:STDOUT: %T.loc14_9.1: %A = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T.9e6)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @D.1(%T.loc4_9.1: type) { -// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T.8b3)] +// CHECK:STDOUT: class @A { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%A +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @D.1(%T.loc6_9.1: type) { +// CHECK:STDOUT: %T.loc6_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T.8b3)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @D.2(%T.loc12_9.1: %i32) { -// CHECK:STDOUT: %T.loc12_9.2: %i32 = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T.51e)] +// CHECK:STDOUT: generic class @D.2(%T.loc14_9.1: %A) { +// CHECK:STDOUT: %T.loc14_9.2: %A = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T.9e6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%D.022 +// CHECK:STDOUT: .Self = constants.%D.384 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D.1(constants.%T.8b3) { -// CHECK:STDOUT: %T.loc4_9.2 => constants.%T.8b3 +// CHECK:STDOUT: %T.loc6_9.2 => constants.%T.8b3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @D.2(constants.%T.51e) { -// CHECK:STDOUT: %T.loc12_9.2 => constants.%T.51e +// CHECK:STDOUT: specific @D.2(constants.%T.9e6) { +// CHECK:STDOUT: %T.loc14_9.2 => constants.%T.9e6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_mismatch_param_name.carbon diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index 9cc1b4403472..a1700d162148 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -14,19 +14,18 @@ class Class; class Class { - fn F[self: Self](b: bool); + fn F[self: Self](b: ()); } -fn Class.F[self: Self](b: bool) {} +fn Class.F[self: Self](b: ()) {} // CHECK:STDOUT: --- redeclaration.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [concrete] // CHECK:STDOUT: %pattern_type.761: type = pattern_type %Class [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %pattern_type.cb1: 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: %empty_struct_type: type = struct_type {} [concrete] @@ -35,11 +34,9 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Bool = %Core.Bool // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -53,19 +50,18 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %self.patt: %pattern_type.761 = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.761 = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %b.patt: %pattern_type.831 = binding_pattern b [concrete] -// CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern %b.patt, call_param1 [concrete] +// CHECK:STDOUT: %b.patt: %pattern_type.cb1 = binding_pattern b [concrete] +// CHECK:STDOUT: %b.param_patt: %pattern_type.cb1 = value_param_pattern %b.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param.loc20: %Class = value_param call_param0 // CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, constants.%Class [concrete = constants.%Class] // CHECK:STDOUT: %self.loc20: %Class = bind_name self, %self.param.loc20 -// CHECK:STDOUT: %b.param.loc20: bool = value_param call_param1 -// CHECK:STDOUT: %.loc20_27.1: type = splice_block %.loc20_27.3 [concrete = bool] { -// CHECK:STDOUT: %bool.make_type.loc20: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc20_27.2: type = value_of_initializer %bool.make_type.loc20 [concrete = bool] -// CHECK:STDOUT: %.loc20_27.3: type = converted %bool.make_type.loc20, %.loc20_27.2 [concrete = bool] +// CHECK:STDOUT: %b.param.loc20: %empty_tuple.type = value_param call_param1 +// CHECK:STDOUT: %.loc20_28.1: type = splice_block %.loc20_28.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc20_28.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc20_28.3: type = converted %.loc20_28.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %b.loc20: bool = bind_name b, %b.param.loc20 +// CHECK:STDOUT: %b.loc20: %empty_tuple.type = bind_name b, %b.param.loc20 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -73,19 +69,18 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %self.patt: %pattern_type.761 = binding_pattern self [concrete] // CHECK:STDOUT: %self.param_patt: %pattern_type.761 = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %b.patt: %pattern_type.831 = binding_pattern b [concrete] -// CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern %b.patt, call_param1 [concrete] +// CHECK:STDOUT: %b.patt: %pattern_type.cb1 = binding_pattern b [concrete] +// CHECK:STDOUT: %b.param_patt: %pattern_type.cb1 = value_param_pattern %b.patt, call_param1 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param.loc17: %Class = value_param call_param0 // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [concrete = constants.%Class] // CHECK:STDOUT: %self.loc17: %Class = bind_name self, %self.param.loc17 -// CHECK:STDOUT: %b.param.loc17: bool = value_param call_param1 -// CHECK:STDOUT: %.loc17_23.1: type = splice_block %.loc17_23.3 [concrete = bool] { -// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [concrete = bool] -// CHECK:STDOUT: %.loc17_23.2: type = value_of_initializer %bool.make_type.loc17 [concrete = bool] -// CHECK:STDOUT: %.loc17_23.3: type = converted %bool.make_type.loc17, %.loc17_23.2 [concrete = bool] +// CHECK:STDOUT: %b.param.loc17: %empty_tuple.type = value_param call_param1 +// CHECK:STDOUT: %.loc17_24.1: type = splice_block %.loc17_24.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc17_24.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc17_24.3: type = converted %.loc17_24.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %b.loc17: bool = bind_name b, %b.param.loc17 +// CHECK:STDOUT: %b.loc17: %empty_tuple.type = bind_name b, %b.param.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] @@ -96,7 +91,7 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%self.param.loc20: %Class, %b.param.loc20: bool) { +// CHECK:STDOUT: fn @F(%self.param.loc20: %Class, %b.param.loc20: %empty_tuple.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 996b65810ace..3836be665dbb 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -212,31 +212,6 @@ fn F() { CC(DD(EE)) as Z; } -// --- deduce_nested_facet_value.carbon -library "[[@TEST_NAME]]"; - -interface Y {} -interface W {} - -// DD implements both Y and W. -class DD {} -impl DD as Y {} -impl DD as W {} - -// CC requires D to implement Y. -class CC(D:! Y) {} - -interface Z {} - -// The `D` interface provides `Y` but not `W`, so we need to see that the -// parameter to `CC` is `DD` which provides `Y & W`, not just a FacetValue -// abstractly providing `Y. -impl forall [E:! Y & W] CC(E) as Z {} - -fn F() { - (CC(DD)) as Z; -} - // CHECK:STDOUT: --- deduce_explicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1808,241 +1783,3 @@ fn F() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- deduce_nested_facet_value.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete] -// CHECK:STDOUT: %Self.b29: %Y.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %W.type: type = facet_type <@W> [concrete] -// CHECK:STDOUT: %Self.f12: %W.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %DD: type = class_type @DD [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table [concrete] -// CHECK:STDOUT: %W.impl_witness: = impl_witness file.%W.impl_witness_table [concrete] -// CHECK:STDOUT: %D: %Y.type = bind_symbolic_name D, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.667: type = pattern_type %Y.type [concrete] -// CHECK:STDOUT: %CC.type: type = generic_class_type @CC [concrete] -// CHECK:STDOUT: %CC.generic: %CC.type = struct_value () [concrete] -// CHECK:STDOUT: %CC.3ba: type = class_type @CC, @CC(%D) [symbolic] -// CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete] -// CHECK:STDOUT: %Self.6e6: %Z.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] -// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] -// CHECK:STDOUT: %BitAndWith.type.e8c: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] -// CHECK:STDOUT: %Op.type.9a3: type = fn_type @Op.1, @BitAndWith(type) [concrete] -// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] -// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.e8c = facet_value type, (%BitAndWith.impl_witness) [concrete] -// CHECK:STDOUT: %.da0: type = fn_type_with_self_type %Op.type.9a3, %BitAndWith.facet [concrete] -// CHECK:STDOUT: %Op.type.c6f: type = fn_type @Op.6 [concrete] -// CHECK:STDOUT: %Op.a92: %Op.type.c6f = struct_value () [concrete] -// CHECK:STDOUT: %Op.bound: = bound_method %Y.type, %Op.a92 [concrete] -// CHECK:STDOUT: %facet_type: type = facet_type <@Y & @W> [concrete] -// CHECK:STDOUT: %E: %facet_type = bind_symbolic_name E, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.122: type = pattern_type %facet_type [concrete] -// CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %E, @Y [symbolic] -// CHECK:STDOUT: %E.as_type: type = facet_access_type %E [symbolic] -// CHECK:STDOUT: %Y.facet.7ec: %Y.type = facet_value %E.as_type, (%Y.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %CC.d02: type = class_type @CC, @CC(%Y.facet.7ec) [symbolic] -// CHECK:STDOUT: %Z.impl_witness.741: = impl_witness file.%Z.impl_witness_table, @impl.562(%E) [symbolic] -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %Y.facet.268: %Y.type = facet_value %DD, (%Y.impl_witness) [concrete] -// CHECK:STDOUT: %CC.7bf: type = class_type @CC, @CC(%Y.facet.268) [concrete] -// CHECK:STDOUT: %facet_value: %facet_type = facet_value %DD, (%Y.impl_witness, %W.impl_witness) [concrete] -// CHECK:STDOUT: %Z.impl_witness.3b0: = impl_witness file.%Z.impl_witness_table, @impl.562(%facet_value) [concrete] -// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %CC.7bf, (%Z.impl_witness.3b0) [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude/operators/bitwise, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] -// CHECK:STDOUT: %Core.import_ref.ad2 = import_ref Core//prelude/operators/bitwise, loc113_52, unloaded -// CHECK:STDOUT: %Core.import_ref.0f9: %Op.type.c6f = import_ref Core//prelude/operators/bitwise, loc114_42, loaded [concrete = constants.%Op.a92] -// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.ad2, %Core.import_ref.0f9), @impl.ee8 [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Y = %Y.decl -// CHECK:STDOUT: .W = %W.decl -// CHECK:STDOUT: .DD = %DD.decl -// CHECK:STDOUT: .CC = %CC.decl -// CHECK:STDOUT: .Z = %Z.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Y.decl: type = interface_decl @Y [concrete = constants.%Y.type] {} {} -// CHECK:STDOUT: %W.decl: type = interface_decl @W [concrete = constants.%W.type] {} {} -// CHECK:STDOUT: %DD.decl: type = class_decl @DD [concrete = constants.%DD] {} {} -// CHECK:STDOUT: impl_decl @impl.3d7 [concrete] {} { -// CHECK:STDOUT: %DD.ref: type = name_ref DD, file.%DD.decl [concrete = constants.%DD] -// CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @impl.3d7 [concrete] -// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] -// CHECK:STDOUT: impl_decl @impl.e11 [concrete] {} { -// CHECK:STDOUT: %DD.ref: type = name_ref DD, file.%DD.decl [concrete = constants.%DD] -// CHECK:STDOUT: %W.ref: type = name_ref W, file.%W.decl [concrete = constants.%W.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %W.impl_witness_table = impl_witness_table (), @impl.e11 [concrete] -// CHECK:STDOUT: %W.impl_witness: = impl_witness %W.impl_witness_table [concrete = constants.%W.impl_witness] -// CHECK:STDOUT: %CC.decl: %CC.type = class_decl @CC [concrete = constants.%CC.generic] { -// CHECK:STDOUT: %D.patt: %pattern_type.667 = symbolic_binding_pattern D, 0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type] -// CHECK:STDOUT: %D.loc12_10.1: %Y.type = bind_symbolic_name D, 0 [symbolic = %D.loc12_10.2 (constants.%D)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {} -// CHECK:STDOUT: impl_decl @impl.562 [concrete] { -// CHECK:STDOUT: %E.patt: %pattern_type.122 = symbolic_binding_pattern E, 0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic] -// CHECK:STDOUT: %E.ref: %facet_type = name_ref E, %E.loc19_14.1 [symbolic = %E.loc19_14.2 (constants.%E)] -// CHECK:STDOUT: %E.as_type.loc19_29.1: type = facet_access_type constants.%E [symbolic = %E.as_type.loc19_29.2 (constants.%E.as_type)] -// CHECK:STDOUT: %Y.facet.loc19_29.1: %Y.type = facet_value %E.as_type.loc19_29.1, (constants.%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.7ec)] -// CHECK:STDOUT: %.loc19_29: %Y.type = converted %E.ref, %Y.facet.loc19_29.1 [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.7ec)] -// CHECK:STDOUT: %CC.loc19_29.1: type = class_type @CC, @CC(constants.%Y.facet.7ec) [symbolic = %CC.loc19_29.2 (constants.%CC.d02)] -// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] -// CHECK:STDOUT: %.loc19_20.1: type = splice_block %.loc19_20.3 [concrete = constants.%facet_type] { -// CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type] -// CHECK:STDOUT: %W.ref: type = name_ref W, file.%W.decl [concrete = constants.%W.type] -// CHECK:STDOUT: %impl.elem1: %.da0 = impl_witness_access constants.%BitAndWith.impl_witness, element1 [concrete = constants.%Op.a92] -// CHECK:STDOUT: %bound_method: = bound_method %Y.ref, %impl.elem1 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %type.and: init type = call %bound_method(%Y.ref, %W.ref) [concrete = constants.%facet_type] -// CHECK:STDOUT: %.loc19_20.2: type = value_of_initializer %type.and [concrete = constants.%facet_type] -// CHECK:STDOUT: %.loc19_20.3: type = converted %type.and, %.loc19_20.2 [concrete = constants.%facet_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %E.loc19_14.1: %facet_type = bind_symbolic_name E, 0 [symbolic = %E.loc19_14.2 (constants.%E)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @impl.562 [concrete] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table, @impl.562(constants.%E) [symbolic = @impl.562.%Z.impl_witness (constants.%Z.impl_witness.741)] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @Y { -// CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.b29] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: witness = () -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @W { -// CHECK:STDOUT: %Self: %W.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.f12] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: witness = () -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @Z { -// CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.6e6] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: witness = () -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3d7: %DD.ref as %Y.ref { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Y.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.e11: %DD.ref as %W.ref { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%W.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.562(%E.loc19_14.1: %facet_type) { -// CHECK:STDOUT: %E.loc19_14.2: %facet_type = bind_symbolic_name E, 0 [symbolic = %E.loc19_14.2 (constants.%E)] -// CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %E.loc19_14.2, @Y [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness)] -// CHECK:STDOUT: %E.as_type.loc19_29.2: type = facet_access_type %E.loc19_14.2 [symbolic = %E.as_type.loc19_29.2 (constants.%E.as_type)] -// CHECK:STDOUT: %Y.facet.loc19_29.2: %Y.type = facet_value %E.as_type.loc19_29.2, (%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.7ec)] -// CHECK:STDOUT: %CC.loc19_29.2: type = class_type @CC, @CC(%Y.facet.loc19_29.2) [symbolic = %CC.loc19_29.2 (constants.%CC.d02)] -// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table, @impl.562(%E.loc19_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.741)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %CC.loc19_29.1 as %Z.ref { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%Z.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @DD { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%DD -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @CC(%D.loc12_10.1: %Y.type) { -// CHECK:STDOUT: %D.loc12_10.2: %Y.type = bind_symbolic_name D, 0 [symbolic = %D.loc12_10.2 (constants.%D)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: class { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%CC.3ba -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic] -// CHECK:STDOUT: %DD.ref: type = name_ref DD, file.%DD.decl [concrete = constants.%DD] -// CHECK:STDOUT: %Y.facet: %Y.type = facet_value constants.%DD, (constants.%Y.impl_witness) [concrete = constants.%Y.facet.268] -// CHECK:STDOUT: %.loc22_9: %Y.type = converted %DD.ref, %Y.facet [concrete = constants.%Y.facet.268] -// CHECK:STDOUT: %CC: type = class_type @CC, @CC(constants.%Y.facet.268) [concrete = constants.%CC.7bf] -// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] -// CHECK:STDOUT: %facet_value: %facet_type = facet_value constants.%DD, (constants.%Y.impl_witness, constants.%W.impl_witness) [concrete = constants.%facet_value] -// CHECK:STDOUT: %.loc22_12.1: %facet_type = converted constants.%DD, %facet_value [concrete = constants.%facet_value] -// CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%CC.7bf, (constants.%Z.impl_witness.3b0) [concrete = constants.%Z.facet] -// CHECK:STDOUT: %.loc22_12.2: %Z.type = converted %CC, %Z.facet [concrete = constants.%Z.facet] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @CC(constants.%D) { -// CHECK:STDOUT: %D.loc12_10.2 => constants.%D -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @CC(constants.%Y.facet.7ec) { -// CHECK:STDOUT: %D.loc12_10.2 => constants.%Y.facet.7ec -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.562(constants.%E) { -// CHECK:STDOUT: %E.loc19_14.2 => constants.%E -// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness -// CHECK:STDOUT: %E.as_type.loc19_29.2 => constants.%E.as_type -// CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.7ec -// CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.d02 -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.741 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @CC(constants.%Y.facet.268) { -// CHECK:STDOUT: %D.loc12_10.2 => constants.%Y.facet.268 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.562(constants.%facet_value) { -// CHECK:STDOUT: %E.loc19_14.2 => constants.%facet_value -// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.impl_witness -// CHECK:STDOUT: %E.as_type.loc19_29.2 => constants.%DD -// CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.268 -// CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.7bf -// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.3b0 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon b/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon new file mode 100644 index 000000000000..a9228cae8411 --- /dev/null +++ b/toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon @@ -0,0 +1,276 @@ +// 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/facet_types.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/generic/deduce_nested_facet_value.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/deduce_nested_facet_value.carbon + +// --- deduce_nested_facet_value.carbon +library "[[@TEST_NAME]]"; + +interface Y {} +interface W {} + +// DD implements both Y and W. +class DD {} +impl DD as Y {} +impl DD as W {} + +// CC requires D to implement Y. +class CC(D:! Y) {} + +interface Z {} + +// The `D` interface provides `Y` but not `W`, so we need to see that the +// parameter to `CC` is `DD` which provides `Y & W`, not just a FacetValue +// abstractly providing `Y. +impl forall [E:! Y & W] CC(E) as Z {} + +fn F() { + (CC(DD)) as Z; +} + +// CHECK:STDOUT: --- deduce_nested_facet_value.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete] +// CHECK:STDOUT: %Self.b29: %Y.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %W.type: type = facet_type <@W> [concrete] +// CHECK:STDOUT: %Self.f12: %W.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %DD: type = class_type @DD [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness file.%Y.impl_witness_table [concrete] +// CHECK:STDOUT: %W.impl_witness: = impl_witness file.%W.impl_witness_table [concrete] +// CHECK:STDOUT: %D: %Y.type = bind_symbolic_name D, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.667: type = pattern_type %Y.type [concrete] +// CHECK:STDOUT: %CC.type: type = generic_class_type @CC [concrete] +// CHECK:STDOUT: %CC.generic: %CC.type = struct_value () [concrete] +// CHECK:STDOUT: %CC.3ba: type = class_type @CC, @CC(%D) [symbolic] +// CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete] +// CHECK:STDOUT: %Self.6e6: %Z.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %BitAndWith.type.f2e: type = generic_interface_type @BitAndWith [concrete] +// CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.f2e = struct_value () [concrete] +// CHECK:STDOUT: %BitAndWith.type.e8c: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] +// CHECK:STDOUT: %Op.type.9a3: type = fn_type @Op.1, @BitAndWith(type) [concrete] +// CHECK:STDOUT: %BitAndWith.impl_witness: = impl_witness imports.%BitAndWith.impl_witness_table [concrete] +// CHECK:STDOUT: %BitAndWith.facet: %BitAndWith.type.e8c = facet_value type, (%BitAndWith.impl_witness) [concrete] +// CHECK:STDOUT: %.2af: type = fn_type_with_self_type %Op.type.9a3, %BitAndWith.facet [concrete] +// CHECK:STDOUT: %Op.type.1cc: type = fn_type @Op.2 [concrete] +// CHECK:STDOUT: %Op.ff4: %Op.type.1cc = struct_value () [concrete] +// CHECK:STDOUT: %Op.bound: = bound_method %Y.type, %Op.ff4 [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Y & @W> [concrete] +// CHECK:STDOUT: %E: %facet_type = bind_symbolic_name E, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.122: type = pattern_type %facet_type [concrete] +// CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %E, @Y [symbolic] +// CHECK:STDOUT: %E.as_type: type = facet_access_type %E [symbolic] +// CHECK:STDOUT: %Y.facet.7ec: %Y.type = facet_value %E.as_type, (%Y.lookup_impl_witness) [symbolic] +// CHECK:STDOUT: %CC.d02: type = class_type @CC, @CC(%Y.facet.7ec) [symbolic] +// CHECK:STDOUT: %Z.impl_witness.741: = impl_witness file.%Z.impl_witness_table, @impl.562(%E) [symbolic] +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %Y.facet.268: %Y.type = facet_value %DD, (%Y.impl_witness) [concrete] +// CHECK:STDOUT: %CC.7bf: type = class_type @CC, @CC(%Y.facet.268) [concrete] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %DD, (%Y.impl_witness, %W.impl_witness) [concrete] +// CHECK:STDOUT: %Z.impl_witness.3b0: = impl_witness file.%Z.impl_witness_table, @impl.562(%facet_value) [concrete] +// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %CC.7bf, (%Z.impl_witness.3b0) [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .BitAndWith = %Core.BitAndWith +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.BitAndWith: %BitAndWith.type.f2e = import_ref Core//prelude, BitAndWith, loaded [concrete = constants.%BitAndWith.generic] +// CHECK:STDOUT: %Core.import_ref.012: %Op.type.1cc = import_ref Core//prelude, loc13_42, loaded [concrete = constants.%Op.ff4] +// CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.012), @impl.865 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Y = %Y.decl +// CHECK:STDOUT: .W = %W.decl +// CHECK:STDOUT: .DD = %DD.decl +// CHECK:STDOUT: .CC = %CC.decl +// CHECK:STDOUT: .Z = %Z.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Y.decl: type = interface_decl @Y [concrete = constants.%Y.type] {} {} +// CHECK:STDOUT: %W.decl: type = interface_decl @W [concrete = constants.%W.type] {} {} +// CHECK:STDOUT: %DD.decl: type = class_decl @DD [concrete = constants.%DD] {} {} +// CHECK:STDOUT: impl_decl @impl.3d7 [concrete] {} { +// CHECK:STDOUT: %DD.ref: type = name_ref DD, file.%DD.decl [concrete = constants.%DD] +// CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Y.impl_witness_table = impl_witness_table (), @impl.3d7 [concrete] +// CHECK:STDOUT: %Y.impl_witness: = impl_witness %Y.impl_witness_table [concrete = constants.%Y.impl_witness] +// CHECK:STDOUT: impl_decl @impl.e11 [concrete] {} { +// CHECK:STDOUT: %DD.ref: type = name_ref DD, file.%DD.decl [concrete = constants.%DD] +// CHECK:STDOUT: %W.ref: type = name_ref W, file.%W.decl [concrete = constants.%W.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %W.impl_witness_table = impl_witness_table (), @impl.e11 [concrete] +// CHECK:STDOUT: %W.impl_witness: = impl_witness %W.impl_witness_table [concrete = constants.%W.impl_witness] +// CHECK:STDOUT: %CC.decl: %CC.type = class_decl @CC [concrete = constants.%CC.generic] { +// CHECK:STDOUT: %D.patt: %pattern_type.667 = symbolic_binding_pattern D, 0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type] +// CHECK:STDOUT: %D.loc12_10.1: %Y.type = bind_symbolic_name D, 0 [symbolic = %D.loc12_10.2 (constants.%D)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {} +// CHECK:STDOUT: impl_decl @impl.562 [concrete] { +// CHECK:STDOUT: %E.patt: %pattern_type.122 = symbolic_binding_pattern E, 0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic] +// CHECK:STDOUT: %E.ref: %facet_type = name_ref E, %E.loc19_14.1 [symbolic = %E.loc19_14.2 (constants.%E)] +// CHECK:STDOUT: %E.as_type.loc19_29.1: type = facet_access_type constants.%E [symbolic = %E.as_type.loc19_29.2 (constants.%E.as_type)] +// CHECK:STDOUT: %Y.facet.loc19_29.1: %Y.type = facet_value %E.as_type.loc19_29.1, (constants.%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.7ec)] +// CHECK:STDOUT: %.loc19_29: %Y.type = converted %E.ref, %Y.facet.loc19_29.1 [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.7ec)] +// CHECK:STDOUT: %CC.loc19_29.1: type = class_type @CC, @CC(constants.%Y.facet.7ec) [symbolic = %CC.loc19_29.2 (constants.%CC.d02)] +// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] +// CHECK:STDOUT: %.loc19_20.1: type = splice_block %.loc19_20.3 [concrete = constants.%facet_type] { +// CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y.type] +// CHECK:STDOUT: %W.ref: type = name_ref W, file.%W.decl [concrete = constants.%W.type] +// CHECK:STDOUT: %impl.elem0: %.2af = impl_witness_access constants.%BitAndWith.impl_witness, element0 [concrete = constants.%Op.ff4] +// CHECK:STDOUT: %bound_method: = bound_method %Y.ref, %impl.elem0 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %type.and: init type = call %bound_method(%Y.ref, %W.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc19_20.2: type = value_of_initializer %type.and [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc19_20.3: type = converted %type.and, %.loc19_20.2 [concrete = constants.%facet_type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %E.loc19_14.1: %facet_type = bind_symbolic_name E, 0 [symbolic = %E.loc19_14.2 (constants.%E)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @impl.562 [concrete] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness %Z.impl_witness_table, @impl.562(constants.%E) [symbolic = @impl.562.%Z.impl_witness (constants.%Z.impl_witness.741)] +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @Y { +// CHECK:STDOUT: %Self: %Y.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.b29] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @W { +// CHECK:STDOUT: %Self: %W.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.f12] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @Z { +// CHECK:STDOUT: %Self: %Z.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.6e6] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: witness = () +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.3d7: %DD.ref as %Y.ref { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%Y.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.e11: %DD.ref as %W.ref { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%W.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic impl @impl.562(%E.loc19_14.1: %facet_type) { +// CHECK:STDOUT: %E.loc19_14.2: %facet_type = bind_symbolic_name E, 0 [symbolic = %E.loc19_14.2 (constants.%E)] +// CHECK:STDOUT: %Y.lookup_impl_witness: = lookup_impl_witness %E.loc19_14.2, @Y [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness)] +// CHECK:STDOUT: %E.as_type.loc19_29.2: type = facet_access_type %E.loc19_14.2 [symbolic = %E.as_type.loc19_29.2 (constants.%E.as_type)] +// CHECK:STDOUT: %Y.facet.loc19_29.2: %Y.type = facet_value %E.as_type.loc19_29.2, (%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.7ec)] +// CHECK:STDOUT: %CC.loc19_29.2: type = class_type @CC, @CC(%Y.facet.loc19_29.2) [symbolic = %CC.loc19_29.2 (constants.%CC.d02)] +// CHECK:STDOUT: %Z.impl_witness: = impl_witness file.%Z.impl_witness_table, @impl.562(%E.loc19_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.741)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: impl: %CC.loc19_29.1 as %Z.ref { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%Z.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @DD { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%DD +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic class @CC(%D.loc12_10.1: %Y.type) { +// CHECK:STDOUT: %D.loc12_10.2: %Y.type = bind_symbolic_name D, 0 [symbolic = %D.loc12_10.2 (constants.%D)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: class { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%CC.3ba +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic] +// CHECK:STDOUT: %DD.ref: type = name_ref DD, file.%DD.decl [concrete = constants.%DD] +// CHECK:STDOUT: %Y.facet: %Y.type = facet_value constants.%DD, (constants.%Y.impl_witness) [concrete = constants.%Y.facet.268] +// CHECK:STDOUT: %.loc22_9: %Y.type = converted %DD.ref, %Y.facet [concrete = constants.%Y.facet.268] +// CHECK:STDOUT: %CC: type = class_type @CC, @CC(constants.%Y.facet.268) [concrete = constants.%CC.7bf] +// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value constants.%DD, (constants.%Y.impl_witness, constants.%W.impl_witness) [concrete = constants.%facet_value] +// CHECK:STDOUT: %.loc22_12.1: %facet_type = converted constants.%DD, %facet_value [concrete = constants.%facet_value] +// CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%CC.7bf, (constants.%Z.impl_witness.3b0) [concrete = constants.%Z.facet] +// CHECK:STDOUT: %.loc22_12.2: %Z.type = converted %CC, %Z.facet [concrete = constants.%Z.facet] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @CC(constants.%D) { +// CHECK:STDOUT: %D.loc12_10.2 => constants.%D +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @CC(constants.%Y.facet.7ec) { +// CHECK:STDOUT: %D.loc12_10.2 => constants.%Y.facet.7ec +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.562(constants.%E) { +// CHECK:STDOUT: %E.loc19_14.2 => constants.%E +// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness +// CHECK:STDOUT: %E.as_type.loc19_29.2 => constants.%E.as_type +// CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.7ec +// CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.d02 +// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.741 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @CC(constants.%Y.facet.268) { +// CHECK:STDOUT: %D.loc12_10.2 => constants.%Y.facet.268 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl.562(constants.%facet_value) { +// CHECK:STDOUT: %E.loc19_14.2 => constants.%facet_value +// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.impl_witness +// CHECK:STDOUT: %E.as_type.loc19_29.2 => constants.%DD +// CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.268 +// CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.7bf +// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.3b0 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/use_assoc_const.carbon b/toolchain/check/testdata/impl/use_assoc_const.carbon index 0b1ec8c3e787..7eabd3ca77ee 100644 --- a/toolchain/check/testdata/impl/use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/use_assoc_const.carbon @@ -20,7 +20,7 @@ interface J { } impl () as J where .U = i32 { - fn F[self: Self](u: i32) -> i32 { return u + 2; } + fn F[self: Self](u: i32) -> i32 { return -u; } } fn CallMethod(x: ()) -> i32 { @@ -47,7 +47,7 @@ interface J { class D { } impl D as J where .U = i32 { - fn F(u: i32) -> i32 { return u + 3; } + fn F(u: i32) -> i32 { return -u; } } fn CallFunction() -> i32 { @@ -66,16 +66,20 @@ interface J { class E { extend impl as J where .U = i32 { fn F(u: i32) -> i32 { - return u + 1; + return -u; } fn G[self: Self](v: i32) -> i32 { - return v + 2; + return -v; } } } -fn CallBoth(e: E) -> i32 { - return e.F(2) + e.G(3) + E.F(4) + e.(E.G)(5) + e.(J.G)(6); +fn CallBoth(e: E) { + let e1: i32 = e.F(2); + let e2: i32 = e.G(3); + let e3: i32 = E.F(4); + let e4: i32 = e.(E.G)(5); + let e5: i32 = e.(J.G)(6); } fn GenericCallF[T:! J](t: T, u: T.U) -> T.U { @@ -151,7 +155,7 @@ class E { // CHECK:STDERR: ^ // CHECK:STDERR: fn F(u: U) -> U { - return u + 1; + return u; } } } @@ -306,7 +310,6 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %Int.49d0e6.1: type = class_type @Int, @Int(%N) [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %J_where.type.b64: type = facet_type <@J where %impl.elem0.83f = %i32> [concrete] // CHECK:STDOUT: %J.impl_witness.e42: = impl_witness file.%J.impl_witness_table.loc8 [concrete] @@ -315,48 +318,35 @@ fn F() { // CHECK:STDOUT: %F.type.7d4: type = fn_type @F.2 [concrete] // CHECK:STDOUT: %F.46e: %F.type.7d4 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.ecc: %J.type = facet_value %empty_tuple.type, (%J.impl_witness.e42) [concrete] -// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] -// CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete] -// CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete] -// CHECK:STDOUT: %AddWith.type.d7d: type = facet_type <@AddWith, @AddWith(Core.IntLiteral)> [concrete] -// CHECK:STDOUT: %Op.type.0ee: type = fn_type @Op.1, @AddWith(Core.IntLiteral) [concrete] +// CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete] +// CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.1 [concrete] // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.080b83.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Int.49d0e6.1)> [symbolic] -// CHECK:STDOUT: %U: %ImplicitAs.type.080b83.2 = bind_symbolic_name U, 1 [symbolic] -// CHECK:STDOUT: %Op.type.c98676.1: type = fn_type @Op.12, @impl.b98(%N, %U) [symbolic] -// CHECK:STDOUT: %Op.aee6d7.1: %Op.type.c98676.1 = struct_value () [symbolic] -// CHECK:STDOUT: %Op.type.c98676.2: type = fn_type @Op.13, @impl.b98(%N, %U) [symbolic] -// CHECK:STDOUT: %Op.aee6d7.2: %Op.type.c98676.2 = struct_value () [symbolic] +// CHECK:STDOUT: %Op.type.fc5: type = fn_type @Op.11, @impl.47e(%N) [symbolic] +// CHECK:STDOUT: %Op.8d0: %Op.type.fc5 = struct_value () [symbolic] +// CHECK:STDOUT: %Negate.impl_witness.943: = impl_witness imports.%Negate.impl_witness_table, @impl.47e(%int_32) [concrete] +// CHECK:STDOUT: %Op.type.66f: type = fn_type @Op.11, @impl.47e(%int_32) [concrete] +// CHECK:STDOUT: %Op.5c0: %Op.type.66f = struct_value () [concrete] +// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.943) [concrete] +// CHECK:STDOUT: %.6f0: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [concrete] +// CHECK:STDOUT: %Op.specific_fn.f32: = specific_function %Op.5c0, @Op.11(%int_32) [concrete] +// CHECK:STDOUT: %CallMethod.type: type = fn_type @CallMethod [concrete] +// CHECK:STDOUT: %CallMethod: %CallMethod.type = struct_value () [concrete] +// CHECK:STDOUT: %.597: type = fn_type_with_self_type %F.type.c14, %J.facet.ecc [concrete] +// CHECK:STDOUT: %int_40.f80: Core.IntLiteral = int_value 40 [concrete] // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] -// CHECK:STDOUT: %AddWith.impl_witness.5e4: = impl_witness imports.%AddWith.impl_witness_table.61f, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.type.0437e0.1: type = fn_type @Op.12, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.a9544c.1: %Op.type.0437e0.1 = struct_value () [concrete] -// CHECK:STDOUT: %Op.type.0437e0.2: type = fn_type @Op.13, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.a9544c.2: %Op.type.0437e0.2 = struct_value () [concrete] -// CHECK:STDOUT: %AddWith.facet: %AddWith.type.d7d = facet_value %i32, (%AddWith.impl_witness.5e4) [concrete] -// CHECK:STDOUT: %.b70: type = fn_type_with_self_type %Op.type.0ee, %AddWith.facet [concrete] -// CHECK:STDOUT: %Op.specific_fn.418e74.1: = specific_function %Op.a9544c.2, @Op.13(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.specific_fn.418e74.2: = specific_function %Op.a9544c.1, @Op.12(%int_32, %ImplicitAs.facet.921) [concrete] // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete] -// CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_40.f80, %Convert.956 [concrete] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] -// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] -// CHECK:STDOUT: %CallMethod.type: type = fn_type @CallMethod [concrete] -// CHECK:STDOUT: %CallMethod: %CallMethod.type = struct_value () [concrete] -// CHECK:STDOUT: %.597: type = fn_type_with_self_type %F.type.c14, %J.facet.ecc [concrete] -// CHECK:STDOUT: %int_40.f80: Core.IntLiteral = int_value 40 [concrete] -// CHECK:STDOUT: %Convert.bound.e52: = bound_method %int_40.f80, %Convert.956 [concrete] -// CHECK:STDOUT: %bound_method.7b8: = bound_method %int_40.f80, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_40.f80, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_40.518: %i32 = int_value 40 [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -372,19 +362,18 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int -// CHECK:STDOUT: .AddWith = %Core.AddWith +// CHECK:STDOUT: .Negate = %Core.Negate // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//prelude/operators/arithmetic, AddWith, loaded [concrete = constants.%AddWith.generic] +// CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] -// CHECK:STDOUT: %Core.import_ref.5f5145.7 = import_ref Core//prelude/types/int, loc124_49, unloaded -// CHECK:STDOUT: %Core.import_ref.34c: @impl.b98.%Op.type.2 (%Op.type.c98676.2) = import_ref Core//prelude/types/int, loc125_48, loaded [symbolic = @impl.b98.%Op.2 (constants.%Op.aee6d7.2)] -// CHECK:STDOUT: %AddWith.impl_witness_table.61f = impl_witness_table (%Core.import_ref.5f5145.7, %Core.import_ref.34c), @impl.b98 [concrete] -// CHECK:STDOUT: %Core.Op.574: @impl.b98.%Op.type.1 (%Op.type.c98676.1) = import_ref Core//prelude/types/int, Op, loaded [symbolic = @impl.b98.%Op.1 (constants.%Op.aee6d7.1)] +// CHECK:STDOUT: %Core.import_ref.5f5145.5 = import_ref Core//prelude/types/int, loc112_43, unloaded +// CHECK:STDOUT: %Core.import_ref.ff2: @impl.47e.%Op.type (%Op.type.fc5) = import_ref Core//prelude/types/int, loc113_31, loaded [symbolic = @impl.47e.%Op (constants.%Op.8d0)] +// CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.5f5145.5, %Core.import_ref.ff2), @impl.47e [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -577,29 +566,14 @@ fn F() { // CHECK:STDOUT: fn @F.2(%self.param: %empty_tuple.type, %u.param: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.c75) [concrete = constants.%ImplicitAs.facet.921] -// CHECK:STDOUT: %.loc9_46.1: %ImplicitAs.type.205 = converted Core.IntLiteral, %ImplicitAs.facet [concrete = constants.%ImplicitAs.facet.921] -// CHECK:STDOUT: %impl.elem1: %.b70 = impl_witness_access constants.%AddWith.impl_witness.5e4, element1 [concrete = constants.%Op.a9544c.2] -// CHECK:STDOUT: %bound_method.loc9_46.1: = bound_method %u.ref, %impl.elem1 -// CHECK:STDOUT: %specific_fn.loc9_46: = specific_function %impl.elem1, @Op.13(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.1] -// CHECK:STDOUT: %bound_method.loc9_46.2: = bound_method %u.ref, %specific_fn.loc9_46 -// CHECK:STDOUT: %.loc9_46.2: %Op.type.0437e0.1 = specific_constant imports.%Core.Op.574, @impl.b98(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.a9544c.1] -// CHECK:STDOUT: %Op.ref: %Op.type.0437e0.1 = name_ref Op, %.loc9_46.2 [concrete = constants.%Op.a9544c.1] -// CHECK:STDOUT: %Op.bound: = bound_method %u.ref, %Op.ref -// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.ref, @Op.12(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.2] -// CHECK:STDOUT: %bound_method.loc9_46.3: = bound_method %u.ref, %Op.specific_fn -// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc9_48.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc9_48: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_48.2: = bound_method %int_2, %specific_fn.loc9_48 [concrete = constants.%bound_method.b92] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc9_48.2(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc9_48.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc9_48.2: %i32 = converted %int_2, %.loc9_48.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc9_46.3(%u.ref, %.loc9_48.2) -// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.sadd -// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.sadd, %.loc9_49.1 -// CHECK:STDOUT: return %.loc9_49.2 +// CHECK:STDOUT: %impl.elem1: %.6f0 = impl_witness_access constants.%Negate.impl_witness.943, element1 [concrete = constants.%Op.5c0] +// CHECK:STDOUT: %bound_method.loc9_44.1: = bound_method %u.ref, %impl.elem1 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem1, @Op.11(constants.%int_32) [concrete = constants.%Op.specific_fn.f32] +// CHECK:STDOUT: %bound_method.loc9_44.2: = bound_method %u.ref, %specific_fn +// CHECK:STDOUT: %int.snegate: init %i32 = call %bound_method.loc9_44.2(%u.ref) +// CHECK:STDOUT: %.loc9_46.1: %i32 = value_of_initializer %int.snegate +// CHECK:STDOUT: %.loc9_46.2: %i32 = converted %int.snegate, %.loc9_46.1 +// CHECK:STDOUT: return %.loc9_46.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallMethod(%x.param: %empty_tuple.type) -> %i32 { @@ -611,9 +585,9 @@ fn F() { // CHECK:STDOUT: %bound_method.loc13_11: = bound_method %x.ref, %impl.elem1 // CHECK:STDOUT: %int_40: Core.IntLiteral = int_value 40 [concrete = constants.%int_40.f80] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc13_18.1: = bound_method %int_40, %impl.elem0 [concrete = constants.%Convert.bound.e52] +// CHECK:STDOUT: %bound_method.loc13_18.1: = bound_method %int_40, %impl.elem0 [concrete = constants.%Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc13_18.2: = bound_method %int_40, %specific_fn [concrete = constants.%bound_method.7b8] +// CHECK:STDOUT: %bound_method.loc13_18.2: = bound_method %int_40, %specific_fn [concrete = constants.%bound_method] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc13_18.2(%int_40) [concrete = constants.%int_40.518] // CHECK:STDOUT: %.loc13_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_40.518] // CHECK:STDOUT: %.loc13_18.2: %i32 = converted %int_40, %.loc13_18.1 [concrete = constants.%int_40.518] @@ -689,7 +663,6 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %Int.49d0e6.1: type = class_type @Int, @Int(%N) [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.83f = %i32> [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness file.%J.impl_witness_table [concrete] @@ -697,67 +670,53 @@ fn F() { // CHECK:STDOUT: %F.type.5d3: type = fn_type @F.2 [concrete] // CHECK:STDOUT: %F.b9c: %F.type.5d3 = struct_value () [concrete] // CHECK:STDOUT: %J.facet.183: %J.type = facet_value %D, (%J.impl_witness) [concrete] -// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] -// CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete] -// CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete] -// CHECK:STDOUT: %AddWith.type.d7d: type = facet_type <@AddWith, @AddWith(Core.IntLiteral)> [concrete] -// CHECK:STDOUT: %Op.type.0ee: type = fn_type @Op.1, @AddWith(Core.IntLiteral) [concrete] +// CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete] +// CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.1 [concrete] // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.080b83.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Int.49d0e6.1)> [symbolic] -// CHECK:STDOUT: %U: %ImplicitAs.type.080b83.2 = bind_symbolic_name U, 1 [symbolic] -// CHECK:STDOUT: %Op.type.c98676.1: type = fn_type @Op.12, @impl.b98(%N, %U) [symbolic] -// CHECK:STDOUT: %Op.aee6d7.1: %Op.type.c98676.1 = struct_value () [symbolic] -// CHECK:STDOUT: %Op.type.c98676.2: type = fn_type @Op.13, @impl.b98(%N, %U) [symbolic] -// CHECK:STDOUT: %Op.aee6d7.2: %Op.type.c98676.2 = struct_value () [symbolic] +// CHECK:STDOUT: %Op.type.fc5: type = fn_type @Op.11, @impl.47e(%N) [symbolic] +// CHECK:STDOUT: %Op.8d0: %Op.type.fc5 = struct_value () [symbolic] +// CHECK:STDOUT: %Negate.impl_witness.943: = impl_witness imports.%Negate.impl_witness_table, @impl.47e(%int_32) [concrete] +// CHECK:STDOUT: %Op.type.66f: type = fn_type @Op.11, @impl.47e(%int_32) [concrete] +// CHECK:STDOUT: %Op.5c0: %Op.type.66f = struct_value () [concrete] +// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.943) [concrete] +// CHECK:STDOUT: %.6f0: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [concrete] +// CHECK:STDOUT: %Op.specific_fn.f32: = specific_function %Op.5c0, @Op.11(%int_32) [concrete] +// CHECK:STDOUT: %CallFunction.type: type = fn_type @CallFunction [concrete] +// CHECK:STDOUT: %CallFunction: %CallFunction.type = struct_value () [concrete] +// CHECK:STDOUT: %.490: type = fn_type_with_self_type %F.type.c14, %J.facet.183 [concrete] +// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] -// CHECK:STDOUT: %AddWith.impl_witness.5e4: = impl_witness imports.%AddWith.impl_witness_table.61f, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.type.0437e0.1: type = fn_type @Op.12, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.a9544c.1: %Op.type.0437e0.1 = struct_value () [concrete] -// CHECK:STDOUT: %Op.type.0437e0.2: type = fn_type @Op.13, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.a9544c.2: %Op.type.0437e0.2 = struct_value () [concrete] -// CHECK:STDOUT: %AddWith.facet: %AddWith.type.d7d = facet_value %i32, (%AddWith.impl_witness.5e4) [concrete] -// CHECK:STDOUT: %.b70: type = fn_type_with_self_type %Op.type.0ee, %AddWith.facet [concrete] -// CHECK:STDOUT: %Op.specific_fn.418e74.1: = specific_function %Op.a9544c.2, @Op.13(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.specific_fn.418e74.2: = specific_function %Op.a9544c.1, @Op.12(%int_32, %ImplicitAs.facet.921) [concrete] // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete] -// CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_4.0c1, %Convert.956 [concrete] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] -// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] -// CHECK:STDOUT: %CallFunction.type: type = fn_type @CallFunction [concrete] -// CHECK:STDOUT: %CallFunction: %CallFunction.type = struct_value () [concrete] -// CHECK:STDOUT: %.490: type = fn_type_with_self_type %F.type.c14, %J.facet.183 [concrete] -// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] -// CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int -// CHECK:STDOUT: .AddWith = %Core.AddWith +// CHECK:STDOUT: .Negate = %Core.Negate // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//prelude/operators/arithmetic, AddWith, loaded [concrete = constants.%AddWith.generic] +// CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] -// CHECK:STDOUT: %Core.import_ref.5f5145.7 = import_ref Core//prelude/types/int, loc124_49, unloaded -// CHECK:STDOUT: %Core.import_ref.34c: @impl.b98.%Op.type.2 (%Op.type.c98676.2) = import_ref Core//prelude/types/int, loc125_48, loaded [symbolic = @impl.b98.%Op.2 (constants.%Op.aee6d7.2)] -// CHECK:STDOUT: %AddWith.impl_witness_table.61f = impl_witness_table (%Core.import_ref.5f5145.7, %Core.import_ref.34c), @impl.b98 [concrete] -// CHECK:STDOUT: %Core.Op.574: @impl.b98.%Op.type.1 (%Op.type.c98676.1) = import_ref Core//prelude/types/int, Op, loaded [symbolic = @impl.b98.%Op.1 (constants.%Op.aee6d7.1)] +// CHECK:STDOUT: %Core.import_ref.5f5145.5 = import_ref Core//prelude/types/int, loc112_43, unloaded +// CHECK:STDOUT: %Core.import_ref.ff2: @impl.47e.%Op.type (%Op.type.fc5) = import_ref Core//prelude/types/int, loc113_31, loaded [symbolic = @impl.47e.%Op (constants.%Op.8d0)] +// CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.5f5145.5, %Core.import_ref.ff2), @impl.47e [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -880,29 +839,14 @@ fn F() { // CHECK:STDOUT: fn @F.2(%u.param: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.c75) [concrete = constants.%ImplicitAs.facet.921] -// CHECK:STDOUT: %.loc11_34.1: %ImplicitAs.type.205 = converted Core.IntLiteral, %ImplicitAs.facet [concrete = constants.%ImplicitAs.facet.921] -// CHECK:STDOUT: %impl.elem1: %.b70 = impl_witness_access constants.%AddWith.impl_witness.5e4, element1 [concrete = constants.%Op.a9544c.2] -// CHECK:STDOUT: %bound_method.loc11_34.1: = bound_method %u.ref, %impl.elem1 -// CHECK:STDOUT: %specific_fn.loc11_34: = specific_function %impl.elem1, @Op.13(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.1] -// CHECK:STDOUT: %bound_method.loc11_34.2: = bound_method %u.ref, %specific_fn.loc11_34 -// CHECK:STDOUT: %.loc11_34.2: %Op.type.0437e0.1 = specific_constant imports.%Core.Op.574, @impl.b98(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.a9544c.1] -// CHECK:STDOUT: %Op.ref: %Op.type.0437e0.1 = name_ref Op, %.loc11_34.2 [concrete = constants.%Op.a9544c.1] -// CHECK:STDOUT: %Op.bound: = bound_method %u.ref, %Op.ref -// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.ref, @Op.12(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.2] -// CHECK:STDOUT: %bound_method.loc11_34.3: = bound_method %u.ref, %Op.specific_fn -// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_36.1: = bound_method %int_3, %impl.elem0 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc11_36: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_36.2: = bound_method %int_3, %specific_fn.loc11_36 [concrete = constants.%bound_method.047] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_36.2(%int_3) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc11_36.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc11_36.2: %i32 = converted %int_3, %.loc11_36.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc11_34.3(%u.ref, %.loc11_36.2) -// CHECK:STDOUT: %.loc11_37.1: %i32 = value_of_initializer %int.sadd -// CHECK:STDOUT: %.loc11_37.2: %i32 = converted %int.sadd, %.loc11_37.1 -// CHECK:STDOUT: return %.loc11_37.2 +// CHECK:STDOUT: %impl.elem1: %.6f0 = impl_witness_access constants.%Negate.impl_witness.943, element1 [concrete = constants.%Op.5c0] +// CHECK:STDOUT: %bound_method.loc11_32.1: = bound_method %u.ref, %impl.elem1 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem1, @Op.11(constants.%int_32) [concrete = constants.%Op.specific_fn.f32] +// CHECK:STDOUT: %bound_method.loc11_32.2: = bound_method %u.ref, %specific_fn +// CHECK:STDOUT: %int.snegate: init %i32 = call %bound_method.loc11_32.2(%u.ref) +// CHECK:STDOUT: %.loc11_34.1: %i32 = value_of_initializer %int.snegate +// CHECK:STDOUT: %.loc11_34.2: %i32 = converted %int.snegate, %.loc11_34.1 +// CHECK:STDOUT: return %.loc11_34.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallFunction() -> %i32 { @@ -915,9 +859,9 @@ fn F() { // CHECK:STDOUT: %impl.elem1: %.490 = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%F.b9c] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15_18.1: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %bound_method.loc15_18.1: = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc15_18.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %bound_method.loc15_18.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_18.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_4, %.loc15_18.1 [concrete = constants.%int_4.940] @@ -976,7 +920,6 @@ fn F() { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %Int.49d0e6.1: type = class_type @Int, @Int(%N) [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.83f = %i32> [concrete] // CHECK:STDOUT: %J.impl_witness: = impl_witness @E.%J.impl_witness_table [concrete] @@ -991,64 +934,41 @@ fn F() { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] -// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete] -// CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete] -// CHECK:STDOUT: %AddWith.type.d7d: type = facet_type <@AddWith, @AddWith(Core.IntLiteral)> [concrete] -// CHECK:STDOUT: %Op.type.0ee: type = fn_type @Op.1, @AddWith(Core.IntLiteral) [concrete] +// CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete] +// CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.1 [concrete] // CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.080b83.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Int.49d0e6.1)> [symbolic] -// CHECK:STDOUT: %Op.type.41a: type = fn_type @Op.6, @impl.144(%N) [symbolic] -// CHECK:STDOUT: %Op.fdd: %Op.type.41a = struct_value () [symbolic] -// CHECK:STDOUT: %U: %ImplicitAs.type.080b83.2 = bind_symbolic_name U, 1 [symbolic] -// CHECK:STDOUT: %Op.type.c98676.1: type = fn_type @Op.12, @impl.b98(%N, %U) [symbolic] -// CHECK:STDOUT: %Op.aee6d7.1: %Op.type.c98676.1 = struct_value () [symbolic] -// CHECK:STDOUT: %Op.type.c98676.2: type = fn_type @Op.13, @impl.b98(%N, %U) [symbolic] -// CHECK:STDOUT: %Op.aee6d7.2: %Op.type.c98676.2 = struct_value () [symbolic] +// CHECK:STDOUT: %Op.type.fc5: type = fn_type @Op.11, @impl.47e(%N) [symbolic] +// CHECK:STDOUT: %Op.8d0: %Op.type.fc5 = struct_value () [symbolic] +// CHECK:STDOUT: %Negate.impl_witness.943: = impl_witness imports.%Negate.impl_witness_table, @impl.47e(%int_32) [concrete] +// CHECK:STDOUT: %Op.type.66f: type = fn_type @Op.11, @impl.47e(%int_32) [concrete] +// CHECK:STDOUT: %Op.5c0: %Op.type.66f = struct_value () [concrete] +// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value %i32, (%Negate.impl_witness.943) [concrete] +// CHECK:STDOUT: %.6f0: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [concrete] +// CHECK:STDOUT: %Op.specific_fn.f32: = specific_function %Op.5c0, @Op.11(%int_32) [concrete] +// CHECK:STDOUT: %CallBoth.type: type = fn_type @CallBoth [concrete] +// CHECK:STDOUT: %CallBoth: %CallBoth.type = struct_value () [concrete] +// CHECK:STDOUT: %.29b: type = fn_type_with_self_type %F.type.c14, %J.facet.ee5 [concrete] +// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] -// CHECK:STDOUT: %AddWith.impl_witness.5e4: = impl_witness imports.%AddWith.impl_witness_table.61f, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.type.0437e0.1: type = fn_type @Op.12, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.a9544c.1: %Op.type.0437e0.1 = struct_value () [concrete] -// CHECK:STDOUT: %Op.type.0437e0.2: type = fn_type @Op.13, @impl.b98(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.a9544c.2: %Op.type.0437e0.2 = struct_value () [concrete] -// CHECK:STDOUT: %AddWith.facet.e10: %AddWith.type.d7d = facet_value %i32, (%AddWith.impl_witness.5e4) [concrete] -// CHECK:STDOUT: %.b70: type = fn_type_with_self_type %Op.type.0ee, %AddWith.facet.e10 [concrete] -// CHECK:STDOUT: %Op.specific_fn.418e74.1: = specific_function %Op.a9544c.2, @Op.13(%int_32, %ImplicitAs.facet.921) [concrete] -// CHECK:STDOUT: %Op.specific_fn.418e74.2: = specific_function %Op.a9544c.1, @Op.12(%int_32, %ImplicitAs.facet.921) [concrete] // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete] -// CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] -// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] -// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] // CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] -// CHECK:STDOUT: %CallBoth.type: type = fn_type @CallBoth [concrete] -// CHECK:STDOUT: %CallBoth: %CallBoth.type = struct_value () [concrete] -// CHECK:STDOUT: %.29b: type = fn_type_with_self_type %F.type.c14, %J.facet.ee5 [concrete] // CHECK:STDOUT: %.ff5: type = fn_type_with_self_type %G.type.285, %J.facet.ee5 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] // CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] -// CHECK:STDOUT: %AddWith.type.1d9: type = facet_type <@AddWith, @AddWith(%i32)> [concrete] -// CHECK:STDOUT: %Op.type.5eb: type = fn_type @Op.1, @AddWith(%i32) [concrete] -// CHECK:STDOUT: %AddWith.impl_witness.091: = impl_witness imports.%AddWith.impl_witness_table.e20, @impl.144(%int_32) [concrete] -// CHECK:STDOUT: %Op.type.630: type = fn_type @Op.6, @impl.144(%int_32) [concrete] -// CHECK:STDOUT: %Op.04c: %Op.type.630 = struct_value () [concrete] -// CHECK:STDOUT: %AddWith.facet.be2: %AddWith.type.1d9 = facet_value %i32, (%AddWith.impl_witness.091) [concrete] -// CHECK:STDOUT: %.8f4: type = fn_type_with_self_type %Op.type.5eb, %AddWith.facet.be2 [concrete] -// CHECK:STDOUT: %Op.specific_fn.951: = specific_function %Op.04c, @Op.6(%int_32) [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] // CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] @@ -1084,22 +1004,18 @@ fn F() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int -// CHECK:STDOUT: .AddWith = %Core.AddWith +// CHECK:STDOUT: .Negate = %Core.Negate // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//prelude/operators/arithmetic, AddWith, loaded [concrete = constants.%AddWith.generic] +// CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] -// CHECK:STDOUT: %Core.import_ref.5f5145.1 = import_ref Core//prelude/types/int, loc92_50, unloaded -// CHECK:STDOUT: %Core.import_ref.bbf: @impl.144.%Op.type (%Op.type.41a) = import_ref Core//prelude/types/int, loc93_42, loaded [symbolic = @impl.144.%Op (constants.%Op.fdd)] -// CHECK:STDOUT: %AddWith.impl_witness_table.e20 = impl_witness_table (%Core.import_ref.5f5145.1, %Core.import_ref.bbf), @impl.144 [concrete] -// CHECK:STDOUT: %Core.import_ref.5f5145.7 = import_ref Core//prelude/types/int, loc124_49, unloaded -// CHECK:STDOUT: %Core.import_ref.34c: @impl.b98.%Op.type.2 (%Op.type.c98676.2) = import_ref Core//prelude/types/int, loc125_48, loaded [symbolic = @impl.b98.%Op.2 (constants.%Op.aee6d7.2)] -// CHECK:STDOUT: %AddWith.impl_witness_table.61f = impl_witness_table (%Core.import_ref.5f5145.7, %Core.import_ref.34c), @impl.b98 [concrete] -// CHECK:STDOUT: %Core.Op.574: @impl.b98.%Op.type.1 (%Op.type.c98676.1) = import_ref Core//prelude/types/int, Op, loaded [symbolic = @impl.b98.%Op.1 (constants.%Op.aee6d7.1)] +// CHECK:STDOUT: %Core.import_ref.5f5145.5 = import_ref Core//prelude/types/int, loc112_43, unloaded +// CHECK:STDOUT: %Core.import_ref.ff2: @impl.47e.%Op.type (%Op.type.fc5) = import_ref Core//prelude/types/int, loc113_31, loaded [symbolic = @impl.47e.%Op (constants.%Op.8d0)] +// CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.5f5145.5, %Core.import_ref.ff2), @impl.47e [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1118,51 +1034,45 @@ fn F() { // CHECK:STDOUT: %CallBoth.decl: %CallBoth.type = fn_decl @CallBoth [concrete = constants.%CallBoth] { // CHECK:STDOUT: %e.patt: %pattern_type.a4a = binding_pattern e [concrete] // CHECK:STDOUT: %e.param_patt: %pattern_type.a4a = value_param_pattern %e.patt, call_param0 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] // CHECK:STDOUT: %e.param: %E = value_param call_param0 // CHECK:STDOUT: %E.ref.loc20: type = name_ref E, file.%E.decl [concrete = constants.%E] // CHECK:STDOUT: %e: %E = bind_name e, %e.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %GenericCallF.decl: %GenericCallF.type = fn_decl @GenericCallF [concrete = constants.%GenericCallF] { // CHECK:STDOUT: %T.patt: %pattern_type.28e = symbolic_binding_pattern T, 0 [concrete] -// CHECK:STDOUT: %t.patt: @GenericCallF.%pattern_type.loc24_24 (%pattern_type.4ca604.2) = binding_pattern t [concrete] -// CHECK:STDOUT: %t.param_patt: @GenericCallF.%pattern_type.loc24_24 (%pattern_type.4ca604.2) = value_param_pattern %t.patt, call_param0 [concrete] -// CHECK:STDOUT: %u.patt: @GenericCallF.%pattern_type.loc24_30 (%pattern_type.b984e7.2) = binding_pattern u [concrete] -// CHECK:STDOUT: %u.param_patt: @GenericCallF.%pattern_type.loc24_30 (%pattern_type.b984e7.2) = value_param_pattern %u.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: @GenericCallF.%pattern_type.loc24_30 (%pattern_type.b984e7.2) = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: @GenericCallF.%pattern_type.loc24_30 (%pattern_type.b984e7.2) = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: %t.patt: @GenericCallF.%pattern_type.loc28_24 (%pattern_type.4ca604.2) = binding_pattern t [concrete] +// CHECK:STDOUT: %t.param_patt: @GenericCallF.%pattern_type.loc28_24 (%pattern_type.4ca604.2) = value_param_pattern %t.patt, call_param0 [concrete] +// CHECK:STDOUT: %u.patt: @GenericCallF.%pattern_type.loc28_30 (%pattern_type.b984e7.2) = binding_pattern u [concrete] +// CHECK:STDOUT: %u.param_patt: @GenericCallF.%pattern_type.loc28_30 (%pattern_type.b984e7.2) = value_param_pattern %u.patt, call_param1 [concrete] +// CHECK:STDOUT: %return.patt: @GenericCallF.%pattern_type.loc28_30 (%pattern_type.b984e7.2) = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: @GenericCallF.%pattern_type.loc28_30 (%pattern_type.b984e7.2) = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref.loc24_41: %J.type = name_ref T, %T.loc24_17.1 [symbolic = %T.loc24_17.2 (constants.%T.ccd)] -// CHECK:STDOUT: %U.ref.loc24_42: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411] -// CHECK:STDOUT: %T.as_type.loc24_42: type = facet_access_type %T.ref.loc24_41 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] -// CHECK:STDOUT: %.loc24_42: type = converted %T.ref.loc24_41, %T.as_type.loc24_42 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] -// CHECK:STDOUT: %impl.elem0.loc24_42: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc24_34.2 (constants.%impl.elem0.11fef0.2)] +// CHECK:STDOUT: %T.ref.loc28_41: %J.type = name_ref T, %T.loc28_17.1 [symbolic = %T.loc28_17.2 (constants.%T.ccd)] +// CHECK:STDOUT: %U.ref.loc28_42: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411] +// CHECK:STDOUT: %T.as_type.loc28_42: type = facet_access_type %T.ref.loc28_41 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %.loc28_42: type = converted %T.ref.loc28_41, %T.as_type.loc28_42 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %impl.elem0.loc28_42: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc28_34.2 (constants.%impl.elem0.11fef0.2)] // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] -// CHECK:STDOUT: %T.loc24_17.1: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc24_17.2 (constants.%T.ccd)] -// CHECK:STDOUT: %t.param: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type.3df) = value_param call_param0 -// CHECK:STDOUT: %.loc24_27.1: type = splice_block %.loc24_27.2 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] { -// CHECK:STDOUT: %T.ref.loc24_27: %J.type = name_ref T, %T.loc24_17.1 [symbolic = %T.loc24_17.2 (constants.%T.ccd)] -// CHECK:STDOUT: %T.as_type.loc24_27.1: type = facet_access_type %T.ref.loc24_27 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] -// CHECK:STDOUT: %.loc24_27.2: type = converted %T.ref.loc24_27, %T.as_type.loc24_27.1 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %T.loc28_17.1: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc28_17.2 (constants.%T.ccd)] +// CHECK:STDOUT: %t.param: @GenericCallF.%T.as_type.loc28_27.2 (%T.as_type.3df) = value_param call_param0 +// CHECK:STDOUT: %.loc28_27.1: type = splice_block %.loc28_27.2 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] { +// CHECK:STDOUT: %T.ref.loc28_27: %J.type = name_ref T, %T.loc28_17.1 [symbolic = %T.loc28_17.2 (constants.%T.ccd)] +// CHECK:STDOUT: %T.as_type.loc28_27.1: type = facet_access_type %T.ref.loc28_27 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %.loc28_27.2: type = converted %T.ref.loc28_27, %T.as_type.loc28_27.1 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] // CHECK:STDOUT: } -// CHECK:STDOUT: %t: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type.3df) = bind_name t, %t.param -// CHECK:STDOUT: %u.param: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = value_param call_param1 -// CHECK:STDOUT: %.loc24_34.1: type = splice_block %impl.elem0.loc24_34.1 [symbolic = %impl.elem0.loc24_34.2 (constants.%impl.elem0.11fef0.2)] { -// CHECK:STDOUT: %T.ref.loc24_33: %J.type = name_ref T, %T.loc24_17.1 [symbolic = %T.loc24_17.2 (constants.%T.ccd)] -// CHECK:STDOUT: %U.ref.loc24_34: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411] -// CHECK:STDOUT: %T.as_type.loc24_34: type = facet_access_type %T.ref.loc24_33 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] -// CHECK:STDOUT: %.loc24_34.2: type = converted %T.ref.loc24_33, %T.as_type.loc24_34 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] -// CHECK:STDOUT: %impl.elem0.loc24_34.1: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc24_34.2 (constants.%impl.elem0.11fef0.2)] +// CHECK:STDOUT: %t: @GenericCallF.%T.as_type.loc28_27.2 (%T.as_type.3df) = bind_name t, %t.param +// CHECK:STDOUT: %u.param: @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) = value_param call_param1 +// CHECK:STDOUT: %.loc28_34.1: type = splice_block %impl.elem0.loc28_34.1 [symbolic = %impl.elem0.loc28_34.2 (constants.%impl.elem0.11fef0.2)] { +// CHECK:STDOUT: %T.ref.loc28_33: %J.type = name_ref T, %T.loc28_17.1 [symbolic = %T.loc28_17.2 (constants.%T.ccd)] +// CHECK:STDOUT: %U.ref.loc28_34: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0.411] +// CHECK:STDOUT: %T.as_type.loc28_34: type = facet_access_type %T.ref.loc28_33 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %.loc28_34.2: type = converted %T.ref.loc28_33, %T.as_type.loc28_34 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %impl.elem0.loc28_34.1: type = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element0 [symbolic = %impl.elem0.loc28_34.2 (constants.%impl.elem0.11fef0.2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %u: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = bind_name u, %u.param -// CHECK:STDOUT: %return.param: ref @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = out_param call_param2 -// CHECK:STDOUT: %return: ref @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = return_slot %return.param +// CHECK:STDOUT: %u: @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) = bind_name u, %u.param +// CHECK:STDOUT: %return.param: ref @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) = out_param call_param2 +// CHECK:STDOUT: %return: ref @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] { // CHECK:STDOUT: %e.patt: %pattern_type.a4a = binding_pattern e [concrete] @@ -1344,196 +1254,178 @@ fn F() { // CHECK:STDOUT: fn @F.2(%u.param: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: %i32 = name_ref u, %u -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.c75) [concrete = constants.%ImplicitAs.facet.921] -// CHECK:STDOUT: %.loc12_16.1: %ImplicitAs.type.205 = converted Core.IntLiteral, %ImplicitAs.facet [concrete = constants.%ImplicitAs.facet.921] -// CHECK:STDOUT: %impl.elem1: %.b70 = impl_witness_access constants.%AddWith.impl_witness.5e4, element1 [concrete = constants.%Op.a9544c.2] -// CHECK:STDOUT: %bound_method.loc12_16.1: = bound_method %u.ref, %impl.elem1 -// CHECK:STDOUT: %specific_fn.loc12_16: = specific_function %impl.elem1, @Op.13(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.1] -// CHECK:STDOUT: %bound_method.loc12_16.2: = bound_method %u.ref, %specific_fn.loc12_16 -// CHECK:STDOUT: %.loc12_16.2: %Op.type.0437e0.1 = specific_constant imports.%Core.Op.574, @impl.b98(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.a9544c.1] -// CHECK:STDOUT: %Op.ref: %Op.type.0437e0.1 = name_ref Op, %.loc12_16.2 [concrete = constants.%Op.a9544c.1] -// CHECK:STDOUT: %Op.bound: = bound_method %u.ref, %Op.ref -// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.ref, @Op.12(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.2] -// CHECK:STDOUT: %bound_method.loc12_16.3: = bound_method %u.ref, %Op.specific_fn -// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc12_18.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc12_18: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc12_18.2: = bound_method %int_1, %specific_fn.loc12_18 [concrete = constants.%bound_method.9a1] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc12_18.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc12_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc12_18.2: %i32 = converted %int_1, %.loc12_18.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc12_16.3(%u.ref, %.loc12_18.2) -// CHECK:STDOUT: %.loc12_19.1: %i32 = value_of_initializer %int.sadd -// CHECK:STDOUT: %.loc12_19.2: %i32 = converted %int.sadd, %.loc12_19.1 -// CHECK:STDOUT: return %.loc12_19.2 +// CHECK:STDOUT: %impl.elem1: %.6f0 = impl_witness_access constants.%Negate.impl_witness.943, element1 [concrete = constants.%Op.5c0] +// CHECK:STDOUT: %bound_method.loc12_14.1: = bound_method %u.ref, %impl.elem1 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem1, @Op.11(constants.%int_32) [concrete = constants.%Op.specific_fn.f32] +// CHECK:STDOUT: %bound_method.loc12_14.2: = bound_method %u.ref, %specific_fn +// CHECK:STDOUT: %int.snegate: init %i32 = call %bound_method.loc12_14.2(%u.ref) +// CHECK:STDOUT: %.loc12_16.1: %i32 = value_of_initializer %int.snegate +// CHECK:STDOUT: %.loc12_16.2: %i32 = converted %int.snegate, %.loc12_16.1 +// CHECK:STDOUT: return %.loc12_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G.2(%self.param: %E, %v.param: %i32) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.ref: %i32 = name_ref v, %v -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (constants.%ImplicitAs.impl_witness.c75) [concrete = constants.%ImplicitAs.facet.921] -// CHECK:STDOUT: %.loc15_16.1: %ImplicitAs.type.205 = converted Core.IntLiteral, %ImplicitAs.facet [concrete = constants.%ImplicitAs.facet.921] -// CHECK:STDOUT: %impl.elem1: %.b70 = impl_witness_access constants.%AddWith.impl_witness.5e4, element1 [concrete = constants.%Op.a9544c.2] -// CHECK:STDOUT: %bound_method.loc15_16.1: = bound_method %v.ref, %impl.elem1 -// CHECK:STDOUT: %specific_fn.loc15_16: = specific_function %impl.elem1, @Op.13(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.1] -// CHECK:STDOUT: %bound_method.loc15_16.2: = bound_method %v.ref, %specific_fn.loc15_16 -// CHECK:STDOUT: %.loc15_16.2: %Op.type.0437e0.1 = specific_constant imports.%Core.Op.574, @impl.b98(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.a9544c.1] -// CHECK:STDOUT: %Op.ref: %Op.type.0437e0.1 = name_ref Op, %.loc15_16.2 [concrete = constants.%Op.a9544c.1] -// CHECK:STDOUT: %Op.bound: = bound_method %v.ref, %Op.ref -// CHECK:STDOUT: %Op.specific_fn: = specific_function %Op.ref, @Op.12(constants.%int_32, constants.%ImplicitAs.facet.921) [concrete = constants.%Op.specific_fn.418e74.2] -// CHECK:STDOUT: %bound_method.loc15_16.3: = bound_method %v.ref, %Op.specific_fn -// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc15_18.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc15_18: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc15_18.2: = bound_method %int_2, %specific_fn.loc15_18 [concrete = constants.%bound_method.b92] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc15_18.2(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_2, %.loc15_18.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %int.sadd: init %i32 = call %bound_method.loc15_16.3(%v.ref, %.loc15_18.2) -// CHECK:STDOUT: %.loc15_19.1: %i32 = value_of_initializer %int.sadd -// CHECK:STDOUT: %.loc15_19.2: %i32 = converted %int.sadd, %.loc15_19.1 -// CHECK:STDOUT: return %.loc15_19.2 +// CHECK:STDOUT: %impl.elem1: %.6f0 = impl_witness_access constants.%Negate.impl_witness.943, element1 [concrete = constants.%Op.5c0] +// CHECK:STDOUT: %bound_method.loc15_14.1: = bound_method %v.ref, %impl.elem1 +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem1, @Op.11(constants.%int_32) [concrete = constants.%Op.specific_fn.f32] +// CHECK:STDOUT: %bound_method.loc15_14.2: = bound_method %v.ref, %specific_fn +// CHECK:STDOUT: %int.snegate: init %i32 = call %bound_method.loc15_14.2(%v.ref) +// CHECK:STDOUT: %.loc15_16.1: %i32 = value_of_initializer %int.snegate +// CHECK:STDOUT: %.loc15_16.2: %i32 = converted %int.snegate, %.loc15_16.1 +// CHECK:STDOUT: return %.loc15_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallBoth(%e.param: %E) -> %i32 { +// CHECK:STDOUT: fn @CallBoth(%e.param: %E) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %e.ref.loc21_10: %E = name_ref e, %e -// CHECK:STDOUT: %F.ref.loc21_11: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572] -// CHECK:STDOUT: %impl.elem1.loc21_11: %.29b = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%F.b07] +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %e1.patt: %pattern_type.7ce = binding_pattern e1 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %e.ref.loc21: %E = name_ref e, %e +// CHECK:STDOUT: %F.ref.loc21: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572] +// CHECK:STDOUT: %impl.elem1.loc21: %.29b = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%F.b07] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc21_14: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_14.1: = bound_method %int_2, %impl.elem0.loc21_14 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc21_14: = specific_function %impl.elem0.loc21_14, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_14.2: = bound_method %int_2, %specific_fn.loc21_14 [concrete = constants.%bound_method.b92] -// CHECK:STDOUT: %int.convert_checked.loc21_14: init %i32 = call %bound_method.loc21_14.2(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc21_14.1: %i32 = value_of_initializer %int.convert_checked.loc21_14 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc21_14.2: %i32 = converted %int_2, %.loc21_14.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %F.call.loc21_15: init %i32 = call %impl.elem1.loc21_11(%.loc21_14.2) -// CHECK:STDOUT: %e.ref.loc21_19: %E = name_ref e, %e -// CHECK:STDOUT: %G.ref.loc21_20: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75] -// CHECK:STDOUT: %impl.elem2.loc21_20: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553] -// CHECK:STDOUT: %bound_method.loc21_20: = bound_method %e.ref.loc21_19, %impl.elem2.loc21_20 +// CHECK:STDOUT: %impl.elem0.loc21: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc21_21.1: = bound_method %int_2, %impl.elem0.loc21 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc21: = specific_function %impl.elem0.loc21, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc21_21.2: = bound_method %int_2, %specific_fn.loc21 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc21: init %i32 = call %bound_method.loc21_21.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc21_21.1: %i32 = value_of_initializer %int.convert_checked.loc21 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc21_21.2: %i32 = converted %int_2, %.loc21_21.1 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %F.call.loc21: init %i32 = call %impl.elem1.loc21(%.loc21_21.2) +// CHECK:STDOUT: %.loc21_11: type = splice_block %i32.loc21 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc21_22.1: %i32 = value_of_initializer %F.call.loc21 +// CHECK:STDOUT: %.loc21_22.2: %i32 = converted %F.call.loc21, %.loc21_22.1 +// CHECK:STDOUT: %e1: %i32 = bind_name e1, %.loc21_22.2 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %e2.patt: %pattern_type.7ce = binding_pattern e2 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %e.ref.loc22: %E = name_ref e, %e +// CHECK:STDOUT: %G.ref.loc22: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75] +// CHECK:STDOUT: %impl.elem2.loc22: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553] +// CHECK:STDOUT: %bound_method.loc22_18: = bound_method %e.ref.loc22, %impl.elem2.loc22 // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %impl.elem0.loc21_23: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_23.1: = bound_method %int_3, %impl.elem0.loc21_23 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc21_23: = specific_function %impl.elem0.loc21_23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_23.2: = bound_method %int_3, %specific_fn.loc21_23 [concrete = constants.%bound_method.047] -// CHECK:STDOUT: %int.convert_checked.loc21_23: init %i32 = call %bound_method.loc21_23.2(%int_3) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc21_23.1: %i32 = value_of_initializer %int.convert_checked.loc21_23 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc21_23.2: %i32 = converted %int_3, %.loc21_23.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %G.call.loc21_24: init %i32 = call %bound_method.loc21_20(%e.ref.loc21_19, %.loc21_23.2) -// CHECK:STDOUT: %impl.elem1.loc21_17: %.8f4 = impl_witness_access constants.%AddWith.impl_witness.091, element1 [concrete = constants.%Op.04c] -// CHECK:STDOUT: %bound_method.loc21_17.1: = bound_method %F.call.loc21_15, %impl.elem1.loc21_17 -// CHECK:STDOUT: %specific_fn.loc21_17: = specific_function %impl.elem1.loc21_17, @Op.6(constants.%int_32) [concrete = constants.%Op.specific_fn.951] -// CHECK:STDOUT: %bound_method.loc21_17.2: = bound_method %F.call.loc21_15, %specific_fn.loc21_17 -// CHECK:STDOUT: %.loc21_15.1: %i32 = value_of_initializer %F.call.loc21_15 -// CHECK:STDOUT: %.loc21_15.2: %i32 = converted %F.call.loc21_15, %.loc21_15.1 -// CHECK:STDOUT: %.loc21_24.1: %i32 = value_of_initializer %G.call.loc21_24 -// CHECK:STDOUT: %.loc21_24.2: %i32 = converted %G.call.loc21_24, %.loc21_24.1 -// CHECK:STDOUT: %int.sadd.loc21_17: init %i32 = call %bound_method.loc21_17.2(%.loc21_15.2, %.loc21_24.2) -// CHECK:STDOUT: %E.ref.loc21_28: type = name_ref E, file.%E.decl [concrete = constants.%E] -// CHECK:STDOUT: %F.ref.loc21_29: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572] -// CHECK:STDOUT: %impl.elem1.loc21_29: %.29b = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%F.b07] +// CHECK:STDOUT: %impl.elem0.loc22: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc22_21.1: = bound_method %int_3, %impl.elem0.loc22 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc22: = specific_function %impl.elem0.loc22, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_21.2: = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %bound_method.loc22_21.2(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc22_21.1: %i32 = value_of_initializer %int.convert_checked.loc22 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc22_21.2: %i32 = converted %int_3, %.loc22_21.1 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %G.call.loc22: init %i32 = call %bound_method.loc22_18(%e.ref.loc22, %.loc22_21.2) +// CHECK:STDOUT: %.loc22_11: type = splice_block %i32.loc22 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc22_22.1: %i32 = value_of_initializer %G.call.loc22 +// CHECK:STDOUT: %.loc22_22.2: %i32 = converted %G.call.loc22, %.loc22_22.1 +// CHECK:STDOUT: %e2: %i32 = bind_name e2, %.loc22_22.2 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %e3.patt: %pattern_type.7ce = binding_pattern e3 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %E.ref.loc23: type = name_ref E, file.%E.decl [concrete = constants.%E] +// CHECK:STDOUT: %F.ref.loc23: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572] +// CHECK:STDOUT: %impl.elem1.loc23: %.29b = impl_witness_access constants.%J.impl_witness, element1 [concrete = constants.%F.b07] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] -// CHECK:STDOUT: %impl.elem0.loc21_32: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_32.1: = bound_method %int_4, %impl.elem0.loc21_32 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc21_32: = specific_function %impl.elem0.loc21_32, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_32.2: = bound_method %int_4, %specific_fn.loc21_32 [concrete = constants.%bound_method.1da] -// CHECK:STDOUT: %int.convert_checked.loc21_32: init %i32 = call %bound_method.loc21_32.2(%int_4) [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc21_32.1: %i32 = value_of_initializer %int.convert_checked.loc21_32 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc21_32.2: %i32 = converted %int_4, %.loc21_32.1 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %F.call.loc21_33: init %i32 = call %impl.elem1.loc21_29(%.loc21_32.2) -// CHECK:STDOUT: %impl.elem1.loc21_26: %.8f4 = impl_witness_access constants.%AddWith.impl_witness.091, element1 [concrete = constants.%Op.04c] -// CHECK:STDOUT: %bound_method.loc21_26.1: = bound_method %int.sadd.loc21_17, %impl.elem1.loc21_26 -// CHECK:STDOUT: %specific_fn.loc21_26: = specific_function %impl.elem1.loc21_26, @Op.6(constants.%int_32) [concrete = constants.%Op.specific_fn.951] -// CHECK:STDOUT: %bound_method.loc21_26.2: = bound_method %int.sadd.loc21_17, %specific_fn.loc21_26 -// CHECK:STDOUT: %.loc21_17.1: %i32 = value_of_initializer %int.sadd.loc21_17 -// CHECK:STDOUT: %.loc21_17.2: %i32 = converted %int.sadd.loc21_17, %.loc21_17.1 -// CHECK:STDOUT: %.loc21_33.1: %i32 = value_of_initializer %F.call.loc21_33 -// CHECK:STDOUT: %.loc21_33.2: %i32 = converted %F.call.loc21_33, %.loc21_33.1 -// CHECK:STDOUT: %int.sadd.loc21_26: init %i32 = call %bound_method.loc21_26.2(%.loc21_17.2, %.loc21_33.2) -// CHECK:STDOUT: %e.ref.loc21_37: %E = name_ref e, %e -// CHECK:STDOUT: %E.ref.loc21_40: type = name_ref E, file.%E.decl [concrete = constants.%E] -// CHECK:STDOUT: %G.ref.loc21_41: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75] -// CHECK:STDOUT: %impl.elem2.loc21_41: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553] -// CHECK:STDOUT: %bound_method.loc21_38: = bound_method %e.ref.loc21_37, %impl.elem2.loc21_41 +// CHECK:STDOUT: %impl.elem0.loc23: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc23_21.1: = bound_method %int_4, %impl.elem0.loc23 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc23: = specific_function %impl.elem0.loc23, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc23_21.2: = bound_method %int_4, %specific_fn.loc23 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %bound_method.loc23_21.2(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc23_21.1: %i32 = value_of_initializer %int.convert_checked.loc23 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc23_21.2: %i32 = converted %int_4, %.loc23_21.1 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %F.call.loc23: init %i32 = call %impl.elem1.loc23(%.loc23_21.2) +// CHECK:STDOUT: %.loc23_11: type = splice_block %i32.loc23 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc23_22.1: %i32 = value_of_initializer %F.call.loc23 +// CHECK:STDOUT: %.loc23_22.2: %i32 = converted %F.call.loc23, %.loc23_22.1 +// CHECK:STDOUT: %e3: %i32 = bind_name e3, %.loc23_22.2 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %e4.patt: %pattern_type.7ce = binding_pattern e4 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %e.ref.loc24: %E = name_ref e, %e +// CHECK:STDOUT: %E.ref.loc24: type = name_ref E, file.%E.decl [concrete = constants.%E] +// CHECK:STDOUT: %G.ref.loc24: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75] +// CHECK:STDOUT: %impl.elem2.loc24: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553] +// CHECK:STDOUT: %bound_method.loc24_18: = bound_method %e.ref.loc24, %impl.elem2.loc24 // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] -// CHECK:STDOUT: %impl.elem0.loc21_45: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_45.1: = bound_method %int_5, %impl.elem0.loc21_45 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn.loc21_45: = specific_function %impl.elem0.loc21_45, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_45.2: = bound_method %int_5, %specific_fn.loc21_45 [concrete = constants.%bound_method.a25] -// CHECK:STDOUT: %int.convert_checked.loc21_45: init %i32 = call %bound_method.loc21_45.2(%int_5) [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc21_45.1: %i32 = value_of_initializer %int.convert_checked.loc21_45 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc21_45.2: %i32 = converted %int_5, %.loc21_45.1 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %G.call.loc21_46: init %i32 = call %bound_method.loc21_38(%e.ref.loc21_37, %.loc21_45.2) -// CHECK:STDOUT: %impl.elem1.loc21_35: %.8f4 = impl_witness_access constants.%AddWith.impl_witness.091, element1 [concrete = constants.%Op.04c] -// CHECK:STDOUT: %bound_method.loc21_35.1: = bound_method %int.sadd.loc21_26, %impl.elem1.loc21_35 -// CHECK:STDOUT: %specific_fn.loc21_35: = specific_function %impl.elem1.loc21_35, @Op.6(constants.%int_32) [concrete = constants.%Op.specific_fn.951] -// CHECK:STDOUT: %bound_method.loc21_35.2: = bound_method %int.sadd.loc21_26, %specific_fn.loc21_35 -// CHECK:STDOUT: %.loc21_26.1: %i32 = value_of_initializer %int.sadd.loc21_26 -// CHECK:STDOUT: %.loc21_26.2: %i32 = converted %int.sadd.loc21_26, %.loc21_26.1 -// CHECK:STDOUT: %.loc21_46.1: %i32 = value_of_initializer %G.call.loc21_46 -// CHECK:STDOUT: %.loc21_46.2: %i32 = converted %G.call.loc21_46, %.loc21_46.1 -// CHECK:STDOUT: %int.sadd.loc21_35: init %i32 = call %bound_method.loc21_35.2(%.loc21_26.2, %.loc21_46.2) -// CHECK:STDOUT: %e.ref.loc21_50: %E = name_ref e, %e +// CHECK:STDOUT: %impl.elem0.loc24: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc24_25.1: = bound_method %int_5, %impl.elem0.loc24 [concrete = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_25.2: = bound_method %int_5, %specific_fn.loc24 [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked.loc24: init %i32 = call %bound_method.loc24_25.2(%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc24_25.1: %i32 = value_of_initializer %int.convert_checked.loc24 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc24_25.2: %i32 = converted %int_5, %.loc24_25.1 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %G.call.loc24: init %i32 = call %bound_method.loc24_18(%e.ref.loc24, %.loc24_25.2) +// CHECK:STDOUT: %.loc24_11: type = splice_block %i32.loc24 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc24_26.1: %i32 = value_of_initializer %G.call.loc24 +// CHECK:STDOUT: %.loc24_26.2: %i32 = converted %G.call.loc24, %.loc24_26.1 +// CHECK:STDOUT: %e4: %i32 = bind_name e4, %.loc24_26.2 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %e5.patt: %pattern_type.7ce = binding_pattern e5 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %e.ref.loc25: %E = name_ref e, %e // CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] -// CHECK:STDOUT: %G.ref.loc21_54: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75] -// CHECK:STDOUT: %impl.elem2.loc21_51: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553] -// CHECK:STDOUT: %bound_method.loc21_51: = bound_method %e.ref.loc21_50, %impl.elem2.loc21_51 +// CHECK:STDOUT: %G.ref.loc25: %J.assoc_type = name_ref G, @J.%assoc2 [concrete = constants.%assoc2.d75] +// CHECK:STDOUT: %impl.elem2.loc25: %.ff5 = impl_witness_access constants.%J.impl_witness, element2 [concrete = constants.%G.553] +// CHECK:STDOUT: %bound_method.loc25_18: = bound_method %e.ref.loc25, %impl.elem2.loc25 // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462] -// CHECK:STDOUT: %impl.elem0.loc21_58: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc21_58.1: = bound_method %int_6, %impl.elem0.loc21_58 [concrete = constants.%Convert.bound.ce9] -// CHECK:STDOUT: %specific_fn.loc21_58: = specific_function %impl.elem0.loc21_58, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc21_58.2: = bound_method %int_6, %specific_fn.loc21_58 [concrete = constants.%bound_method.efa] -// CHECK:STDOUT: %int.convert_checked.loc21_58: init %i32 = call %bound_method.loc21_58.2(%int_6) [concrete = constants.%int_6.e56] -// CHECK:STDOUT: %.loc21_58.1: %i32 = value_of_initializer %int.convert_checked.loc21_58 [concrete = constants.%int_6.e56] -// CHECK:STDOUT: %.loc21_58.2: %i32 = converted %int_6, %.loc21_58.1 [concrete = constants.%int_6.e56] -// CHECK:STDOUT: %G.call.loc21_59: init %i32 = call %bound_method.loc21_51(%e.ref.loc21_50, %.loc21_58.2) -// CHECK:STDOUT: %impl.elem1.loc21_48: %.8f4 = impl_witness_access constants.%AddWith.impl_witness.091, element1 [concrete = constants.%Op.04c] -// CHECK:STDOUT: %bound_method.loc21_48.1: = bound_method %int.sadd.loc21_35, %impl.elem1.loc21_48 -// CHECK:STDOUT: %specific_fn.loc21_48: = specific_function %impl.elem1.loc21_48, @Op.6(constants.%int_32) [concrete = constants.%Op.specific_fn.951] -// CHECK:STDOUT: %bound_method.loc21_48.2: = bound_method %int.sadd.loc21_35, %specific_fn.loc21_48 -// CHECK:STDOUT: %.loc21_35.1: %i32 = value_of_initializer %int.sadd.loc21_35 -// CHECK:STDOUT: %.loc21_35.2: %i32 = converted %int.sadd.loc21_35, %.loc21_35.1 -// CHECK:STDOUT: %.loc21_59.1: %i32 = value_of_initializer %G.call.loc21_59 -// CHECK:STDOUT: %.loc21_59.2: %i32 = converted %G.call.loc21_59, %.loc21_59.1 -// CHECK:STDOUT: %int.sadd.loc21_48: init %i32 = call %bound_method.loc21_48.2(%.loc21_35.2, %.loc21_59.2) -// CHECK:STDOUT: %.loc21_60.1: %i32 = value_of_initializer %int.sadd.loc21_48 -// CHECK:STDOUT: %.loc21_60.2: %i32 = converted %int.sadd.loc21_48, %.loc21_60.1 -// CHECK:STDOUT: return %.loc21_60.2 +// CHECK:STDOUT: %impl.elem0.loc25: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc25_25.1: = bound_method %int_6, %impl.elem0.loc25 [concrete = constants.%Convert.bound.ce9] +// CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %int_6, %specific_fn.loc25 [concrete = constants.%bound_method.efa] +// CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %bound_method.loc25_25.2(%int_6) [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %.loc25_25.1: %i32 = value_of_initializer %int.convert_checked.loc25 [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %.loc25_25.2: %i32 = converted %int_6, %.loc25_25.1 [concrete = constants.%int_6.e56] +// CHECK:STDOUT: %G.call.loc25: init %i32 = call %bound_method.loc25_18(%e.ref.loc25, %.loc25_25.2) +// CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc25_26.1: %i32 = value_of_initializer %G.call.loc25 +// CHECK:STDOUT: %.loc25_26.2: %i32 = converted %G.call.loc25, %.loc25_26.1 +// CHECK:STDOUT: %e5: %i32 = bind_name e5, %.loc25_26.2 +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @GenericCallF(%T.loc24_17.1: %J.type) { -// CHECK:STDOUT: %T.loc24_17.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc24_17.2 (constants.%T.ccd)] -// CHECK:STDOUT: %T.as_type.loc24_27.2: type = facet_access_type %T.loc24_17.2 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] -// CHECK:STDOUT: %pattern_type.loc24_24: type = pattern_type %T.as_type.loc24_27.2 [symbolic = %pattern_type.loc24_24 (constants.%pattern_type.4ca604.2)] -// CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %T.loc24_17.2, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.2)] -// CHECK:STDOUT: %impl.elem0.loc24_34.2: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_34.2 (constants.%impl.elem0.11fef0.2)] -// CHECK:STDOUT: %pattern_type.loc24_30: type = pattern_type %impl.elem0.loc24_34.2 [symbolic = %pattern_type.loc24_30 (constants.%pattern_type.b984e7.2)] +// CHECK:STDOUT: generic fn @GenericCallF(%T.loc28_17.1: %J.type) { +// CHECK:STDOUT: %T.loc28_17.2: %J.type = bind_symbolic_name T, 0 [symbolic = %T.loc28_17.2 (constants.%T.ccd)] +// CHECK:STDOUT: %T.as_type.loc28_27.2: type = facet_access_type %T.loc28_17.2 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %pattern_type.loc28_24: type = pattern_type %T.as_type.loc28_27.2 [symbolic = %pattern_type.loc28_24 (constants.%pattern_type.4ca604.2)] +// CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %T.loc28_17.2, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness.64628e.2)] +// CHECK:STDOUT: %impl.elem0.loc28_34.2: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_34.2 (constants.%impl.elem0.11fef0.2)] +// CHECK:STDOUT: %pattern_type.loc28_30: type = pattern_type %impl.elem0.loc28_34.2 [symbolic = %pattern_type.loc28_30 (constants.%pattern_type.b984e7.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc24_38: = require_complete_type %impl.elem0.loc24_34.2 [symbolic = %require_complete.loc24_38 (constants.%require_complete.58f)] -// CHECK:STDOUT: %require_complete.loc24_25: = require_complete_type %T.as_type.loc24_27.2 [symbolic = %require_complete.loc24_25 (constants.%require_complete.2a5)] -// CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc24_27.2, (%J.lookup_impl_witness) [symbolic = %J.facet (constants.%J.facet.5210a7.2)] -// CHECK:STDOUT: %.loc25_11.2: type = fn_type_with_self_type constants.%F.type.c14, %J.facet [symbolic = %.loc25_11.2 (constants.%.d43)] -// CHECK:STDOUT: %impl.elem1.loc25_11.2: @GenericCallF.%.loc25_11.2 (%.d43) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc25_11.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %specific_impl_fn.loc25_11.2: = specific_impl_function %impl.elem1.loc25_11.2, @F.1(%J.facet) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn.fe8)] +// CHECK:STDOUT: %require_complete.loc28_38: = require_complete_type %impl.elem0.loc28_34.2 [symbolic = %require_complete.loc28_38 (constants.%require_complete.58f)] +// CHECK:STDOUT: %require_complete.loc28_25: = require_complete_type %T.as_type.loc28_27.2 [symbolic = %require_complete.loc28_25 (constants.%require_complete.2a5)] +// CHECK:STDOUT: %J.facet: %J.type = facet_value %T.as_type.loc28_27.2, (%J.lookup_impl_witness) [symbolic = %J.facet (constants.%J.facet.5210a7.2)] +// CHECK:STDOUT: %.loc29_11.2: type = fn_type_with_self_type constants.%F.type.c14, %J.facet [symbolic = %.loc29_11.2 (constants.%.d43)] +// CHECK:STDOUT: %impl.elem1.loc29_11.2: @GenericCallF.%.loc29_11.2 (%.d43) = impl_witness_access %J.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc29_11.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %specific_impl_fn.loc29_11.2: = specific_impl_function %impl.elem1.loc29_11.2, @F.1(%J.facet) [symbolic = %specific_impl_fn.loc29_11.2 (constants.%specific_impl_fn.fe8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%t.param: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type.3df), %u.param: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2)) -> @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) { +// CHECK:STDOUT: fn(%t.param: @GenericCallF.%T.as_type.loc28_27.2 (%T.as_type.3df), %u.param: @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2)) -> @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %t.ref: @GenericCallF.%T.as_type.loc24_27.2 (%T.as_type.3df) = name_ref t, %t +// CHECK:STDOUT: %t.ref: @GenericCallF.%T.as_type.loc28_27.2 (%T.as_type.3df) = name_ref t, %t // CHECK:STDOUT: %F.ref: %J.assoc_type = name_ref F, @J.%assoc1 [concrete = constants.%assoc1.572] -// CHECK:STDOUT: %T.as_type.loc25: type = facet_access_type constants.%T.ccd [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] -// CHECK:STDOUT: %.loc25_11.1: type = converted constants.%T.ccd, %T.as_type.loc25 [symbolic = %T.as_type.loc24_27.2 (constants.%T.as_type.3df)] -// CHECK:STDOUT: %impl.elem1.loc25_11.1: @GenericCallF.%.loc25_11.2 (%.d43) = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element1 [symbolic = %impl.elem1.loc25_11.2 (constants.%impl.elem1)] -// CHECK:STDOUT: %u.ref: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = name_ref u, %u -// CHECK:STDOUT: %specific_impl_fn.loc25_11.1: = specific_impl_function %impl.elem1.loc25_11.1, @F.1(constants.%J.facet.5210a7.2) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn.fe8)] -// CHECK:STDOUT: %.loc25_15: init @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = call %specific_impl_fn.loc25_11.1(%u.ref) -// CHECK:STDOUT: %.loc25_16.1: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = value_of_initializer %.loc25_15 -// CHECK:STDOUT: %.loc25_16.2: @GenericCallF.%impl.elem0.loc24_34.2 (%impl.elem0.11fef0.2) = converted %.loc25_15, %.loc25_16.1 -// CHECK:STDOUT: return %.loc25_16.2 +// CHECK:STDOUT: %T.as_type.loc29: type = facet_access_type constants.%T.ccd [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %.loc29_11.1: type = converted constants.%T.ccd, %T.as_type.loc29 [symbolic = %T.as_type.loc28_27.2 (constants.%T.as_type.3df)] +// CHECK:STDOUT: %impl.elem1.loc29_11.1: @GenericCallF.%.loc29_11.2 (%.d43) = impl_witness_access constants.%J.lookup_impl_witness.64628e.2, element1 [symbolic = %impl.elem1.loc29_11.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %u.ref: @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) = name_ref u, %u +// CHECK:STDOUT: %specific_impl_fn.loc29_11.1: = specific_impl_function %impl.elem1.loc29_11.1, @F.1(constants.%J.facet.5210a7.2) [symbolic = %specific_impl_fn.loc29_11.2 (constants.%specific_impl_fn.fe8)] +// CHECK:STDOUT: %.loc29_15: init @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) = call %specific_impl_fn.loc29_11.1(%u.ref) +// CHECK:STDOUT: %.loc29_16.1: @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) = value_of_initializer %.loc29_15 +// CHECK:STDOUT: %.loc29_16.2: @GenericCallF.%impl.elem0.loc28_34.2 (%impl.elem0.11fef0.2) = converted %.loc29_15, %.loc29_16.1 +// CHECK:STDOUT: return %.loc29_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1542,22 +1434,22 @@ fn F() { // CHECK:STDOUT: %GenericCallF.ref: %GenericCallF.type = name_ref GenericCallF, file.%GenericCallF.decl [concrete = constants.%GenericCallF] // CHECK:STDOUT: %e.ref: %E = name_ref e, %e // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %J.facet.loc29_27.1: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet.ee5] -// CHECK:STDOUT: %.loc29_27.1: %J.type = converted constants.%E, %J.facet.loc29_27.1 [concrete = constants.%J.facet.ee5] -// CHECK:STDOUT: %J.facet.loc29_27.2: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet.ee5] -// CHECK:STDOUT: %.loc29_27.2: %J.type = converted constants.%E, %J.facet.loc29_27.2 [concrete = constants.%J.facet.ee5] +// CHECK:STDOUT: %J.facet.loc33_27.1: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet.ee5] +// CHECK:STDOUT: %.loc33_27.1: %J.type = converted constants.%E, %J.facet.loc33_27.1 [concrete = constants.%J.facet.ee5] +// CHECK:STDOUT: %J.facet.loc33_27.2: %J.type = facet_value constants.%E, (constants.%J.impl_witness) [concrete = constants.%J.facet.ee5] +// CHECK:STDOUT: %.loc33_27.2: %J.type = converted constants.%E, %J.facet.loc33_27.2 [concrete = constants.%J.facet.ee5] // CHECK:STDOUT: %GenericCallF.specific_fn: = specific_function %GenericCallF.ref, @GenericCallF(constants.%J.facet.ee5) [concrete = constants.%GenericCallF.specific_fn] // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc29_26.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %bound_method.loc33_26.1: = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound.ef9] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc29_26.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.b92] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc29_26.2(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc29_26.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc29_26.2: %i32 = converted %int_2, %.loc29_26.1 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %GenericCallF.call: init %i32 = call %GenericCallF.specific_fn(%e.ref, %.loc29_26.2) -// CHECK:STDOUT: %.loc29_28.1: %i32 = value_of_initializer %GenericCallF.call -// CHECK:STDOUT: %.loc29_28.2: %i32 = converted %GenericCallF.call, %.loc29_28.1 -// CHECK:STDOUT: return %.loc29_28.2 +// CHECK:STDOUT: %bound_method.loc33_26.2: = bound_method %int_2, %specific_fn [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc33_26.2(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc33_26.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc33_26.2: %i32 = converted %int_2, %.loc33_26.1 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %GenericCallF.call: init %i32 = call %GenericCallF.specific_fn(%e.ref, %.loc33_26.2) +// CHECK:STDOUT: %.loc33_28.1: %i32 = value_of_initializer %GenericCallF.call +// CHECK:STDOUT: %.loc33_28.2: %i32 = converted %GenericCallF.call, %.loc33_28.1 +// CHECK:STDOUT: return %.loc33_28.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @U(constants.%Self.ccd) {} @@ -1601,12 +1493,12 @@ fn F() { // CHECK:STDOUT: specific @U(constants.%J.facet.5210a7.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericCallF(constants.%T.ccd) { -// CHECK:STDOUT: %T.loc24_17.2 => constants.%T.ccd -// CHECK:STDOUT: %T.as_type.loc24_27.2 => constants.%T.as_type.3df -// CHECK:STDOUT: %pattern_type.loc24_24 => constants.%pattern_type.4ca604.2 +// CHECK:STDOUT: %T.loc28_17.2 => constants.%T.ccd +// CHECK:STDOUT: %T.as_type.loc28_27.2 => constants.%T.as_type.3df +// CHECK:STDOUT: %pattern_type.loc28_24 => constants.%pattern_type.4ca604.2 // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.lookup_impl_witness.64628e.2 -// CHECK:STDOUT: %impl.elem0.loc24_34.2 => constants.%impl.elem0.11fef0.2 -// CHECK:STDOUT: %pattern_type.loc24_30 => constants.%pattern_type.b984e7.2 +// CHECK:STDOUT: %impl.elem0.loc28_34.2 => constants.%impl.elem0.11fef0.2 +// CHECK:STDOUT: %pattern_type.loc28_30 => constants.%pattern_type.b984e7.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%J.facet.5210a7.2) { @@ -1617,20 +1509,20 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GenericCallF(constants.%J.facet.ee5) { -// CHECK:STDOUT: %T.loc24_17.2 => constants.%J.facet.ee5 -// CHECK:STDOUT: %T.as_type.loc24_27.2 => constants.%E -// CHECK:STDOUT: %pattern_type.loc24_24 => constants.%pattern_type.a4a +// CHECK:STDOUT: %T.loc28_17.2 => constants.%J.facet.ee5 +// CHECK:STDOUT: %T.as_type.loc28_27.2 => constants.%E +// CHECK:STDOUT: %pattern_type.loc28_24 => constants.%pattern_type.a4a // CHECK:STDOUT: %J.lookup_impl_witness => constants.%J.impl_witness -// CHECK:STDOUT: %impl.elem0.loc24_34.2 => constants.%i32 -// CHECK:STDOUT: %pattern_type.loc24_30 => constants.%pattern_type.7ce +// CHECK:STDOUT: %impl.elem0.loc28_34.2 => constants.%i32 +// CHECK:STDOUT: %pattern_type.loc28_30 => constants.%pattern_type.7ce // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc24_38 => constants.%complete_type.f8a -// CHECK:STDOUT: %require_complete.loc24_25 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc28_38 => constants.%complete_type.f8a +// CHECK:STDOUT: %require_complete.loc28_25 => constants.%complete_type.357 // CHECK:STDOUT: %J.facet => constants.%J.facet.ee5 -// CHECK:STDOUT: %.loc25_11.2 => constants.%.29b -// CHECK:STDOUT: %impl.elem1.loc25_11.2 => constants.%F.b07 -// CHECK:STDOUT: %specific_impl_fn.loc25_11.2 => constants.%F.b07 +// CHECK:STDOUT: %.loc29_11.2 => constants.%.29b +// CHECK:STDOUT: %impl.elem1.loc29_11.2 => constants.%F.b07 +// CHECK:STDOUT: %specific_impl_fn.loc29_11.2 => constants.%F.b07 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_constraint_on_associated_type.carbon @@ -2381,7 +2273,7 @@ fn F() { // CHECK:STDOUT: %pattern_type.b98: type = pattern_type %impl.elem0.11f [symbolic] // CHECK:STDOUT: %F.type.c14: type = fn_type @F.1 [concrete] // CHECK:STDOUT: %F.b71: %F.type.c14 = struct_value () [concrete] -// CHECK:STDOUT: %assoc1.572: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete] +// CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.%F.decl [concrete] // CHECK:STDOUT: %E: type = class_type @E [concrete] // CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] @@ -2404,22 +2296,17 @@ fn F() { // CHECK:STDOUT: %F.b07d12.2: %F.type.b842fd.2 = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete] -// CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = 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: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: .AddWith = %Core.AddWith // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//prelude/operators/arithmetic, AddWith, loaded [concrete = constants.%AddWith.generic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -2455,7 +2342,7 @@ fn F() { // CHECK:STDOUT: %return.param: ref @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = out_param call_param1 // CHECK:STDOUT: %return: ref @F.1.%impl.elem0.loc5_11.1 (%impl.elem0.11f) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1.572] +// CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -2546,8 +2433,6 @@ fn F() { // CHECK:STDOUT: fn @F.2(%u.param: ) -> { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: = name_ref u, %u [concrete = ] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %impl.elem1: = impl_witness_access , element1 [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_impl_function.carbon b/toolchain/lower/testdata/function/generic/call_impl_function.carbon index 68f88e30c311..a4e6f65aba1e 100644 --- a/toolchain/lower/testdata/function/generic/call_impl_function.carbon +++ b/toolchain/lower/testdata/function/generic/call_impl_function.carbon @@ -8,7 +8,6 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/function/generic/call_impl_function.carbon -import Core library "io"; interface SomeInterface(T:! type) { fn F(x: T) -> T; @@ -19,7 +18,7 @@ class SomeParam {} class ImplsSomeInterface {} impl ImplsSomeInterface as SomeInterface(i32) { fn F(x: i32) -> i32 { - return x + x; + return -x; } } @@ -36,9 +35,7 @@ fn CallGenericMethod(T:! type, U:! SomeInterface(T), x: T) -> T { } fn G() { - var out : i32 = CallGenericMethod(i32, ImplsSomeInterface, 10); - Core.Print(out); - + CallGenericMethod(i32, ImplsSomeInterface, 10); // TODO: Fix above // CallGenericMethod(SomeParam, ImplsSomeInterface, {}); } @@ -47,38 +44,24 @@ fn G() { // CHECK:STDOUT: ; ModuleID = 'call_impl_function.carbon' // CHECK:STDOUT: source_filename = "call_impl_function.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @printf.int.format = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 -// CHECK:STDOUT: // CHECK:STDOUT: define i32 @"_CF.ImplsSomeInterface.Main:SomeInterface.Main"(i32 %x) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %int.sadd = add i32 %x, %x, !dbg !7 -// CHECK:STDOUT: ret i32 %int.sadd, !dbg !8 +// CHECK:STDOUT: %int.snegate = sub i32 0, %x, !dbg !7 +// CHECK:STDOUT: ret i32 %int.snegate, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define void @_CG.Main() !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %out.var = alloca i32, align 4, !dbg !10 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %out.var), !dbg !10 -// CHECK:STDOUT: %CallGenericMethod.call = call i32 @_CCallGenericMethod.Main.b330a91dfda257ee(i32 10), !dbg !11 -// CHECK:STDOUT: store i32 %CallGenericMethod.call, ptr %out.var, align 4, !dbg !10 -// CHECK:STDOUT: %.loc40 = load i32, ptr %out.var, align 4, !dbg !12 -// CHECK:STDOUT: %print.int = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %.loc40), !dbg !13 -// CHECK:STDOUT: ret void, !dbg !14 +// CHECK:STDOUT: %CallGenericMethod.call = call i32 @_CCallGenericMethod.Main.b330a91dfda257ee(i32 10), !dbg !10 +// CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) -// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #0 -// CHECK:STDOUT: -// CHECK:STDOUT: define linkonce_odr i32 @_CCallGenericMethod.Main.b330a91dfda257ee(i32 %x) !dbg !15 { +// CHECK:STDOUT: define linkonce_odr i32 @_CCallGenericMethod.Main.b330a91dfda257ee(i32 %x) !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc35_15 = call i32 @"_CF.ImplsSomeInterface.Main:SomeInterface.Main"(i32 %x), !dbg !16 -// CHECK:STDOUT: ret i32 %.loc35_15, !dbg !17 +// CHECK:STDOUT: %.loc34_15 = call i32 @"_CF.ImplsSomeInterface.Main:SomeInterface.Main"(i32 %x), !dbg !13 +// CHECK:STDOUT: ret i32 %.loc34_15, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: declare i32 @printf(ptr, ...) -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: @@ -86,17 +69,14 @@ fn G() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "call_impl_function.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.ImplsSomeInterface.Main:SomeInterface.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.ImplsSomeInterface.Main:SomeInterface.Main", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 22, column: 12, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 22, column: 5, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 38, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !10 = !DILocation(line: 39, column: 3, scope: !9) -// CHECK:STDOUT: !11 = !DILocation(line: 39, column: 19, scope: !9) -// CHECK:STDOUT: !12 = !DILocation(line: 40, column: 14, scope: !9) -// CHECK:STDOUT: !13 = !DILocation(line: 40, column: 3, scope: !9) -// CHECK:STDOUT: !14 = !DILocation(line: 38, column: 1, scope: !9) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "CallGenericMethod", linkageName: "_CCallGenericMethod.Main.b330a91dfda257ee", scope: null, file: !3, line: 34, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !16 = !DILocation(line: 35, column: 10, scope: !15) -// CHECK:STDOUT: !17 = !DILocation(line: 35, column: 3, scope: !15) +// CHECK:STDOUT: !7 = !DILocation(line: 21, column: 12, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 21, column: 5, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 37, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = !DILocation(line: 38, column: 3, scope: !9) +// CHECK:STDOUT: !11 = !DILocation(line: 37, column: 1, scope: !9) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "CallGenericMethod", linkageName: "_CCallGenericMethod.Main.b330a91dfda257ee", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !13 = !DILocation(line: 34, column: 10, scope: !12) +// CHECK:STDOUT: !14 = !DILocation(line: 34, column: 3, scope: !12) diff --git a/toolchain/lower/testdata/function/generic/cross_library_name_collision_private.carbon b/toolchain/lower/testdata/function/generic/cross_library_name_collision_private.carbon index b6499963e664..2e75162b2095 100644 --- a/toolchain/lower/testdata/function/generic/cross_library_name_collision_private.carbon +++ b/toolchain/lower/testdata/function/generic/cross_library_name_collision_private.carbon @@ -37,14 +37,16 @@ fn Lib2CallF[T:! type](a: T, b: T) -> T { // --- todo_use.carbon -// TODO: This should call the `F` from lib1 and the `F` from lib2, and return 3. -// Currently it calls the same function twice. +// TODO: This should call the `F` from lib1 and the `F` from lib2. Currently +// it calls the same function in both (hashes match for both instances of +// `call i32 @_CF.Main.`). import library "lib1"; import library "lib2"; -fn Run() -> i32 { - return Lib1CallF(1 as i32, 2 as i32) + Lib2CallF(1 as i32, 2 as i32); +fn Run() { + let a: i32 = Lib1CallF(1 as i32, 2 as i32); + let b: i32 = Lib2CallF(1 as i32, 2 as i32); } // CHECK:STDOUT: ; ModuleID = 'lib1.carbon' @@ -70,12 +72,11 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'todo_use.carbon' // CHECK:STDOUT: source_filename = "todo_use.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() !dbg !4 { +// CHECK:STDOUT: define void @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Lib1CallF.call = call i32 @_CLib1CallF.Main.b88d1103f417c6d4(i32 1, i32 2), !dbg !7 // CHECK:STDOUT: %Lib2CallF.call = call i32 @_CLib2CallF.Main.b88d1103f417c6d4(i32 1, i32 2), !dbg !8 -// CHECK:STDOUT: %int.sadd = add i32 %Lib1CallF.call, %Lib2CallF.call, !dbg !7 -// CHECK:STDOUT: ret i32 %int.sadd, !dbg !9 +// CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define linkonce_odr i32 @_CLib1CallF.Main.b88d1103f417c6d4(i32 %a, i32 %b) !dbg !10 { @@ -102,12 +103,12 @@ fn Run() -> i32 { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "todo_use.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 9, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 9, column: 10, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 9, column: 42, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 9, column: 3, scope: !4) +// CHECK:STDOUT: !7 = !DILocation(line: 10, column: 16, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 11, column: 16, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 9, column: 1, scope: !4) // CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Lib1CallF", linkageName: "_CLib1CallF.Main.b88d1103f417c6d4", scope: null, file: !11, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DIFile(filename: "lib1.carbon", directory: "") // CHECK:STDOUT: !12 = !DILocation(line: 9, column: 10, scope: !10)