Index: pkg/analyzer/test/generated/parser_test.dart |
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart |
index 4a60a8ab63ac6210a56d76d75359d7e9f9f9a5f0..cb2e50cef9ee9d256bfa5ca3922ef18bc833e0c4 100644 |
--- a/pkg/analyzer/test/generated/parser_test.dart |
+++ b/pkg/analyzer/test/generated/parser_test.dart |
@@ -62,6 +62,11 @@ abstract class AbstractParserTestCase implements ParserTestHelpers { |
*/ |
Parser get parser; |
+ /** |
+ * Flag indicating whether the fasta parser is being used. |
+ */ |
+ bool get usingFasta; |
+ |
/** |
* Assert that the number and codes of errors occurred during parsing is the |
* same as the [expectedErrorCodes]. |
@@ -8132,6 +8137,9 @@ class ParserTestCase extends EngineTestCase |
*/ |
Parser parser; |
+ @override |
+ bool get usingFasta => Parser.useFasta; |
+ |
@override |
void assertErrorsWithCodes(List<ErrorCode> expectedErrorCodes) { |
listener.assertErrorsWithCodes(expectedErrorCodes); |
@@ -13651,10 +13659,13 @@ abstract class TopLevelParserTestMixin implements AbstractParserTestCase { |
} |
void test_parseCompilationUnit_abstractAsPrefix_parameterized() { |
- createParser('abstract<dynamic> _abstract = new abstract.A();'); |
- CompilationUnit unit = parser.parseCompilationUnit2(); |
- expect(unit, isNotNull); |
- assertNoErrors(); |
+ var errorCodes = <ErrorCode>[]; |
+ if (usingFasta) { |
+ // built-in "abstract" cannot be used as a type |
+ errorCodes.add(ParserErrorCode.EXPECTED_TYPE_NAME); |
+ } |
+ CompilationUnit unit = parseCompilationUnit( |
+ 'abstract<dynamic> _abstract = new abstract.A();', errorCodes); |
expect(unit.scriptTag, isNull); |
expect(unit.directives, hasLength(0)); |
expect(unit.declarations, hasLength(1)); |