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

Unified Diff: runtime/vm/parser.cc

Issue 2248943002: Class fields cannot be declared to be of type void (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: wip Created 4 years, 4 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/language/syntax_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 3dc119a778d705830b1b8e7dc15161bc0b160140..63bda541ddab5772f49a72e795b75844d552ff89 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4495,6 +4495,8 @@ void Parser::ParseClassMemberDefinition(ClassDesc* members,
ReportError("missing 'var', 'final', 'const' or type"
" in field declaration");
}
+ } else if (member.type->IsVoidType()) {
+ ReportError(member.name_pos, "field may not be 'void'");
rmacnak 2016/08/15 23:55:58 Would be nice if top level fields gave the same er
}
ParseFieldDefinition(members, &member);
} else {
« no previous file with comments | « no previous file | tests/language/syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698