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

Unified Diff: runtime/vm/parser.cc

Issue 2383993002: Treat generic method parameters as dynamic in all contexts in the VM (fixes #27460) (Closed)
Patch Set: Created 4 years, 3 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.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 def0cfd583cb573064b429c24724fccc03f15323..cb9c620101ec318ff2baffb48bf4f5a698cea49e 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -11914,15 +11914,9 @@ AstNode* Parser::LoadTypeParameter(PrimaryNode* primary) {
// TODO(regis): Verify that CaptureFunctionInstantiator() was already
// called if necessary.
// TODO(regis): Finalize type parameter and return as type node.
- // For now, throw a type error.
- Type& malformed_type = Type::ZoneHandle(Z);
- malformed_type = ClassFinalizer::NewFinalizedMalformedType(
- Error::Handle(Z), // No previous error.
- script_,
- primary_pos,
- "function type parameter '%s' not yet supported",
- String::Handle(Z, type_parameter.name()).ToCString());
- return ThrowTypeError(primary_pos, malformed_type);
+ // For now, map to dynamic type.
+ Type& type = Type::ZoneHandle(Z, Type::DynamicType());
+ return new(Z) TypeNode(primary_pos, type);
}
}
@@ -12383,15 +12377,8 @@ void Parser::ResolveType(ClassFinalizer::FinalizationKind finalization,
NULL));
if (!type_parameter.IsNull()) {
// TODO(regis): Check for absence of type arguments.
- // For now, return as malformed type.
- Type& malformed_type = Type::ZoneHandle(Z);
- malformed_type = ClassFinalizer::NewFinalizedMalformedType(
- Error::Handle(Z), // No previous error.
- script_,
- type->token_pos(),
- "function type parameter '%s' not yet supported",
- String::Handle(Z, type_parameter.name()).ToCString());
- *type = malformed_type.raw();
+ // For now, resolve the function type parameter to dynamic.
+ *type = Type::DynamicType();
return;
}
}
@@ -13001,15 +12988,9 @@ AstNode* Parser::ResolveIdent(TokenPosition ident_pos,
CaptureFunctionInstantiator();
}
// TODO(regis): Finalize type parameter and return as type node.
- // For now, return as malformed type.
- Type& malformed_type = Type::ZoneHandle(Z);
- malformed_type = ClassFinalizer::NewFinalizedMalformedType(
- Error::Handle(Z), // No previous error.
- script_,
- ident_pos,
- "function type parameter '%s' not yet supported",
- ident.ToCString());
- return new(Z) TypeNode(ident_pos, malformed_type);
+ // For now, map to dynamic type.
+ Type& type = Type::ZoneHandle(Z, Type::DynamicType());
+ return new(Z) TypeNode(ident_pos, type);
}
}
}
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698