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 c90af7d69f56ef2dadcf1fe42d92585ec695d120..2a0039222a19f6f3601a3f1da83961af52797af7 100644 |
--- a/pkg/analyzer/lib/src/generated/parser.dart |
+++ b/pkg/analyzer/lib/src/generated/parser.dart |
@@ -3848,7 +3848,7 @@ class Parser { |
modifiers.constKeyword = getAndAdvance(); |
} |
} else if (keyword == Keyword.COVARIANT) { |
- if (modifiers.constKeyword != null) { |
+ if (modifiers.covariantKeyword != null) { |
_reportErrorForCurrentToken( |
ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
_advance(); |
@@ -4152,6 +4152,11 @@ class Parser { |
_tokenMatchesIdentifier(next)) { |
covariantKeyword = getAndAdvance(); |
} |
+ while (_matchesKeyword(Keyword.COVARIANT)) { |
+ _reportErrorForCurrentToken( |
+ ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
+ _advance(); |
+ } |
} |
FinalConstVarOrType holder = parseFinalConstVarOrType(!inFunctionType, |
inFunctionType: inFunctionType); |