Suppress follow-on errors for various forms of expression. (#3292)

Don't produce an error diagnostic if any of the information leading to
identifying that error is itself known to be affected by an
already-diagnosed error.
This commit is contained in:
Richard Smith
2023-10-13 05:01:03 +00:00
committed by GitHub
parent a79ea4b28d
commit 870ccf3eac
12 changed files with 138 additions and 17 deletions
@@ -5,9 +5,6 @@
// AUTOUPDATE
fn A() {
// CHECK:STDERR: fail_dereference_function.carbon:[[@LINE+6]]:3: ERROR: Cannot dereference operand of non-pointer type `<function>`.
// CHECK:STDERR: *A;
// CHECK:STDERR: ^
// CHECK:STDERR: fail_dereference_function.carbon:[[@LINE+3]]:4: ERROR: Expression cannot be used as a value.
// CHECK:STDERR: *A;
// CHECK:STDERR: ^
@@ -21,6 +18,6 @@ fn A() {
// CHECK:STDOUT: fn @A() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_reference "A", package.%A
// CHECK:STDOUT: %.loc14: ref <error> = dereference <error>
// CHECK:STDOUT: %.loc11: ref <error> = dereference <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }