Index: pkg/analyzer/lib/src/generated/parser.dart |
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart |
index 7e913103634855449dd58c091f34a7a6a2990b6f..b12d26f888fc2c56a0fffacfc3ca62cc08bd5c93 100644 |
--- a/pkg/analyzer/lib/src/generated/parser.dart |
+++ b/pkg/analyzer/lib/src/generated/parser.dart |
@@ -6252,7 +6252,8 @@ class Parser { |
parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false); |
if (constKeyword != null && |
factoryKeyword != null && |
- externalKeyword == null) { |
+ externalKeyword == null && |
+ body is! NativeFunctionBody) { |
_reportErrorForToken(ParserErrorCode.CONST_FACTORY, factoryKeyword); |
} else if (body is EmptyFunctionBody) { |
if (factoryKeyword != null && |
@@ -6262,7 +6263,7 @@ class Parser { |
ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword); |
} |
} else { |
- if (constKeyword != null) { |
+ if (constKeyword != null && body is! NativeFunctionBody) { |
_reportErrorForNode( |
ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, body); |
} else if (externalKeyword != null) { |