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

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: 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') | tests/co19/co19-leg.status » ('J')
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 bc1d74c821dbd86ec76d407733952cca394d1ecd..9bfade71b8908f94f82ae8200e133d7132331177 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -1527,6 +1527,14 @@ class PartialFieldListElement extends VariableListElement {
cachedNode = parse(listener,
getCompilationUnit(),
(p) => p.parseVariablesDeclaration(beginToken));
+ 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') | tests/co19/co19-leg.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698