mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Update basic diagnostic capitalization/punctuation (#4328)
This is a primarily automated change:
- Search & replace for capitalization
-
`(CARBON_DIAGNOSTIC\((?:\n\s+)?\w+,(?:\n\s+)?\s\w+,(?:\n\s+)?\s")([A-Z])`
- `$1\L$2`
- Search & replace for period
-
`(CARBON_DIAGNOSTIC\((?:\n\s+)?\w+,(?:\n\s+)?\s\w+,(?:\n\s+)?\s"(?:[^)]|\n)+)\.("[,)])`
- `$1$2`
- Limited search & replace for `ERROR: ` -> `error: ` in streamed things
- Leaving a TODO for command_line because there's more cleanup that can
be done there
- Modify diagnostic_consumer.cpp
- ERROR -> error
- WARNING -> warning
---------
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
7f6d684b29
commit
e7aebbe581
+11
-11
@@ -8,63 +8,63 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/alias/fail_syntax.carbon
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: ERROR: `alias` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: error: `alias` introducer should be followed by a name
|
||||
// CHECK:STDERR: alias = b;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias = b;
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: ERROR: `alias` requires a `=` for the source.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: error: `alias` requires a `=` for the source
|
||||
// CHECK:STDERR: alias a b;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias a b;
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:10: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:10: error: expected expression
|
||||
// CHECK:STDERR: alias a =;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias a =;
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: ERROR: `alias` requires a `=` for the source.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: error: `alias` requires a `=` for the source
|
||||
// CHECK:STDERR: alias a;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias a;
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: ERROR: `alias` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: error: `alias` introducer should be followed by a name
|
||||
// CHECK:STDERR: alias =;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias =;
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: ERROR: `alias` requires a `=` for the source.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: error: `alias` requires a `=` for the source
|
||||
// CHECK:STDERR: alias a b c = d;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias a b c = d;
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:13: ERROR: `alias` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:13: error: `alias` declarations must end with a `;`
|
||||
// CHECK:STDERR: alias a = b c d;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias a = b c d;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: ERROR: `alias` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: error: `alias` introducer should be followed by a name
|
||||
// CHECK:STDERR: alias;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias;
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:12: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:12: error: expected expression
|
||||
// CHECK:STDERR: alias a =;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
alias a =;
|
||||
|
||||
alias a =
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:1: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:1: error: expected expression
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -72,7 +72,7 @@ fn F() {
|
||||
|
||||
alias a = b
|
||||
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+56]]:21: ERROR: `alias` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_syntax.carbon:[[@LINE+56]]:21: error: `alias` declarations must end with a `;`
|
||||
// CHECK:STDERR: // CHECK:STDOUT: ]
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDOUT: - filename: fail_syntax.carbon
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/array/fail_require_close_bracket.carbon
|
||||
// TODO: It should emit only one error message.
|
||||
|
||||
// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+7]]:8: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+7]]:8: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: [i32;;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:8: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:8: error: expected expression
|
||||
// CHECK:STDERR: var x: [i32;;
|
||||
// CHECK:STDERR: ^
|
||||
var x: [i32;;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/array/fail_require_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: ERROR: Expected `;` in array type.
|
||||
// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: error: expected `;` in array type
|
||||
// CHECK:STDERR: var x: [i32];
|
||||
// CHECK:STDERR: ^
|
||||
var x: [i32];
|
||||
|
||||
+13
-13
@@ -10,7 +10,7 @@
|
||||
|
||||
// --- fail_type.carbon
|
||||
|
||||
// CHECK:STDERR: fail_type.carbon:[[@LINE+4]]:12: ERROR: Expected `;` in array type.
|
||||
// CHECK:STDERR: fail_type.carbon:[[@LINE+4]]:12: error: expected `;` in array type
|
||||
// CHECK:STDERR: var x: [i32];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -18,19 +18,19 @@ var x: [i32];
|
||||
|
||||
// --- fail_invalid_char.carbon
|
||||
|
||||
// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+16]]:12: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+16]]:12: error: expected expression
|
||||
// CHECK:STDERR: fn X() -> [:];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+12]]:12: ERROR: Expected `;` in array type.
|
||||
// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+12]]:12: error: expected `;` in array type
|
||||
// CHECK:STDERR: fn X() -> [:];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+8]]:12: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+8]]:12: error: expected expression
|
||||
// CHECK:STDERR: fn X() -> [:];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+4]]:12: ERROR: Unexpected tokens before `]`.
|
||||
// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+4]]:12: error: unexpected tokens before `]`
|
||||
// CHECK:STDERR: fn X() -> [:];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -38,23 +38,23 @@ fn X() -> [:];
|
||||
|
||||
// --- fail_unlexed_expr.carbon
|
||||
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+20]]:9: ERROR: Encountered unrecognized characters while parsing.
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+20]]:9: error: encountered unrecognized characters while parsing
|
||||
// CHECK:STDERR: var y: [`];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+16]]:9: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+16]]:9: error: expected expression
|
||||
// CHECK:STDERR: var y: [`];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+12]]:9: ERROR: Expected `;` in array type.
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+12]]:9: error: expected `;` in array type
|
||||
// CHECK:STDERR: var y: [`];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+8]]:9: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+8]]:9: error: expected expression
|
||||
// CHECK:STDERR: var y: [`];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+4]]:9: ERROR: Unexpected tokens before `]`.
|
||||
// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+4]]:9: error: unexpected tokens before `]`
|
||||
// CHECK:STDERR: var y: [`];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -62,11 +62,11 @@ var y: [`];
|
||||
|
||||
// --- fail_no_close_bracket.carbon
|
||||
|
||||
// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+8]]:8: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+8]]:8: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: [i32;;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+4]]:8: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+4]]:8: error: expected expression
|
||||
// CHECK:STDERR: var x: [i32;;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -74,7 +74,7 @@ var x: [i32;;
|
||||
|
||||
// --- fail_no_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:12: ERROR: Expected `;` in array type.
|
||||
// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:12: error: expected `;` in array type
|
||||
// CHECK:STDERR: var x: [i32];
|
||||
// CHECK:STDERR: ^
|
||||
var x: [i32];
|
||||
|
||||
@@ -10,20 +10,20 @@
|
||||
|
||||
// This is a valid parse tree even though the lex errors.
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:11: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:11: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: ([i32; 3) = (0, 1, 2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var x: ([i32; 3) = (0, 1, 2);
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: {.y: (} = {.y = ((};
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: {.y: (} = {.y = ((};
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: {.y: (} = {.y = ((};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.y: (} = {.y = ((};
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
|
||||
// NOTE: Move to its own directory when more tests are added.
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`.
|
||||
// CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: error: expected identifier after `.`
|
||||
// CHECK:STDERR: a.;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
a.;
|
||||
// CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: ERROR: Expected identifier after `.`.
|
||||
// CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: error: expected identifier after `.`
|
||||
// CHECK:STDERR: a.fn;
|
||||
// CHECK:STDERR: ^~
|
||||
a.fn;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: protected virtual;
|
||||
// CHECK:STDERR: ^
|
||||
protected virtual;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: foo;
|
||||
// CHECK:STDERR: ^~~
|
||||
foo;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: foo bar baz
|
||||
// CHECK:STDERR: ^~~
|
||||
foo bar baz
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_paren_match_regression.carbon
|
||||
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+8]]:5: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+8]]:5: error: expected name in binding pattern
|
||||
// CHECK:STDERR: var = (foo {})
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+4]]:12: ERROR: Expected `,` or `)`.
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+4]]:12: error: expected `,` or `)`
|
||||
// CHECK:STDERR: var = (foo {})
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var = (foo {})
|
||||
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: ERROR: `var` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: error: `var` declarations must end with a `;`
|
||||
// CHECK:STDERR: // CHECK:STDOUT: ]
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDOUT: - filename: fail_paren_match_regression.carbon
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon
|
||||
|
||||
choice X {
|
||||
// CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+3]]:4: ERROR: Expected `,` or `}`.
|
||||
// CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+3]]:4: error: expected `,` or `}`
|
||||
// CHECK:STDERR: A[T:! type](value: T)
|
||||
// CHECK:STDERR: ^
|
||||
A[T:! type](value: T)
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon
|
||||
|
||||
choice InvalidAlternativeIdentifier {
|
||||
// CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+4]]:5: ERROR: Expected choice alternative name.
|
||||
// CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+4]]:5: error: expected choice alternative name
|
||||
// CHECK:STDERR: ,Some,
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
,Some,
|
||||
// CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+3]]:5: ERROR: Expected choice alternative name.
|
||||
// CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+3]]:5: error: expected choice alternative name
|
||||
// CHECK:STDERR: 42,
|
||||
// CHECK:STDERR: ^~
|
||||
42,
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_invalid_braces.carbon
|
||||
|
||||
// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+4]]:22: ERROR: Choice definition expected.
|
||||
// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+4]]:22: error: choice definition expected
|
||||
// CHECK:STDERR: choice InvalidBraces |
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
choice InvalidBraces |
|
||||
Some
|
||||
// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: |
|
||||
// CHECK:STDERR: ^
|
||||
|
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_missing_definition.carbon
|
||||
|
||||
// CHECK:STDERR: fail_missing_definition.carbon:[[@LINE+3]]:25: ERROR: Choice definition expected.
|
||||
// CHECK:STDERR: fail_missing_definition.carbon:[[@LINE+3]]:25: error: choice definition expected
|
||||
// CHECK:STDERR: choice MissingDefinition;
|
||||
// CHECK:STDERR: ^
|
||||
choice MissingDefinition;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon
|
||||
|
||||
// CHECK:STDERR: fail_missing_definition_parameterized.carbon:[[@LINE+3]]:35: ERROR: Choice definition expected.
|
||||
// CHECK:STDERR: fail_missing_definition_parameterized.carbon:[[@LINE+3]]:35: error: choice definition expected
|
||||
// CHECK:STDERR: choice MissingDefinition(T:! type);
|
||||
// CHECK:STDERR: ^
|
||||
choice MissingDefinition(T:! type);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon
|
||||
|
||||
choice X {
|
||||
// CHECK:STDERR: fail_qualified_alternative_name.carbon:[[@LINE+3]]:4: ERROR: Expected `,` or `}`.
|
||||
// CHECK:STDERR: fail_qualified_alternative_name.carbon:[[@LINE+3]]:4: error: expected `,` or `}`
|
||||
// CHECK:STDERR: A.B
|
||||
// CHECK:STDERR: ^
|
||||
A.B
|
||||
|
||||
+5
-5
@@ -36,7 +36,7 @@ adapt i32;
|
||||
// --- fail_bad_syntax.carbon
|
||||
|
||||
class A {
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:11: ERROR: `adapt` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:11: error: `adapt` declarations must end with a `;`
|
||||
// CHECK:STDERR: adapt 1 trailing_token;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -44,7 +44,7 @@ class A {
|
||||
}
|
||||
|
||||
class B {
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:8: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:8: error: expected expression
|
||||
// CHECK:STDERR: adapt;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -53,14 +53,14 @@ class B {
|
||||
|
||||
class C {
|
||||
adapt
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:1: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:1: error: expected expression
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
}
|
||||
|
||||
class D {
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:9: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:9: error: expected expression
|
||||
// CHECK:STDERR: adapt class;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -68,7 +68,7 @@ class D {
|
||||
}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+3]]:3: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+3]]:3: error: expected expression
|
||||
// CHECK:STDERR: adapt i32;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
adapt i32;
|
||||
|
||||
+4
-4
@@ -9,13 +9,13 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/class/fail_base.carbon
|
||||
|
||||
class A {
|
||||
// CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:7: ERROR: `class` or `:` expected after `base`.
|
||||
// CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:7: error: `class` or `:` expected after `base`
|
||||
// CHECK:STDERR: base;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
base;
|
||||
|
||||
// CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:9: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:9: error: expected expression
|
||||
// CHECK:STDERR: base: ;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -23,11 +23,11 @@ class A {
|
||||
|
||||
base: { }
|
||||
// We should resume parsing here after the previous error.
|
||||
// CHECK:STDERR: fail_base.carbon:[[@LINE+7]]:3: ERROR: `base` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_base.carbon:[[@LINE+7]]:3: error: `base` declarations must end with a `;`
|
||||
// CHECK:STDERR: var n: i32;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_base.carbon:[[@LINE+3]]:7: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_base.carbon:[[@LINE+3]]:7: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: var n: i32;
|
||||
// CHECK:STDERR: ^
|
||||
var n: i32;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
base class B {}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error: expected expression
|
||||
// CHECK:STDERR: base: B;
|
||||
// CHECK:STDERR: ^~~~
|
||||
base: B;
|
||||
|
||||
+3
-3
@@ -11,14 +11,14 @@
|
||||
// --- fail_virtual_class.carbon
|
||||
|
||||
virtual class B
|
||||
// CHECK:STDERR: fail_virtual_class.carbon:[[@LINE+4]]:1: ERROR: `virtual` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_virtual_class.carbon:[[@LINE+4]]:1: error: `virtual` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
|
||||
// --- fail_impl_class.carbon
|
||||
|
||||
// CHECK:STDERR: fail_impl_class.carbon:[[@LINE+4]]:1: ERROR: `impl` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_impl_class.carbon:[[@LINE+4]]:1: error: `impl` introducer should be followed by a name
|
||||
// CHECK:STDERR: impl class
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -27,7 +27,7 @@ impl class
|
||||
// --- fail_extend_adapt_base.carbon
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_extend_adapt_base.carbon:[[@LINE+3]]:16: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_extend_adapt_base.carbon:[[@LINE+3]]:16: error: expected expression
|
||||
// CHECK:STDERR: extend adapt base B;
|
||||
// CHECK:STDERR: ^~~~
|
||||
extend adapt base B;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon
|
||||
|
||||
fn foo() {
|
||||
// CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: ERROR: `:` should be replaced by `in`.
|
||||
// CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: error: `:` should be replaced by `in`
|
||||
// CHECK:STDERR: for (var x: i32 : y) {
|
||||
// CHECK:STDERR: ^
|
||||
for (var x: i32 : y) {
|
||||
|
||||
+4
-4
@@ -9,21 +9,21 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_cond.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+8]]:7: ERROR: Expected `(` after `for`.
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+8]]:7: error: expected `(` after `for`
|
||||
// CHECK:STDERR: for {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:7: ERROR: Expected `var` declaration.
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:7: error: expected `var` declaration
|
||||
// CHECK:STDERR: for {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
for {
|
||||
}
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+7]]:1: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+7]]:1: error: expected braced code block
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: error: expected expression
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_in.carbon
|
||||
|
||||
fn foo() {
|
||||
// CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: ERROR: Expected `in` after loop `var` declaration.
|
||||
// CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: error: expected `in` after loop `var` declaration
|
||||
// CHECK:STDERR: for (var x: i32 y) {
|
||||
// CHECK:STDERR: ^
|
||||
for (var x: i32 y) {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_var.carbon
|
||||
|
||||
fn foo() {
|
||||
// CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: ERROR: Expected `var` declaration.
|
||||
// CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: error: expected `var` declaration
|
||||
// CHECK:STDERR: for (x: i32 in y) {
|
||||
// CHECK:STDERR: ^
|
||||
for (x: i32 in y) {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
fn foo() -> i32 {
|
||||
// TODO: Should we allow this?
|
||||
// CHECK:STDERR: fail_returned_var.carbon:[[@LINE+3]]:8: ERROR: Expected `var` declaration.
|
||||
// CHECK:STDERR: fail_returned_var.carbon:[[@LINE+3]]:8: error: expected `var` declaration
|
||||
// CHECK:STDERR: for (returned var x: i32 in y) {
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
for (returned var x: i32 in y) {
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_square_brackets.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+15]]:7: ERROR: Expected `(` after `for`.
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+15]]:7: error: expected `(` after `for`
|
||||
// CHECK:STDERR: for [] {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:7: ERROR: Expected `var` declaration.
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:7: error: expected `var` declaration
|
||||
// CHECK:STDERR: for [] {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:8: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:8: error: expected expression
|
||||
// CHECK:STDERR: for [] {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: ERROR: Expected `;` in array type.
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: error: expected `;` in array type
|
||||
// CHECK:STDERR: for [] {
|
||||
// CHECK:STDERR: ^
|
||||
for [] {
|
||||
|
||||
@@ -22,7 +22,7 @@ extern library default fn G();
|
||||
|
||||
// --- fail_name_missing.carbon
|
||||
|
||||
// CHECK:STDERR: fail_name_missing.carbon:[[@LINE+4]]:16: ERROR: Expected `default` or a string literal to specify the library name.
|
||||
// CHECK:STDERR: fail_name_missing.carbon:[[@LINE+4]]:16: error: expected `default` or a string literal to specify the library name
|
||||
// CHECK:STDERR: extern library fn G();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
@@ -30,11 +30,11 @@ extern library fn G();
|
||||
|
||||
// --- fail_identifier.carbon
|
||||
|
||||
// CHECK:STDERR: fail_identifier.carbon:[[@LINE+7]]:16: ERROR: Expected `default` or a string literal to specify the library name.
|
||||
// CHECK:STDERR: fail_identifier.carbon:[[@LINE+7]]:16: error: expected `default` or a string literal to specify the library name
|
||||
// CHECK:STDERR: extern library foo fn G();
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_identifier.carbon:[[@LINE+3]]:16: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_identifier.carbon:[[@LINE+3]]:16: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: extern library foo fn G();
|
||||
// CHECK:STDERR: ^~~
|
||||
extern library foo fn G();
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon
|
||||
|
||||
// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: ERROR: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: fn foo bar;
|
||||
// CHECK:STDERR: ^~~
|
||||
fn foo bar;
|
||||
|
||||
+2
-2
@@ -9,11 +9,11 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon
|
||||
|
||||
// Fix and uncomment this to test error handling.
|
||||
// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+7]]:7: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+7]]:7: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: fn Div[();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+3]]:7: ERROR: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+3]]:7: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: fn Div[();
|
||||
// CHECK:STDERR: ^
|
||||
fn Div[();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_name.carbon
|
||||
|
||||
// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn ();
|
||||
// CHECK:STDERR: ^
|
||||
fn ();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
fn foo
|
||||
|
||||
// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+10]]:21: ERROR: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+10]]:21: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: // CHECK:STDOUT: ]
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDOUT: - filename: fail_no_sig_or_semi.carbon
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn;
|
||||
// CHECK:STDERR: ^
|
||||
fn;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn fn;
|
||||
// CHECK:STDERR: ^~
|
||||
fn fn;
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon
|
||||
|
||||
// CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn (x,
|
||||
// CHECK:STDERR: ^
|
||||
fn (x,
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn (x,
|
||||
// CHECK:STDERR: ^
|
||||
fn (x,
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn (x,
|
||||
// CHECK:STDERR: ^
|
||||
fn (x,
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn ()
|
||||
// CHECK:STDERR: ^
|
||||
fn ()
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon
|
||||
|
||||
// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: struct X { fn () }
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
struct X { fn () }
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon
|
||||
|
||||
// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: ERROR: Expected `:` or `:!` in binding pattern.
|
||||
// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: error: expected `:` or `:!` in binding pattern
|
||||
// CHECK:STDERR: fn foo(bar);
|
||||
// CHECK:STDERR: ^
|
||||
fn foo(bar);
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon
|
||||
|
||||
// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z);
|
||||
// CHECK:STDERR: ^
|
||||
fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z);
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/definition/fail_builtin.carbon
|
||||
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:18: ERROR: Expected builtin function name after `=`.
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:18: error: expected builtin function name after `=`
|
||||
// CHECK:STDERR: fn NotString() = banana;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn NotString() = banana;
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:32: ERROR: `fn` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:32: error: `fn` declarations must end with a `;`
|
||||
// CHECK:STDERR: fn JunkAfterString() = "hello" "world";
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn JunkAfterString() = "hello" "world";
|
||||
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+3]]:23: ERROR: Expected builtin function name after `=`.
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+3]]:23: error: expected builtin function name after `=`
|
||||
// CHECK:STDERR: fn SpuriousEquals() = { }
|
||||
// CHECK:STDERR: ^
|
||||
fn SpuriousEquals() = { }
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ fn F() {
|
||||
// Note: this might become valid depending on the expression syntax. This test
|
||||
// shouldn't be taken as a sign it should remain invalid.
|
||||
bar
|
||||
// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: ERROR: Expected `;` after expression statement.
|
||||
// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: error: expected `;` after expression statement
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
}
|
||||
|
||||
@@ -8,25 +8,25 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon
|
||||
|
||||
// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:12: ERROR: A `(` for parameters is required after implicit parameters.
|
||||
// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:12: error: a `(` for parameters is required after implicit parameters
|
||||
// CHECK:STDERR: class Foo[];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
class Foo[];
|
||||
|
||||
// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:18: ERROR: A `(` for parameters is required after implicit parameters.
|
||||
// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:18: error: a `(` for parameters is required after implicit parameters
|
||||
// CHECK:STDERR: class Foo[a: i32];
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
class Foo[a: i32];
|
||||
|
||||
// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:17: ERROR: A `(` for parameters is required after implicit parameters.
|
||||
// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:17: error: a `(` for parameters is required after implicit parameters
|
||||
// CHECK:STDERR: interface Bar[] {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
interface Bar[] {}
|
||||
|
||||
// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+3]]:23: ERROR: A `(` for parameters is required after implicit parameters.
|
||||
// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+3]]:23: error: a `(` for parameters is required after implicit parameters
|
||||
// CHECK:STDERR: interface Bar[a: i32] {}
|
||||
// CHECK:STDERR: ^
|
||||
interface Bar[a: i32] {}
|
||||
|
||||
+16
-16
@@ -8,87 +8,87 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/impl/fail_impl.carbon
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:10: ERROR: Expected `as` in `impl` declaration.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:10: error: expected `as` in `impl` declaration
|
||||
// CHECK:STDERR: impl foo bar;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
impl foo bar;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:12: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:12: error: expected expression
|
||||
// CHECK:STDERR: impl i32 as;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
impl i32 as;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:18: ERROR: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:18: error: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: impl bool as bar unexpected;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
impl bool as bar unexpected;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: error: expected expression
|
||||
// CHECK:STDERR: impl return as A;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
impl return as A;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: error: expected expression
|
||||
// CHECK:STDERR: impl return B;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
impl return B;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:13: ERROR: Expected `[` after `forall` in `impl` declaration.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:13: error: expected `[` after `forall` in `impl` declaration
|
||||
// CHECK:STDERR: impl forall f32;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:16: ERROR: Expected `as` in `impl` declaration.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:16: error: expected `as` in `impl` declaration
|
||||
// CHECK:STDERR: impl forall f32;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
impl forall f32;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:19: ERROR: Expected `as` in `impl` declaration.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:19: error: expected `as` in `impl` declaration
|
||||
// CHECK:STDERR: impl forall [] u32;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
impl forall [] u32;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:21: ERROR: Expected `:` or `:!` in binding pattern.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:21: error: expected `:` or `:!` in binding pattern
|
||||
// CHECK:STDERR: impl forall [invalid] i8;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:25: ERROR: Expected `as` in `impl` declaration.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:25: error: expected `as` in `impl` declaration
|
||||
// CHECK:STDERR: impl forall [invalid] i8;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
impl forall [invalid] i8;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:13: ERROR: Expected `[` after `forall` in `impl` declaration.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:13: error: expected `[` after `forall` in `impl` declaration
|
||||
// CHECK:STDERR: impl forall f16 as Quux;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
impl forall f16 as Quux;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:30: ERROR: Expected `as` in `impl` declaration.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:30: error: expected `as` in `impl` declaration
|
||||
// CHECK:STDERR: impl forall [T:! type] String;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
impl forall [T:! type] String;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:26: ERROR: Expected `as` in `impl` declaration.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:26: error: expected `as` in `impl` declaration
|
||||
// CHECK:STDERR: impl forall [T:! type] T missing_as;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
impl forall [T:! type] T missing_as;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:39: ERROR: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:39: error: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: impl forall [T:! type] T as Interface extra;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
impl forall [T:! type] T as Interface extra;
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:5: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:5: error: expected expression
|
||||
// CHECK:STDERR: impl;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -96,7 +96,7 @@ impl;
|
||||
|
||||
impl
|
||||
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+88]]:21: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_impl.carbon:[[@LINE+88]]:21: error: expected expression
|
||||
// CHECK:STDERR: // CHECK:STDOUT: ]
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDOUT: - filename: fail_impl.carbon
|
||||
|
||||
@@ -18,7 +18,7 @@ impl bool as Interface {
|
||||
fn F();
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+4]]:4: ERROR: `fn` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name
|
||||
// CHECK:STDERR: fn (bool as Interface).F() {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -30,7 +30,7 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+3]]:6: ERROR: `.` should be followed by a name.
|
||||
// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+3]]:6: error: `.` should be followed by a name
|
||||
// CHECK:STDERR: fn C.(Self as Interface).F() {}
|
||||
// CHECK:STDERR: ^
|
||||
fn C.(Self as Interface).F() {}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_missing_name.carbon
|
||||
|
||||
// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:11: ERROR: `interface` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:11: error: `interface` introducer should be followed by a name
|
||||
// CHECK:STDERR: interface {
|
||||
// CHECK:STDERR: ^
|
||||
interface {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon
|
||||
|
||||
// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+4]]:15: ERROR: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+4]]:15: error: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: interface Bar Baz {}
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
@@ -16,7 +16,7 @@ interface Bar Baz {}
|
||||
|
||||
interface Foo
|
||||
|
||||
// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+13]]:21: ERROR: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+13]]:21: error: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: // CHECK:STDOUT: ]
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDOUT: - filename: fail_missing_open_curly.carbon
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon
|
||||
|
||||
interface Foo {
|
||||
// CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+4]]:13: ERROR: Expected `:` or `:!` in binding pattern.
|
||||
// CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+4]]:13: error: expected `:` or `:!` in binding pattern
|
||||
// CHECK:STDERR: fn Sub[me Self](b: Self) -> Self;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
fn Sub[me Self](b: Self) -> Self;
|
||||
|
||||
// CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+3]]:10: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+3]]:10: error: expected name in binding pattern
|
||||
// CHECK:STDERR: fn Mul[Self](b: Self) -> Self;
|
||||
// CHECK:STDERR: ^~~~
|
||||
fn Mul[Self](b: Self) -> Self;
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:12: ERROR: `constraint` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:12: error: `constraint` introducer should be followed by a name
|
||||
// CHECK:STDERR: constraint "Foo"
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
constraint "Foo"
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: ERROR: `constraint` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error: `constraint` introducer should be followed by a name
|
||||
// CHECK:STDERR: constraint
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
constraint
|
||||
|
||||
+4
-4
@@ -10,24 +10,24 @@
|
||||
|
||||
fn F() {
|
||||
if (a)
|
||||
// CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:5: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:5: error: expected braced code block
|
||||
// CHECK:STDERR: if (b)
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
if (b)
|
||||
// CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block
|
||||
// CHECK:STDERR: c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
c;
|
||||
else
|
||||
// CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block
|
||||
// CHECK:STDERR: d;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
d;
|
||||
else
|
||||
// CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+3]]:5: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+3]]:5: error: expected braced code block
|
||||
// CHECK:STDERR: e;
|
||||
// CHECK:STDERR: ^
|
||||
e;
|
||||
|
||||
+5
-5
@@ -9,27 +9,27 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_errors.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:6: ERROR: Expected `(` after `if`.
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:6: error: expected `(` after `if`
|
||||
// CHECK:STDERR: if a {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
if a {}
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:7: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:7: error: expected expression
|
||||
// CHECK:STDERR: if () {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
if () {}
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:9: ERROR: Unexpected tokens before `)`.
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:9: error: unexpected tokens before `)`
|
||||
// CHECK:STDERR: if (b c) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
if (b c) {}
|
||||
if (d)
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+7]]:1: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+7]]:1: error: expected braced code block
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+3]]:1: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_errors.carbon:[[@LINE+3]]:1: error: expected expression
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_missing_cond.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:6: ERROR: Expected `(` after `if`.
|
||||
// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:6: error: expected `(` after `if`
|
||||
// CHECK:STDERR: if {
|
||||
// CHECK:STDERR: ^
|
||||
if {
|
||||
|
||||
+3
-3
@@ -9,15 +9,15 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_square_brackets.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:6: ERROR: Expected `(` after `if`.
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:6: error: expected `(` after `if`
|
||||
// CHECK:STDERR: if [] {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:7: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:7: error: expected expression
|
||||
// CHECK:STDERR: if [] {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:7: ERROR: Expected `;` in array type.
|
||||
// CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:7: error: expected `;` in array type
|
||||
// CHECK:STDERR: if [] {}
|
||||
// CHECK:STDERR: ^
|
||||
if [] {}
|
||||
|
||||
+3
-3
@@ -11,17 +11,17 @@
|
||||
|
||||
fn F() {
|
||||
if (a)
|
||||
// CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:5: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:5: error: expected braced code block
|
||||
// CHECK:STDERR: if (b)
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
if (b)
|
||||
// CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:7: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block
|
||||
// CHECK:STDERR: if (c)
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
if (c)
|
||||
// CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:9: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:9: error: expected braced code block
|
||||
// CHECK:STDERR: d;
|
||||
// CHECK:STDERR: ^
|
||||
d;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_condition_missing.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_condition_missing.carbon:[[@LINE+3]]:18: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_condition_missing.carbon:[[@LINE+3]]:18: error: expected expression
|
||||
// CHECK:STDERR: var n: i32 = if;
|
||||
// CHECK:STDERR: ^
|
||||
var n: i32 = if;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_else_expr_missing.carbon:[[@LINE+3]]:35: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_else_expr_missing.carbon:[[@LINE+3]]:35: error: expected expression
|
||||
// CHECK:STDERR: var n: i32 = if true then 1 else;
|
||||
// CHECK:STDERR: ^
|
||||
var n: i32 = if true then 1 else;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_else_missing.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_else_missing.carbon:[[@LINE+3]]:30: ERROR: Expected `else` after `if ... then ...`.
|
||||
// CHECK:STDERR: fail_else_missing.carbon:[[@LINE+3]]:30: error: expected `else` after `if ... then ...`
|
||||
// CHECK:STDERR: var n: i32 = if true then 1;
|
||||
// CHECK:STDERR: ^
|
||||
var n: i32 = if true then 1;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_then_expr_missing.carbon:[[@LINE+3]]:28: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_then_expr_missing.carbon:[[@LINE+3]]:28: error: expected expression
|
||||
// CHECK:STDERR: var n: i32 = if true then;
|
||||
// CHECK:STDERR: ^
|
||||
var n: i32 = if true then;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_then_missing.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_then_missing.carbon:[[@LINE+3]]:23: ERROR: Expected `then` after `if` condition.
|
||||
// CHECK:STDERR: fail_then_missing.carbon:[[@LINE+3]]:23: error: expected `then` after `if` condition
|
||||
// CHECK:STDERR: var n: i32 = if true;
|
||||
// CHECK:STDERR: ^
|
||||
var n: i32 = if true;
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_top_level_if.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+11]]:6: ERROR: Expected `(` after `if`.
|
||||
// CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+11]]:6: error: expected `(` after `if`
|
||||
// CHECK:STDERR: if true then 1 else 2;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+7]]:11: ERROR: Expected braced code block.
|
||||
// CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+7]]:11: error: expected braced code block
|
||||
// CHECK:STDERR: if true then 1 else 2;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+3]]:11: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+3]]:11: error: expected expression
|
||||
// CHECK:STDERR: if true then 1 else 2;
|
||||
// CHECK:STDERR: ^~~~
|
||||
if true then 1 else 2;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/index/fail_empty_expr.carbon
|
||||
|
||||
// CHECK:STDERR: fail_empty_expr.carbon:[[@LINE+3]]:16: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_empty_expr.carbon:[[@LINE+3]]:16: error: expected expression
|
||||
// CHECK:STDERR: var v: i32 = t[];
|
||||
// CHECK:STDERR: ^
|
||||
var v: i32 = t[];
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/index/fail_malformed_expr.carbon
|
||||
|
||||
// CHECK:STDERR: fail_malformed_expr.carbon:[[@LINE+3]]:17: ERROR: Unexpected tokens before `]`.
|
||||
// CHECK:STDERR: fail_malformed_expr.carbon:[[@LINE+3]]:17: error: unexpected tokens before `]`
|
||||
// CHECK:STDERR: var v: i32 = t[0,];
|
||||
// CHECK:STDERR: ^
|
||||
var v: i32 = t[0,];
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_bad_name.carbon
|
||||
|
||||
// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error: expected name in binding pattern
|
||||
// CHECK:STDERR: let ? = 4;
|
||||
// CHECK:STDERR: ^
|
||||
let ? = 4;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_empty.carbon
|
||||
|
||||
// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error: expected name in binding pattern
|
||||
// CHECK:STDERR: let;
|
||||
// CHECK:STDERR: ^
|
||||
let;
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@
|
||||
|
||||
// --- fail_runtime_binding.carbon
|
||||
|
||||
// CHECK:STDERR: fail_runtime_binding.carbon:[[@LINE+4]]:5: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_runtime_binding.carbon:[[@LINE+4]]:5: error: expected name in binding pattern
|
||||
// CHECK:STDERR: let : i32 = 4;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -18,7 +18,7 @@ let : i32 = 4;
|
||||
|
||||
// --- fail_complietime_binding.carbon
|
||||
|
||||
// CHECK:STDERR: fail_complietime_binding.carbon:[[@LINE+3]]:5: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_complietime_binding.carbon:[[@LINE+3]]:5: error: expected name in binding pattern
|
||||
// CHECK:STDERR: let :! bool = true;
|
||||
// CHECK:STDERR: ^~
|
||||
let :! bool = true;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_missing_type.carbon
|
||||
|
||||
// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:7: ERROR: Expected `:` or `:!` in binding pattern.
|
||||
// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:7: error: expected `:` or `:!` in binding pattern
|
||||
// CHECK:STDERR: let a = 4;
|
||||
// CHECK:STDERR: ^
|
||||
let a = 4;
|
||||
|
||||
+2
-2
@@ -10,11 +10,11 @@
|
||||
|
||||
let
|
||||
|
||||
// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error: expected name in binding pattern
|
||||
// CHECK:STDERR: // CHECK:STDOUT: ]
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: ERROR: `let` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error: `let` declarations must end with a `;`
|
||||
// CHECK:STDERR: // CHECK:STDOUT: ]
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDOUT: - filename: fail_no_semi.carbon
|
||||
|
||||
@@ -12,17 +12,17 @@ fn f() -> i32 {
|
||||
var x: i32 = 3;
|
||||
match (x) {
|
||||
default => { return 1; }
|
||||
// CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: ERROR: Unreachable case; `case` occurs after the `default`
|
||||
// CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error: unreachable case; `case` occurs after the `default`
|
||||
// CHECK:STDERR: case a: i32 => { return 2; }
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
case a: i32 => { return 2; }
|
||||
// CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: ERROR: Unreachable case; `default` occurs after the `default`
|
||||
// CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error: unreachable case; `default` occurs after the `default`
|
||||
// CHECK:STDERR: default => { return 3; }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
default => { return 3; }
|
||||
// CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+3]]:5: ERROR: Unreachable case; `case` occurs after the `default`
|
||||
// CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+3]]:5: error: unreachable case; `case` occurs after the `default`
|
||||
// CHECK:STDERR: case (a: i32) if (a == 4) => { return 4; }
|
||||
// CHECK:STDERR: ^~~~
|
||||
case (a: i32) if (a == 4) => { return 4; }
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
|
||||
fn f() -> i32 {
|
||||
match (3) {
|
||||
// CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+4]]:17: ERROR: Expected `=>` introducing statement block.
|
||||
// CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+4]]:17: error: expected `=>` introducing statement block
|
||||
// CHECK:STDERR: case x: i32 { return 2; }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
case x: i32 { return 2; }
|
||||
// CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+3]]:29: ERROR: Expected `=>` introducing statement block.
|
||||
// CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+3]]:29: error: expected `=>` introducing statement block
|
||||
// CHECK:STDERR: case x: i32 if (x == 3) { return 3; }
|
||||
// CHECK:STDERR: ^
|
||||
case x: i32 if (x == 3) { return 3; }
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
fn f() -> i32 {
|
||||
match (3) {
|
||||
// CHECK:STDERR: fail_missing_case_pattern.carbon:[[@LINE+3]]:10: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_missing_case_pattern.carbon:[[@LINE+3]]:10: error: expected name in binding pattern
|
||||
// CHECK:STDERR: case => { return 2; }
|
||||
// CHECK:STDERR: ^~
|
||||
case => { return 2; }
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
fn f() -> i32 {
|
||||
match (3) {
|
||||
case x: i32 =>
|
||||
// CHECK:STDERR: fail_missing_case_statements_block.carbon:[[@LINE+3]]:5: ERROR: Expected `{` after `=>`.
|
||||
// CHECK:STDERR: fail_missing_case_statements_block.carbon:[[@LINE+3]]:5: error: expected `{` after `=>`
|
||||
// CHECK:STDERR: default => { return 3; }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
default => { return 3; }
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
fn f() -> i32 {
|
||||
// CHECK:STDERR: fail_missing_cases.carbon:[[@LINE+3]]:14: ERROR: Expected cases.
|
||||
// CHECK:STDERR: fail_missing_cases.carbon:[[@LINE+3]]:14: error: expected cases
|
||||
// CHECK:STDERR: match (3) {}
|
||||
// CHECK:STDERR: ^
|
||||
match (3) {}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
fn f() -> i32 {
|
||||
match (1)
|
||||
// CHECK:STDERR: fail_missing_cases_block.carbon:[[@LINE+3]]:3: ERROR: Expected `{` starting block with cases.
|
||||
// CHECK:STDERR: fail_missing_cases_block.carbon:[[@LINE+3]]:3: error: expected `{` starting block with cases
|
||||
// CHECK:STDERR: return 0;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
return 0;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
fn f() -> i32 {
|
||||
match (3) {
|
||||
// CHECK:STDERR: fail_missing_default_arrow.carbon:[[@LINE+3]]:13: ERROR: Expected `=>` introducing statement block.
|
||||
// CHECK:STDERR: fail_missing_default_arrow.carbon:[[@LINE+3]]:13: error: expected `=>` introducing statement block
|
||||
// CHECK:STDERR: default { return 1; }
|
||||
// CHECK:STDERR: ^
|
||||
default { return 1; }
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
fn f() -> i32 {
|
||||
match (3) {
|
||||
default =>
|
||||
// CHECK:STDERR: fail_missing_default_statements_block.carbon:[[@LINE+3]]:3: ERROR: Expected `{` after `=>`.
|
||||
// CHECK:STDERR: fail_missing_default_statements_block.carbon:[[@LINE+3]]:3: error: expected `{` after `=>`
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
fn f() -> i32 {
|
||||
match (true) {
|
||||
// CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+7]]:21: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+7]]:21: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: case x: bool if (false => { return 1; }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+3]]:28: ERROR: TODO: Improve match parsing.
|
||||
// CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+3]]:28: error: TODO: improve match parsing
|
||||
// CHECK:STDERR: case x: bool if (false => { return 1; }
|
||||
// CHECK:STDERR: ^~
|
||||
case x: bool if (false => { return 1; }
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
fn f() -> i32 {
|
||||
match (true) {
|
||||
// CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+7]]:21: ERROR: TODO: Improve match parsing.
|
||||
// CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+7]]:21: error: TODO: improve match parsing
|
||||
// CHECK:STDERR: case x: bool if false) => { return 1; }
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+3]]:26: ERROR: Closing symbol without a corresponding opening symbol.
|
||||
// CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+3]]:26: error: closing symbol without a corresponding opening symbol
|
||||
// CHECK:STDERR: case x: bool if false) => { return 1; }
|
||||
// CHECK:STDERR: ^
|
||||
case x: bool if false) => { return 1; }
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/match/fail_missing_matched_expr.carbon
|
||||
|
||||
fn f() -> i32 {
|
||||
// CHECK:STDERR: fail_missing_matched_expr.carbon:[[@LINE+3]]:9: ERROR: Expected `(` after `match`.
|
||||
// CHECK:STDERR: fail_missing_matched_expr.carbon:[[@LINE+3]]:9: error: expected `(` after `match`
|
||||
// CHECK:STDERR: match {
|
||||
// CHECK:STDERR: ^
|
||||
match {
|
||||
|
||||
+6
-6
@@ -11,26 +11,26 @@
|
||||
fn f() -> i32 {
|
||||
var x: i32 = 3;
|
||||
match (x) {
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `let`; expected `case`, `default` or `}`.
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `let`; expected `case`, `default` or `}`
|
||||
// CHECK:STDERR: let u: i32 =
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
let u: i32 =
|
||||
case y: i32 if (y > 2) => { return 1; }
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `if`; expected `case`, `default` or `}`.
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `if`; expected `case`, `default` or `}`
|
||||
// CHECK:STDERR: if (true) {
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
if (true) {
|
||||
return 2;
|
||||
}
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `var`; expected `case`, `default` or `}`.
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `var`; expected `case`, `default` or `}`
|
||||
// CHECK:STDERR: var w
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
var w
|
||||
case z: i32 if (z == 3) => { return 3; }
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `{`; expected `case`, `default` or `}`.
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `{`; expected `case`, `default` or `}`
|
||||
// CHECK:STDERR: {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -38,12 +38,12 @@ fn f() -> i32 {
|
||||
break;
|
||||
}
|
||||
default => { return 3; }
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `return`; expected `case`, `default` or `}`.
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `return`; expected `case`, `default` or `}`
|
||||
// CHECK:STDERR: return 1;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
return 1;
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+3]]:5: ERROR: Unexpected `(`; expected `case`, `default` or `}`.
|
||||
// CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+3]]:5: error: unexpected `(`; expected `case`, `default` or `}`
|
||||
// CHECK:STDERR: ((), (), ())
|
||||
// CHECK:STDERR: ^
|
||||
((), (), ())
|
||||
|
||||
@@ -9,32 +9,32 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/member_access/fail_keyword.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`.
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.`
|
||||
// CHECK:STDERR: a.self;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
a.self;
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`.
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.`
|
||||
// CHECK:STDERR: a.Self;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
a.Self;
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`.
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.`
|
||||
// CHECK:STDERR: a.for;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
a.for;
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: ERROR: Expected identifier after `->`.
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error: expected identifier after `->`
|
||||
// CHECK:STDERR: p->self;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
p->self;
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: ERROR: Expected identifier after `->`.
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error: expected identifier after `->`
|
||||
// CHECK:STDERR: p->Self;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
p->Self;
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+3]]:6: ERROR: Expected identifier after `->`.
|
||||
// CHECK:STDERR: fail_keyword.carbon:[[@LINE+3]]:6: error: expected identifier after `->`
|
||||
// CHECK:STDERR: p->while;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
p->while;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace Foo;
|
||||
|
||||
// CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:10: ERROR: `class` declarations must either end with a `;` or have a `{ ... }` block for a definition.
|
||||
// CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:10: error: `class` declarations must either end with a `;` or have a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: class Foo->Bar {}
|
||||
// CHECK:STDERR: ^~
|
||||
class Foo->Bar {}
|
||||
|
||||
@@ -8,37 +8,37 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_incomplete.carbon
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name
|
||||
// CHECK:STDERR: namespace 123
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
namespace 123
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name
|
||||
// CHECK:STDERR: namespace ""
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
namespace ""
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name
|
||||
// CHECK:STDERR: namespace +
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
namespace +
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name
|
||||
// CHECK:STDERR: namespace bool
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
namespace bool
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name
|
||||
// CHECK:STDERR: namespace namespace namespace namespace namespace
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
namespace namespace namespace namespace namespace
|
||||
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: ERROR: `namespace` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error: `namespace` introducer should be followed by a name
|
||||
// CHECK:STDERR: namespace
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
namespace
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_incomplete_name.carbon
|
||||
|
||||
// CHECK:STDERR: fail_incomplete_name.carbon:[[@LINE+3]]:15: ERROR: `.` should be followed by a name.
|
||||
// CHECK:STDERR: fail_incomplete_name.carbon:[[@LINE+3]]:15: error: `.` should be followed by a name
|
||||
// CHECK:STDERR: namespace Foo.;
|
||||
// CHECK:STDERR: ^
|
||||
namespace Foo.;
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
virtual namespace B
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: ERROR: `namespace` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: error: `namespace` declarations must end with a `;`
|
||||
// CHECK:STDERR: impl namespace
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:6: ERROR: `namespace` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:6: error: `namespace` introducer should be followed by a name
|
||||
// CHECK:STDERR: impl namespace
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
impl namespace
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_no_name.carbon
|
||||
|
||||
// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:10: ERROR: `namespace` introducer should be followed by a name.
|
||||
// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:10: error: `namespace` introducer should be followed by a name
|
||||
// CHECK:STDERR: namespace;
|
||||
// CHECK:STDERR: ^
|
||||
namespace;
|
||||
|
||||
@@ -13,7 +13,7 @@ fn F() {
|
||||
var b: i32;
|
||||
|
||||
// TODO: Produce a custom diagnostic for this.
|
||||
// CHECK:STDERR: fail_chained_assign.carbon:[[@LINE+3]]:9: ERROR: Operator `=` can only be used as a complete statement.
|
||||
// CHECK:STDERR: fail_chained_assign.carbon:[[@LINE+3]]:9: error: operator `=` can only be used as a complete statement
|
||||
// CHECK:STDERR: a = b = 1;
|
||||
// CHECK:STDERR: ^
|
||||
a = b = 1;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
// TODO: We could figure out that this first Failed example is infix
|
||||
// with one-token lookahead.
|
||||
// CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+3]]:16: ERROR: `var` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+3]]:16: error: `var` declarations must end with a `;`
|
||||
// CHECK:STDERR: var n: i8 = n* n;
|
||||
// CHECK:STDERR: ^
|
||||
var n: i8 = n* n;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon
|
||||
|
||||
// CHECK:STDERR: fail_infix_uneven_space_before.carbon:[[@LINE+3]]:15: ERROR: Whitespace missing after binary operator.
|
||||
// CHECK:STDERR: fail_infix_uneven_space_before.carbon:[[@LINE+3]]:15: error: whitespace missing after binary operator
|
||||
// CHECK:STDERR: var n: i8 = n *n;
|
||||
// CHECK:STDERR: ^
|
||||
var n: i8 = n *n;
|
||||
|
||||
@@ -8,21 +8,21 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_invalid_infix.carbon
|
||||
|
||||
// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:19: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:19: error: expected expression
|
||||
// CHECK:STDERR: var a: i32 = n == ;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var a: i32 = n == ;
|
||||
// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:14: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:14: error: expected expression
|
||||
// CHECK:STDERR: var b: i32 = == n;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = == n;
|
||||
// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+7]]:14: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+7]]:14: error: expected expression
|
||||
// CHECK:STDERR: var c: i32 = == ;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+3]]:17: ERROR: Expected expression.
|
||||
// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+3]]:17: error: expected expression
|
||||
// CHECK:STDERR: var c: i32 = == ;
|
||||
// CHECK:STDERR: ^
|
||||
var c: i32 = == ;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space.carbon
|
||||
|
||||
// CHECK:STDERR: fail_postfix_space.carbon:[[@LINE+3]]:18: ERROR: Whitespace is not allowed before this unary operator.
|
||||
// CHECK:STDERR: fail_postfix_space.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator
|
||||
// CHECK:STDERR: var v: type = i8 *;
|
||||
// CHECK:STDERR: ^
|
||||
var v: type = i8 *;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon
|
||||
|
||||
// CHECK:STDERR: fail_postfix_space_before_comma.carbon:[[@LINE+3]]:18: ERROR: Whitespace is not allowed before this unary operator.
|
||||
// CHECK:STDERR: fail_postfix_space_before_comma.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator
|
||||
// CHECK:STDERR: var n: i8 = F(i8 *, 0);
|
||||
// CHECK:STDERR: ^
|
||||
var n: i8 = F(i8 *, 0);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon
|
||||
|
||||
// CHECK:STDERR: fail_postfix_space_in_call.carbon:[[@LINE+3]]:18: ERROR: Whitespace is not allowed before this unary operator.
|
||||
// CHECK:STDERR: fail_postfix_space_in_call.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator
|
||||
// CHECK:STDERR: var n: i8 = F(i8 *);
|
||||
// CHECK:STDERR: ^
|
||||
var n: i8 = F(i8 *);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon
|
||||
|
||||
// CHECK:STDERR: fail_postfix_space_surrounding.carbon:[[@LINE+3]]:18: ERROR: Whitespace is not allowed before this unary operator.
|
||||
// CHECK:STDERR: fail_postfix_space_surrounding.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator
|
||||
// CHECK:STDERR: var v: type = i8 * ;
|
||||
// CHECK:STDERR: ^
|
||||
var v: type = i8 * ;
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
fn F() {
|
||||
var n: i32 = 0;
|
||||
// TODO: It'd be nice to produce a custom diagnostic here.
|
||||
// CHECK:STDERR: fail_postincrement.carbon:[[@LINE+4]]:4: ERROR: Expected `;` after expression statement.
|
||||
// CHECK:STDERR: fail_postincrement.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement
|
||||
// CHECK:STDERR: n++;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
n++;
|
||||
// CHECK:STDERR: fail_postincrement.carbon:[[@LINE+3]]:4: ERROR: Expected `;` after expression statement.
|
||||
// CHECK:STDERR: fail_postincrement.carbon:[[@LINE+3]]:4: error: expected `;` after expression statement
|
||||
// CHECK:STDERR: n--;
|
||||
// CHECK:STDERR: ^~
|
||||
n--;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_precedence_and_or.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_precedence_and_or.carbon:[[@LINE+3]]:11: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_and_or.carbon:[[@LINE+3]]:11: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: a and b or c;
|
||||
// CHECK:STDERR: ^~
|
||||
a and b or c;
|
||||
|
||||
@@ -10,43 +10,43 @@
|
||||
|
||||
fn F(n: i32) {
|
||||
// No ordering between `not` and `as`.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: not true as bool;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
not true as bool;
|
||||
|
||||
// No ordering between mathematical binary operators and `as`.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: 1 + 1 as i32;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
1 + 1 as i32;
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: 5 % 2 as i32;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
5 % 2 as i32;
|
||||
|
||||
// No ordering between logical binary operators and `as`.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: 3 as i32 and true;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
3 as i32 and true;
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:14: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:14: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: false or 4 as i32;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
false or 4 as i32;
|
||||
|
||||
// No ordering between relational binary operators and `as`.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: 6 as i32 == 7;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
6 as i32 == 7;
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+3]]:10: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+3]]:10: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: 8 <= 9 as i32;
|
||||
// CHECK:STDERR: ^~
|
||||
8 <= 9 as i32;
|
||||
|
||||
@@ -12,26 +12,26 @@ fn F() {
|
||||
var a: i32;
|
||||
// Assignment can only appear as an expression statement, not as a subexpression.
|
||||
// TODO: Produce the "can only be used as a complete statement" diagnostic in each of these cases.
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:10: ERROR: Expected `,` or `)`.
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:10: error: expected `,` or `)`
|
||||
// CHECK:STDERR: 1 + (a = 1);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
1 + (a = 1);
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+8]]:19: ERROR: Expected `else` after `if ... then ...`.
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+8]]:19: error: expected `else` after `if ... then ...`
|
||||
// CHECK:STDERR: (if true then a += 1 else a /= 2);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:19: ERROR: Expected `,` or `)`.
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:19: error: expected `,` or `)`
|
||||
// CHECK:STDERR: (if true then a += 1 else a /= 2);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
(if true then a += 1 else a /= 2);
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:7: ERROR: Operator `++` can only be used as a complete statement.
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:7: error: operator `++` can only be used as a complete statement
|
||||
// CHECK:STDERR: a + ++a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
a + ++a;
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+3]]:5: ERROR: Parentheses are required around this unary `if` operator.
|
||||
// CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+3]]:5: error: parentheses are required around this unary `if` operator
|
||||
// CHECK:STDERR: ++if c then a else b;
|
||||
// CHECK:STDERR: ^~
|
||||
++if c then a else b;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_precedence_or_and.carbon
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_precedence_or_and.carbon:[[@LINE+3]]:10: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_precedence_or_and.carbon:[[@LINE+3]]:10: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: a or b and c;
|
||||
// CHECK:STDERR: ^~~
|
||||
a or b and c;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// --- fail_and_where.carbon
|
||||
|
||||
fn AndWhere() {
|
||||
// CHECK:STDERR: fail_and_where.carbon:[[@LINE+4]]:14: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_and_where.carbon:[[@LINE+4]]:14: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: true and T where .A = B;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -21,7 +21,7 @@ fn AndWhere() {
|
||||
// --- fail_where_or.carbon
|
||||
|
||||
fn WhereOr() {
|
||||
// CHECK:STDERR: fail_where_or.carbon:[[@LINE+4]]:22: ERROR: Expected `;` after expression statement.
|
||||
// CHECK:STDERR: fail_where_or.carbon:[[@LINE+4]]:22: error: expected `;` after expression statement
|
||||
// CHECK:STDERR: U where .C impls D or false;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
@@ -31,7 +31,7 @@ fn WhereOr() {
|
||||
// --- fail_equals_where.carbon
|
||||
|
||||
fn EqualsWhere() {
|
||||
// CHECK:STDERR: fail_equals_where.carbon:[[@LINE+4]]:10: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_equals_where.carbon:[[@LINE+4]]:10: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: e == V where .G == f32;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -41,7 +41,7 @@ fn EqualsWhere() {
|
||||
// --- fail_where_neq.carbon
|
||||
|
||||
fn WhereNEq() {
|
||||
// CHECK:STDERR: fail_where_neq.carbon:[[@LINE+4]]:21: ERROR: Expected `;` after expression statement.
|
||||
// CHECK:STDERR: fail_where_neq.carbon:[[@LINE+4]]:21: error: expected `;` after expression statement
|
||||
// CHECK:STDERR: W where .H = bool != i;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
@@ -51,7 +51,7 @@ fn WhereNEq() {
|
||||
// --- fail_less_requirement.carbon
|
||||
|
||||
fn LessRequirement() {
|
||||
// CHECK:STDERR: fail_less_requirement.carbon:[[@LINE+4]]:14: ERROR: Requirement should use `impls`, `=`, or `==` operator.
|
||||
// CHECK:STDERR: fail_less_requirement.carbon:[[@LINE+4]]:14: error: requirement should use `impls`, `=`, or `==` operator
|
||||
// CHECK:STDERR: X where .J < .K;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -61,7 +61,7 @@ fn LessRequirement() {
|
||||
// --- fail_as_where.carbon
|
||||
|
||||
fn AsWhere() {
|
||||
// CHECK:STDERR: fail_as_where.carbon:[[@LINE+4]]:10: ERROR: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: fail_as_where.carbon:[[@LINE+4]]:10: error: parentheses are required to disambiguate operator precedence
|
||||
// CHECK:STDERR: Y as Z where .L impls M;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -71,7 +71,7 @@ fn AsWhere() {
|
||||
// --- fail_where_as.carbon
|
||||
|
||||
fn WhereAs() {
|
||||
// CHECK:STDERR: fail_where_as.carbon:[[@LINE+4]]:21: ERROR: Expected `;` after expression statement.
|
||||
// CHECK:STDERR: fail_where_as.carbon:[[@LINE+4]]:21: error: expected `;` after expression statement
|
||||
// CHECK:STDERR: S where .N == i32 as type;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
@@ -81,7 +81,7 @@ fn WhereAs() {
|
||||
// --- fail_as_in_argument.carbon
|
||||
|
||||
fn AsInArgument() {
|
||||
// CHECK:STDERR: fail_as_in_argument.carbon:[[@LINE+4]]:14: ERROR: Requirement should use `impls`, `=`, or `==` operator.
|
||||
// CHECK:STDERR: fail_as_in_argument.carbon:[[@LINE+4]]:14: error: requirement should use `impls`, `=`, or `==` operator
|
||||
// CHECK:STDERR: R where .O as type impls P;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
@@ -91,7 +91,7 @@ fn AsInArgument() {
|
||||
// --- fail_greater_in_argument.carbon
|
||||
|
||||
fn GreaterInArgument() {
|
||||
// CHECK:STDERR: fail_greater_in_argument.carbon:[[@LINE+3]]:15: ERROR: Requirement should use `impls`, `=`, or `==` operator.
|
||||
// CHECK:STDERR: fail_greater_in_argument.carbon:[[@LINE+3]]:15: error: requirement should use `impls`, `=`, or `==` operator
|
||||
// CHECK:STDERR: Q where .AA > .BB impls CC;
|
||||
// CHECK:STDERR: ^
|
||||
Q where .AA > .BB impls CC;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_repeat.carbon
|
||||
|
||||
// CHECK:STDERR: fail_prefix_repeat.carbon:[[@LINE+3]]:17: ERROR: Parentheses are required around this unary `const` operator.
|
||||
// CHECK:STDERR: fail_prefix_repeat.carbon:[[@LINE+3]]:17: error: parentheses are required around this unary `const` operator
|
||||
// CHECK:STDERR: fn F() -> const const i32* {
|
||||
// CHECK:STDERR: ^~~~~
|
||||
fn F() -> const const i32* {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user