You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add min_prelude/convert.carbon to tests missing ImplicitAs (#5677)
import_use_generic.carbon has the comment "// We're just checking that
this doesn't crash. It's not expected to compile." Because it involves
import behavior by name, I'm not touching it. Other than that, while
maybe it's better to test with less, the `ImplicitAs` errors at best
feel difficult to understand, and at worst could be masking an issue.
// CHECK:STDERR: fail_invalid_element.carbon:[[@LINE+4]]:14: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
99
+
// CHECK:STDERR: fail_invalid_element.carbon:[[@LINE+7]]:14: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
100
+
// CHECK:STDERR: var a: array(1, 1);
101
+
// CHECK:STDERR: ^
102
+
// CHECK:STDERR: fail_invalid_element.carbon:[[@LINE+4]]:14: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
// CHECK:STDERR: fail_arg_wrong_type.carbon:[[@LINE+4]]:22: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
19
+
// CHECK:STDERR: fail_arg_wrong_type.carbon:[[@LINE+7]]:22: error: cannot implicitly convert expression of type `String` to `C` [ConversionFailure]
20
+
// CHECK:STDERR: var a: array(C, 3) = ({}, "Hello", "World");
21
+
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
22
+
// CHECK:STDERR: fail_arg_wrong_type.carbon:[[@LINE+4]]:22: note: type `String` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote]
20
23
// CHECK:STDERR: var a: array(C, 3) = ({}, "Hello", "World");
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:14: error: name `Core.ImplicitAs` implicitly referenced here, but not found [CoreNameNotFound]
17
+
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+7]]:14: error: cannot implicitly convert expression of type `T` to `U` [ConversionFailure]
18
+
// CHECK:STDERR: let n: U = *p;
19
+
// CHECK:STDERR: ^~
20
+
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:14: note: type `T` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote]
18
21
// CHECK:STDERR: let n: U = *p;
19
22
// CHECK:STDERR: ^~
20
23
// CHECK:STDERR:
@@ -34,13 +37,29 @@ fn F(T:! type, U:! type) {
34
37
// CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr [symbolic]
// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+4]]:6: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
17
+
// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+7]]:6: error: cannot implicitly convert non-type value of type `bool` to `type` [ConversionFailureNonTypeToFacet]
18
+
// CHECK:STDERR: impl true as I {}
19
+
// CHECK:STDERR: ^~~~
20
+
// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+4]]:6: note: type `bool` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
17
21
// CHECK:STDERR: impl true as I {}
18
22
// CHECK:STDERR: ^~~~
19
23
// CHECK:STDERR:
@@ -23,24 +27,37 @@ impl true as I {}
23
27
// CHECK:STDOUT:
24
28
// CHECK:STDOUT: constants {
25
29
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
0 commit comments