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

Unified Diff: runtime/vm/object.cc

Issue 2907423003: Allow 'void' as a type argument (fixes #28945). (Closed)
Patch Set: work in progress Created 3 years, 7 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 | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 0446fa78fdd2db4a346817324f257d93dfc425ef..4707f59415df9f4d28c6dc4c52fadab3aeb421d0 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -15878,6 +15878,7 @@ bool Instance::IsInstanceOf(
}
if (instantiated_other.IsDynamicType() ||
instantiated_other.IsObjectType() ||
+ instantiated_other.IsVoidType() ||
instantiated_other.IsDartFunctionType()) {
return true;
}
@@ -15928,7 +15929,8 @@ bool Instance::IsInstanceOf(
if (instantiated_other.IsTypeRef()) {
instantiated_other = TypeRef::Cast(instantiated_other).type();
}
- if (instantiated_other.IsDynamicType()) {
+ if (instantiated_other.IsDynamicType() ||
+ instantiated_other.IsObjectType() || instantiated_other.IsVoidType()) {
return true;
}
}
@@ -15963,7 +15965,7 @@ bool Instance::IsInstanceOf(
if (IsNull()) {
ASSERT(cls.IsNullClass());
// As of Dart 1.5, the null instance and Null type are handled differently.
- // We already checked for other.IsDynamicType().
+ // We already checked other for dynamic and void.
return other_class.IsNullClass() || other_class.IsObjectClass();
}
return cls.IsSubtypeOf(type_arguments, other_class, other_type_arguments,
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698