|
|
@@ -2,7 +2,7 @@
|
|
|
// Exceptions. See /LICENSE for license information.
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
//
|
|
|
-// EXTRA-ARGS: --no-prelude-import
|
|
|
+// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
|
|
|
//
|
|
|
// AUTOUPDATE
|
|
|
// TIP: To test this file alone, run:
|
|
|
@@ -119,7 +119,10 @@ impl A as X {
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
interface I {
|
|
|
- // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE+3]]:8: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
|
|
|
+ // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE+6]]:8: error: cannot implicitly convert expression of type `A` to `B` [ConversionFailure]
|
|
|
+ // CHECK:STDERR: fn F(a: Self);
|
|
|
+ // CHECK:STDERR: ^~~~~~~
|
|
|
+ // CHECK:STDERR: fail_param_type_mismatch.carbon:[[@LINE+3]]:8: note: type `A` does not implement interface `Core.ImplicitAs(B)` [MissingImplInMemberAccessNote]
|
|
|
// CHECK:STDERR: fn F(a: Self);
|
|
|
// CHECK:STDERR: ^~~~~~~
|
|
|
fn F(a: Self);
|
|
|
@@ -151,10 +154,13 @@ class A {}
|
|
|
class B {}
|
|
|
|
|
|
impl A as I {
|
|
|
- // CHECK:STDERR: fail_return_mismatch.carbon:[[@LINE+7]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
|
|
|
+ // CHECK:STDERR: fail_return_mismatch.carbon:[[@LINE+10]]:3: error: cannot implicitly convert expression of type `B` to `A` [ConversionFailure]
|
|
|
+ // CHECK:STDERR: fn F() -> B;
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~~~
|
|
|
+ // CHECK:STDERR: fail_return_mismatch.carbon:[[@LINE+7]]:3: note: type `B` does not implement interface `Core.ImplicitAs(A)` [MissingImplInMemberAccessNote]
|
|
|
// CHECK:STDERR: fn F() -> B;
|
|
|
// CHECK:STDERR: ^~~~~~~~~~~~
|
|
|
- // CHECK:STDERR: fail_return_mismatch.carbon:[[@LINE-10]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
|
|
+ // CHECK:STDERR: fail_return_mismatch.carbon:[[@LINE-13]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
|
|
// CHECK:STDERR: fn F() -> Self;
|
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
|
|
// CHECK:STDERR:
|
|
|
@@ -233,17 +239,20 @@ class B;
|
|
|
|
|
|
class C {
|
|
|
impl as I(B) {
|
|
|
- // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+14]]:5: note: while building thunk calling this function [ThunkCallee]
|
|
|
+ // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+17]]:5: note: while building thunk calling this function [ThunkCallee]
|
|
|
// CHECK:STDERR: fn F(c: C);
|
|
|
// CHECK:STDERR: ^~~~~~~~~~~
|
|
|
// CHECK:STDERR:
|
|
|
- // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE-14]]:8: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
|
|
|
+ // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE-14]]:8: error: cannot implicitly convert expression of type `B` to `C` [ConversionFailure]
|
|
|
+ // CHECK:STDERR: fn F(a: T);
|
|
|
+ // CHECK:STDERR: ^~~~
|
|
|
+ // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE-17]]:8: note: type `B` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote]
|
|
|
// CHECK:STDERR: fn F(a: T);
|
|
|
// CHECK:STDERR: ^~~~
|
|
|
// CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE+7]]:10: note: initializing function parameter [InCallToFunctionParam]
|
|
|
// CHECK:STDERR: fn F(c: C);
|
|
|
// CHECK:STDERR: ^~~~
|
|
|
- // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE-20]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
|
|
+ // CHECK:STDERR: fail_param_type_incomplete.carbon:[[@LINE-23]]:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
|
|
// CHECK:STDERR: fn F(a: T);
|
|
|
// CHECK:STDERR: ^~~~~~~~~~~
|
|
|
// CHECK:STDERR:
|
|
|
@@ -322,6 +331,9 @@ impl () as I({}) {
|
|
|
// CHECK:STDOUT: %struct: %struct_type.c.d.15a = struct_value (%empty_tuple, %empty_struct) [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl: %.loc8_7.2 as %I.ref {
|
|
|
// CHECK:STDOUT: %F.decl.loc10_48.1: %F.type.39e918.1 = fn_decl @F.2 [concrete = constants.%F.c04b92.1] {
|
|
|
// CHECK:STDOUT: %y.patt: %pattern_type.231 = binding_pattern y [concrete]
|
|
|
@@ -398,6 +410,9 @@ impl () as I({}) {
|
|
|
// CHECK:STDOUT: %F.5161e9.2: %F.type.f1b0b1.2 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl: %B.ref as %X.ref {
|
|
|
// CHECK:STDOUT: %F.decl.loc14_39.1: %F.type.f1b0b1.1 = fn_decl @F.2 [concrete = constants.%F.5161e9.1] {
|
|
|
// CHECK:STDOUT: %self.patt: %pattern_type.5f8 = binding_pattern self [concrete]
|
|
|
@@ -469,6 +484,9 @@ impl () as I({}) {
|
|
|
// CHECK:STDOUT: %F.5161e9.2: %F.type.f1b0b1.2 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl: %B.ref as %X.ref {
|
|
|
// CHECK:STDOUT: %F.decl.loc13_26.1: %F.type.f1b0b1.1 = fn_decl @F.2 [concrete = constants.%F.5161e9.1] {
|
|
|
// CHECK:STDOUT: %self.patt: %pattern_type.c10 = binding_pattern self [concrete]
|
|
|
@@ -525,6 +543,9 @@ impl () as I({}) {
|
|
|
// CHECK:STDOUT: %F.5161e9.2: %F.type.f1b0b1.2 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl: %B.ref as %X.ref {
|
|
|
// CHECK:STDOUT: %F.decl.loc14_39.1: %F.type.f1b0b1.1 = fn_decl @F.2 [concrete = constants.%F.5161e9.1] {
|
|
|
// CHECK:STDOUT: %self.patt: %pattern_type.5f8 = binding_pattern self [concrete]
|
|
|
@@ -595,6 +616,9 @@ impl () as I({}) {
|
|
|
// CHECK:STDOUT: %F.77e9d5.2: %F.type.b24d6f.2 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl: %A.ref as %X.ref {
|
|
|
// CHECK:STDOUT: %F.decl.loc20_14.1: %F.type.b24d6f.1 = fn_decl @F.2 [concrete = constants.%F.77e9d5.1] {
|
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.049 = return_slot_pattern [concrete]
|
|
|
@@ -649,6 +673,9 @@ impl () as I({}) {
|
|
|
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.c04b92.1, @F.2(%ptr.79f) [symbolic]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl: %.loc8_7.2 as %I.ref {
|
|
|
// CHECK:STDOUT: %F.decl.loc10_29.1: %F.type.39e918.1 = fn_decl @F.2 [concrete = constants.%F.c04b92.1] {
|
|
|
// CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
|
|
|
@@ -746,6 +773,9 @@ impl () as I({}) {
|
|
|
// CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %U [symbolic]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl: %.loc10_7.2 as %I.ref {
|
|
|
// CHECK:STDOUT: %F.decl.loc19_39.1: %F.type.39e918.1 = fn_decl @F.2 [concrete = constants.%F.c04b92.1] {
|
|
|
// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete]
|
|
|
@@ -834,6 +864,9 @@ impl () as I({}) {
|
|
|
// CHECK:STDOUT: %struct: %struct_type.a.b.f95 = struct_value (%empty_struct, %empty_struct) [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl: %.loc8_7.2 as %I.type {
|
|
|
// CHECK:STDOUT: %F.decl.loc10_29.1: %F.type.29ab63.1 = fn_decl @F.2 [concrete = constants.%F.975709.1] {
|
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.914 = return_slot_pattern [concrete]
|