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

Unified Diff: runtime/vm/parser.cc

Issue 81363002: Improve type test and type equality for generics (issue 15148). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 30544)
+++ runtime/vm/parser.cc (working copy)
@@ -9320,7 +9320,9 @@
element_type = list_type_arguments.TypeAt(0);
ASSERT(!element_type.IsMalformed()); // Would be mapped to dynamic.
ASSERT(!element_type.IsMalbounded()); // No declared bound in List.
- if (is_const && !element_type.IsInstantiated()) {
+ if (element_type.IsDynamicType()) {
+ list_type_arguments = AbstractTypeArguments::null();
+ } else if (is_const && !element_type.IsInstantiated()) {
ErrorMsg(type_pos,
"the type argument of a constant list literal cannot include "
"a type variable");
@@ -9516,7 +9518,9 @@
ASSERT(!key_type.IsMalformed() && !value_type.IsMalformed());
// No declared bounds in Map.
ASSERT(!key_type.IsMalbounded() && !value_type.IsMalbounded());
- if (is_const && !type_arguments.IsInstantiated()) {
+ if (key_type.IsDynamicType() && value_type.IsDynamicType()) {
+ map_type_arguments = AbstractTypeArguments::null();
+ } else if (is_const && !type_arguments.IsInstantiated()) {
ErrorMsg(type_pos,
"the type arguments of a constant map literal cannot include "
"a type variable");
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698