mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Change conversion diagnostic from saying "value" to "expression" (#5221)
Avoids TODO to make the message change based on the expression category. Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ interface I {
|
||||
let V:! Self;
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_assoc_const_mismatch.carbon:[[@LINE+7]]:12: error: cannot implicitly convert value of type `Core.IntLiteral` to `{}` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_assoc_const_mismatch.carbon:[[@LINE+7]]:12: error: cannot implicitly convert expression of type `Core.IntLiteral` to `{}` [ConversionFailure]
|
||||
// CHECK:STDERR: impl {} as I where .V = 0 {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_assoc_const_mismatch.carbon:[[@LINE+4]]:12: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs({})` [MissingImplInMemberAccessNote]
|
||||
|
||||
@@ -26,7 +26,7 @@ fn F(V:! I) -> V.T {
|
||||
// lookup would find an impl with more specific values for associated
|
||||
// constants that we should merge.
|
||||
|
||||
// CHECK:STDERR: fail_todo_keep_looking_for_final_impl.carbon:[[@LINE+7]]:3: error: cannot implicitly convert value of type `()` to `V.(I.T)` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_keep_looking_for_final_impl.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `()` to `V.(I.T)` [ConversionFailure]
|
||||
// CHECK:STDERR: return ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_keep_looking_for_final_impl.carbon:[[@LINE+4]]:3: note: type `()` does not implement interface `Core.ImplicitAs(V.(I.T))` [MissingImplInMemberAccessNote]
|
||||
|
||||
@@ -237,7 +237,7 @@ fn F[D:! Y](d: D) {
|
||||
// The FacetValue deduced for the param of `C` will be a symbolic FacetValue
|
||||
// because we are in a generic where `D` is an unknown type, which will cause
|
||||
// the query and impl self type to be C(FacetValue) for a symbolic FacetValue.
|
||||
// CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+7]]:23: error: cannot implicitly convert value of type `()` to `<symbolic>` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+7]]:23: error: cannot implicitly convert expression of type `()` to `<symbolic>` [ConversionFailure]
|
||||
// CHECK:STDERR: let a: C(D).(Z.X) = ();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_specialized_class_with_symbolic_facet_value_param.carbon:[[@LINE+4]]:23: note: type `()` does not implement interface `Core.ImplicitAs(<symbolic>)` [MissingImplInMemberAccessNote]
|
||||
@@ -324,7 +324,7 @@ impl forall [T:! type] T as Z(C) where .X = C {}
|
||||
fn F[U:! type](T:! Z(C)) {
|
||||
// TODO: The value of `.X` can be known to be `C` here when the impl `T as Z(C)` is
|
||||
// final.
|
||||
// CHECK:STDERR: fail_todo_final_specialization_before_generic_use_of_type_constant.carbon:[[@LINE+7]]:16: error: cannot implicitly convert value of type `C` to `T.(Z(C).X)` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_final_specialization_before_generic_use_of_type_constant.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `C` to `T.(Z(C).X)` [ConversionFailure]
|
||||
// CHECK:STDERR: let a: T.X = {} as C;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_final_specialization_before_generic_use_of_type_constant.carbon:[[@LINE+4]]:16: note: type `C` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote]
|
||||
@@ -347,7 +347,7 @@ impl forall [T:! type, U:! type] T as Z(U) where .X = () {}
|
||||
|
||||
fn F[U:! type](T:! Z(C)) {
|
||||
// The value of `.X` is symbolic, it can't be assigned a value of type `C`.
|
||||
// CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+7]]:16: error: cannot implicitly convert value of type `C` to `T.(Z(C).X)` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `C` to `T.(Z(C).X)` [ConversionFailure]
|
||||
// CHECK:STDERR: let a: T.X = {} as C;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_specialization_written_after_generic_use_of_type_constant.carbon:[[@LINE+4]]:16: note: type `C` does not implement interface `Core.ImplicitAs(T.(Z(C).X))` [MissingImplInMemberAccessNote]
|
||||
@@ -449,7 +449,7 @@ fn H[W:! type](v: W) -> W.(I.T) {
|
||||
// While this function is still a generic context, it should see the concrete
|
||||
// `X` type and the return of `H(p)` should convert (a no-op) to `X`.
|
||||
fn G[X:! type](p: X*) -> X {
|
||||
// CHECK:STDERR: fail_todo_specialization_of_type_constant_in_generic_context_with_final_impl.carbon:[[@LINE+7]]:3: error: cannot implicitly convert value of type `<symbolic>` to `X` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_specialization_of_type_constant_in_generic_context_with_final_impl.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `<symbolic>` to `X` [ConversionFailure]
|
||||
// CHECK:STDERR: return H(p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_specialization_of_type_constant_in_generic_context_with_final_impl.carbon:[[@LINE+4]]:3: note: type `<symbolic>` does not implement interface `Core.ImplicitAs(X)` [MissingImplInMemberAccessNote]
|
||||
|
||||
+3
-3
@@ -116,7 +116,7 @@ interface J {
|
||||
}
|
||||
|
||||
fn GenericCallFI32[T:! J where .U = i32](t: T) -> i32 {
|
||||
// CHECK:STDERR: fail_todo_use_where.carbon:[[@LINE+17]]:14: error: cannot implicitly convert value of type `Core.IntLiteral` to `T.(J.U)` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_where.carbon:[[@LINE+17]]:14: error: cannot implicitly convert expression of type `Core.IntLiteral` to `T.(J.U)` [ConversionFailure]
|
||||
// CHECK:STDERR: return t.F(2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_use_where.carbon:[[@LINE+14]]:14: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(T.(J.U))` [MissingImplInMemberAccessNote]
|
||||
@@ -126,7 +126,7 @@ fn GenericCallFI32[T:! J where .U = i32](t: T) -> i32 {
|
||||
// CHECK:STDERR: fn F(u: U) -> U;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_use_where.carbon:[[@LINE+7]]:3: error: cannot implicitly convert value of type `T.(J.U)` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_use_where.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `T.(J.U)` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: return t.F(2);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_use_where.carbon:[[@LINE+4]]:3: note: type `T.(J.U)` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote]
|
||||
@@ -283,7 +283,7 @@ fn F() {
|
||||
// TODO: `D.(Z.X)` is `C(D)`, but is incorrecty treated only as the symbolic
|
||||
// `C(T)` here which fails to convert.
|
||||
|
||||
// CHECK:STDERR: fail_todo_symbolic_associated_type_in_concrete_context.carbon:[[@LINE+7]]:20: error: cannot implicitly convert value of type `C(D)` to `C(T)` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_symbolic_associated_type_in_concrete_context.carbon:[[@LINE+7]]:20: error: cannot implicitly convert expression of type `C(D)` to `C(T)` [ConversionFailure]
|
||||
// CHECK:STDERR: let a: D.(Z.X) = {} as C(D);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_symbolic_associated_type_in_concrete_context.carbon:[[@LINE+4]]:20: note: type `C(D)` does not implement interface `Core.ImplicitAs(C(T))` [MissingImplInMemberAccessNote]
|
||||
|
||||
Reference in New Issue
Block a user