Index: pkg/compiler/lib/src/parser/parser.dart |
diff --git a/pkg/compiler/lib/src/parser/parser.dart b/pkg/compiler/lib/src/parser/parser.dart |
index 7adddb5f2cff272bf02554d1515d2f9287f52119..f6465022108db1ed6f9dd500be07f63b0ff2baef 100644 |
--- a/pkg/compiler/lib/src/parser/parser.dart |
+++ b/pkg/compiler/lib/src/parser/parser.dart |
@@ -931,6 +931,8 @@ class Parser { |
Token name) { |
Token externalModifier; |
+ // TODO(johnniwinther): Move error reporting to resolution to give more |
+ // specific error messages. |
for (Token modifier in modifiers) { |
if (externalModifier == null && optional('external', modifier)) { |
externalModifier = modifier; |
@@ -1306,6 +1308,8 @@ class Parser { |
Token constModifier; |
int modifierCount = 0; |
int allowedModifierCount = 1; |
+ // TODO(johnniwinther): Move error reporting to resolution to give more |
+ // specific error messages. |
for (Token modifier in modifiers) { |
if (externalModifier == null && optional('external', modifier)) { |
modifierCount++; |
@@ -1337,6 +1341,11 @@ class Parser { |
modifier, MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier}); |
} |
} |
+ if (getOrSet != null && constModifier != null) { |
+ listener.reportError( |
+ constModifier, MessageKind.EXTRANEOUS_MODIFIER, |
+ {'modifier': constModifier}); |
+ } |
parseModifierList(modifiers); |
if (type == null) { |
@@ -1348,7 +1357,6 @@ class Parser { |
if (optional('operator', name)) { |
token = parseOperatorName(name); |
if (staticModifier != null) { |
- // TODO(ahe): Consider a more specific error message. |
listener.reportError( |
staticModifier, MessageKind.EXTRANEOUS_MODIFIER, |
{'modifier': staticModifier}); |