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

Unified Diff: runtime/vm/parser.cc

Issue 2556433004: Disallow deprecated typedef syntax for mixin apps in the VM (fixes #14410). (Closed)
Patch Set: dedup test 13 Created 4 years 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 | « runtime/vm/parser.h ('k') | tests/language/language_analyzer2.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 1a91fcb710236e16bcbca83c3c4db01820a2587d..d3b62f69fb59dda151d5db756e868abd91a19172 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -44,7 +44,6 @@ namespace dart {
DEFINE_FLAG(bool, enable_debug_break, false, "Allow use of break \"message\".");
DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
-DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef.");
DEFINE_FLAG(bool, warn_new_tearoff_syntax, true, "Warning on new tear off.");
// TODO(floitsch): remove the conditional-directive flag, once we publicly
// committed to the current version.
@@ -5073,23 +5072,6 @@ bool Parser::IsFunctionTypeAliasName() {
}
-// Look ahead to detect if we are seeing ident [ TypeParameters ] "=".
-// Token position remains unchanged.
-bool Parser::IsMixinAppAlias() {
- if (IsIdentifier() && (LookaheadToken(1) == Token::kASSIGN)) {
- return true;
- }
- const TokenPosScope saved_pos(this);
- if (IsIdentifier() && (LookaheadToken(1) == Token::kLT)) {
- ConsumeToken();
- if (TryParseTypeParameters() && (CurrentToken() == Token::kASSIGN)) {
- return true;
- }
- }
- return false;
-}
-
-
void Parser::ParseTypedef(const GrowableObjectArray& pending_classes,
const Object& tl_owner,
TokenPosition metadata_pos) {
@@ -5098,14 +5080,6 @@ void Parser::ParseTypedef(const GrowableObjectArray& pending_classes,
metadata_pos.IsReal() ? metadata_pos : TokenPos();
ExpectToken(Token::kTYPEDEF);
- if (IsMixinAppAlias()) {
- if (FLAG_warn_mixin_typedef) {
- ReportWarning(TokenPos(), "deprecated mixin application typedef");
- }
- ParseMixinAppAlias(pending_classes, tl_owner, metadata_pos);
- return;
- }
-
// Parse the result type of the function type.
AbstractType& result_type = Type::Handle(Z, Type::DynamicType());
if (CurrentToken() == Token::kVOID) {
« no previous file with comments | « runtime/vm/parser.h ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698