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

Unified Diff: runtime/vm/parser.cc

Issue 1636583003: Allow methods to be named ‘factory’ (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/language_dart2js.status » ('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 42af886a4cdc7251a6b185c8a4120db731473848..5440dfbba7b979cfdfa5ee6ad5a4d9dcd0eb8f59 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4112,7 +4112,8 @@ void Parser::ParseClassMemberDefinition(ClassDesc* members,
member.has_var = true;
// The member type is the 'dynamic' type.
member.type = &Object::dynamic_type();
- } else if (CurrentToken() == Token::kFACTORY) {
+ } else if ((CurrentToken() == Token::kFACTORY) &&
+ (LookaheadToken(1) != Token::kLPAREN)) {
ConsumeToken();
if (member.has_static) {
ReportError("factory method cannot be explicitly marked static");
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698