| 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 6446cfad53ec3a25858d2b46660d4e0d7fb5b851..c90af7d69f56ef2dadcf1fe42d92585ec695d120 100644
|
| --- a/pkg/analyzer/lib/src/generated/parser.dart
|
| +++ b/pkg/analyzer/lib/src/generated/parser.dart
|
| @@ -4143,7 +4143,15 @@ class Parser {
|
| Token covariantKeyword;
|
| CommentAndMetadata commentAndMetadata = parseCommentAndMetadata();
|
| if (_matchesKeyword(Keyword.COVARIANT)) {
|
| - covariantKeyword = getAndAdvance();
|
| + // Check to ensure that 'covariant' isn't being used as the parameter name.
|
| + Token next = _peek();
|
| + if (_tokenMatchesKeyword(next, Keyword.FINAL) ||
|
| + _tokenMatchesKeyword(next, Keyword.CONST) ||
|
| + _tokenMatchesKeyword(next, Keyword.VAR) ||
|
| + _tokenMatchesKeyword(next, Keyword.THIS) ||
|
| + _tokenMatchesIdentifier(next)) {
|
| + covariantKeyword = getAndAdvance();
|
| + }
|
| }
|
| FinalConstVarOrType holder = parseFinalConstVarOrType(!inFunctionType,
|
| inFunctionType: inFunctionType);
|
| @@ -8332,6 +8340,10 @@ class Parser {
|
| _reportErrorForToken(
|
| ParserErrorCode.CONST_METHOD, modifiers.constKeyword);
|
| }
|
| + if (modifiers.covariantKeyword != null) {
|
| + _reportErrorForToken(
|
| + ParserErrorCode.COVARIANT_MEMBER, modifiers.covariantKeyword);
|
| + }
|
| if (modifiers.factoryKeyword != null) {
|
| _reportErrorForToken(
|
| ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword);
|
|
|