| Index: pkg/analyzer/test/generated/compile_time_error_code_test.dart
|
| diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
|
| index 968adecfa16041082844375c00706be352a68b81..5df81b0bf003ee0c8d9644e48e5ef7777c6da79b 100644
|
| --- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
|
| +++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
|
| @@ -20,6 +20,32 @@ main() {
|
|
|
| @reflectiveTest
|
| class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| + void fail_awaitInWrongContext_sync() {
|
| + // This test requires better error recovery than we currently have. In
|
| + // particular, we need to be able to distinguish between an await expression
|
| + // in the wrong context, and the use of 'await' as an identifier.
|
| + Source source = addSource(r'''
|
| +f(x) {
|
| + return await x;
|
| +}''');
|
| + resolve(source);
|
| + assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
|
| + verify([source]);
|
| + }
|
| +
|
| + void fail_awaitInWrongContext_syncStar() {
|
| + // This test requires better error recovery than we currently have. In
|
| + // particular, we need to be able to distinguish between an await expression
|
| + // in the wrong context, and the use of 'await' as an identifier.
|
| + Source source = addSource(r'''
|
| +f(x) sync* {
|
| + yield await x;
|
| +}''');
|
| + resolve(source);
|
| + assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
|
| + verify([source]);
|
| + }
|
| +
|
| void fail_compileTimeConstantRaisesException() {
|
| Source source = addSource(r'''
|
| ''');
|
| @@ -231,26 +257,6 @@ f(list) {
|
| verify([source]);
|
| }
|
|
|
| - void test_awaitInWrongContext_sync() {
|
| - Source source = addSource(r'''
|
| -f(x) {
|
| - return await x;
|
| -}''');
|
| - resolve(source);
|
| - assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
|
| - verify([source]);
|
| - }
|
| -
|
| - void test_awaitInWrongContext_syncStar() {
|
| - Source source = addSource(r'''
|
| -f(x) sync* {
|
| - yield await x;
|
| -}''');
|
| - resolve(source);
|
| - assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
|
| - verify([source]);
|
| - }
|
| -
|
| void test_builtInIdentifierAsMixinName_classTypeAlias() {
|
| Source source = addSource(r'''
|
| class A {}
|
|
|