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:
+3
-3
@@ -16,7 +16,7 @@ class NoParams {}
|
||||
class EmptyParams() {}
|
||||
|
||||
var v: NoParams;
|
||||
// CHECK:STDERR: fail_empty_params.carbon:[[@LINE+7]]:1: error: cannot implicitly convert value of type `NoParams` to `EmptyParams()` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_empty_params.carbon:[[@LINE+7]]:1: error: cannot implicitly convert expression of type `NoParams` to `EmptyParams()` [ConversionFailure]
|
||||
// CHECK:STDERR: var w: EmptyParams() = v;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_empty_params.carbon:[[@LINE+4]]:1: note: type `NoParams` does not implement interface `Core.ImplicitAs(EmptyParams())` [MissingImplInMemberAccessNote]
|
||||
@@ -37,7 +37,7 @@ class Outer(T:! type) {
|
||||
var v: Outer({}*);
|
||||
|
||||
// TODO: It would be nice to include the `Outer({}*).` prefix in the name of `Inner`.
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+7]]:1: error: cannot implicitly convert value of type `Outer({}*)` to `Inner({.a: i32}*)` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+7]]:1: error: cannot implicitly convert expression of type `Outer({}*)` to `Inner({.a: i32}*)` [ConversionFailure]
|
||||
// CHECK:STDERR: var w: Outer({}*).Inner({.a: i32}*) = v;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nested.carbon:[[@LINE+4]]:1: note: type `Outer({}*)` does not implement interface `Core.ImplicitAs(Inner({.a: i32}*))` [MissingImplInMemberAccessNote]
|
||||
@@ -52,7 +52,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
class C(N:! i32) {}
|
||||
|
||||
// CHECK:STDERR: fail_int_value.carbon:[[@LINE+7]]:1: error: cannot implicitly convert value of type `()` to `C(123)` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_value.carbon:[[@LINE+7]]:1: error: cannot implicitly convert expression of type `()` to `C(123)` [ConversionFailure]
|
||||
// CHECK:STDERR: var v: C(123) = ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_int_value.carbon:[[@LINE+4]]:1: note: type `()` does not implement interface `Core.ImplicitAs(C(123))` [MissingImplInMemberAccessNote]
|
||||
|
||||
Reference in New Issue
Block a user