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

Unified Diff: runtime/vm/parser.cc

Issue 2673893002: Accept instance members and locals named "Function" (fixes #28610). (Closed)
Patch Set: Created 3 years, 10 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/regress_28610_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 d8227bce2aa1527697d44827ad87dca3c1adc3e1..90e41098c215ff06fa277efde1bf917ac41903d1 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -5431,7 +5431,7 @@ void Parser::SkipTypeOrFunctionType(bool allow_void) {
// Including 'Function' not followed by '(' or '<'.
SkipType(false);
}
- while (IsSymbol(Symbols::Function())) {
+ while (IsFunctionTypeSymbol()) {
ConsumeToken();
SkipTypeArguments();
if (CurrentToken() == Token::kLPAREN) {
@@ -8232,7 +8232,7 @@ bool Parser::TryParseType(bool allow_void) {
}
found = true;
}
- while (IsSymbol(Symbols::Function())) {
+ while (IsFunctionTypeSymbol()) {
ConsumeToken();
if ((CurrentToken() == Token::kLT) && !TryParseTypeParameters()) {
return false;
@@ -12988,7 +12988,7 @@ RawAbstractType* Parser::ParseTypeOrFunctionType(
// refer to a not yet declared function type parameter.
type = ParseType(ClassFinalizer::kDoNotResolve);
}
- while (IsSymbol(Symbols::Function())) {
+ while (IsFunctionTypeSymbol()) {
if (type.IsNull()) {
type = Type::DynamicType();
}
@@ -13066,7 +13066,7 @@ RawType* Parser::ParseFunctionType(
AddFormalParamsToFunction(&params, signature_function);
innermost_function_ = innermost_function_.parent_function();
type = signature_function.SignatureType();
- } while (IsSymbol(Symbols::Function()));
+ } while (IsFunctionTypeSymbol());
// At this point, all type parameters have been parsed, resolve the type.
if (finalization == ClassFinalizer::kIgnore) {
return Type::DynamicType();
« no previous file with comments | « no previous file | tests/language/regress_28610_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698