Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1062)

Unified Diff: lib/compiler/implementation/scanner/listener.dart

Issue 10690106: Error produced for missing var, final, const or type on field declarations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698