Index: pkg/front_end/lib/src/fasta/parser/parser.dart |
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart |
index c517e22bcac260aa776657a12b64d5bba3bfc589..fd1f9457a15f449f87d2b99e3565c40667bd9a87 100644 |
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart |
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart |
@@ -1165,8 +1165,13 @@ class Parser { |
Token getOrSet, Token name, bool isTopLevel) { |
bool hasType = type != null; |
+ Token covariantKeyword; |
if (getOrSet == null && !isTopLevel) { |
- modifiers = removeOptCovariantTokenIfNotStatic(modifiers); |
+ Link<Token> newModifiers = removeOptCovariantTokenIfNotStatic(modifiers); |
ahe
2017/03/01 15:20:31
This is horrible. But that's not your fault. Would
Paul Berry
2017/03/01 21:08:22
Done.
|
+ if (!identical(newModifiers, modifiers)) { |
+ covariantKeyword = modifiers.first; |
+ modifiers = newModifiers; |
+ } |
} |
Token varFinalOrConst = |
@@ -1219,7 +1224,7 @@ class Parser { |
if (isTopLevel) { |
listener.endTopLevelFields(fieldCount, start, semicolon); |
} else { |
- listener.endFields(fieldCount, start, semicolon); |
+ listener.endFields(fieldCount, covariantKeyword, start, semicolon); |
} |
return token; |
} |
@@ -1716,7 +1721,7 @@ class Parser { |
token = reportUnrecoverableError(token, ErrorKind.UnexpectedToken); |
if (identical(token.kind, EOF_TOKEN)) { |
// TODO(ahe): This is a hack, see parseTopLevelMember. |
- listener.endFields(1, start, token); |
+ listener.endFields(1, null, start, token); |
listener.endMember(); |
return token; |
} |