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

Unified Diff: runtime/vm/parser.cc

Issue 2774713002: Remove outdated special handling of 'void' when parsing class members. (Closed)
Patch Set: Created 3 years, 9 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 | no next file » | 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 23ca9317e3d68753a6981d935d120a7f088af64b..7d8c5a3f1b3abb0c1149de76c5522393bdbfefb0 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4459,32 +4459,23 @@ void Parser::ParseClassMemberDefinition(ClassDesc* members,
}
// Optionally parse a type.
- if (CurrentToken() == Token::kVOID) {
- if (member.has_var || member.has_factory) {
- ReportError("void not expected");
- }
- ConsumeToken();
- ASSERT(member.type == NULL);
- member.type = &Object::void_type();
- } else {
- bool found_type = false;
- {
- // Lookahead to determine whether the next tokens are a return type.
- TokenPosScope saved_pos(this);
- if (TryParseType(true)) {
- if (IsIdentifier() || (CurrentToken() == Token::kGET) ||
- (CurrentToken() == Token::kSET) ||
- (CurrentToken() == Token::kOPERATOR)) {
- found_type = true;
- }
+ bool found_type = false;
+ {
+ // Lookahead to determine whether the next tokens are a return type.
+ TokenPosScope saved_pos(this);
+ if (TryParseType(true)) {
+ if (IsIdentifier() || (CurrentToken() == Token::kGET) ||
+ (CurrentToken() == Token::kSET) ||
+ (CurrentToken() == Token::kOPERATOR)) {
+ found_type = true;
}
}
- if (found_type) {
- // It is too early to resolve the type here, since it can be a result type
- // referring to a not yet declared function type parameter.
- member.type = &AbstractType::ZoneHandle(
- Z, ParseTypeOrFunctionType(false, ClassFinalizer::kDoNotResolve));
- }
+ }
+ if (found_type) {
+ // It is too early to resolve the type here, since it can be a result type
+ // referring to a not yet declared function type parameter.
+ member.type = &AbstractType::ZoneHandle(
+ Z, ParseTypeOrFunctionType(true, ClassFinalizer::kDoNotResolve));
}
// Optionally parse a (possibly named) constructor name or factory.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698