Index: lib/compiler/implementation/scanner/listener.dart |
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart |
index b116b7ea5555c770e19f5af705c868b9ce59aa6b..7d18d4d8ed3ea36f354eb1bb7fb119a0ae8c23ac 100644 |
--- a/lib/compiler/implementation/scanner/listener.dart |
+++ b/lib/compiler/implementation/scanner/listener.dart |
@@ -1531,6 +1531,14 @@ class PartialFieldListElement extends VariableListElement { |
cachedNode = parse(listener, |
getCompilationUnit(), |
(p) => p.parseVariablesDeclaration(beginToken)); |
ahe
2012/08/02 19:40:24
I think we should rework this change to a "recover
|
+ if (!cachedNode.modifiers.isVar() && |
+ !cachedNode.modifiers.isFinal() && |
+ !cachedNode.modifiers.isConst() && |
+ cachedNode.type === null) { |
+ listener.cancel('A field declaration must start with var, final, ' |
+ 'const, or a type annotation.', |
+ cachedNode); |
+ } |
return cachedNode; |
} |