| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index a6ba79ffd30daf4695c7a0ed0c9d35acc87397cd..e00640e3ab021ababcfcce05b187fa01b2f23252 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -3820,6 +3820,7 @@ bool Class::TypeTestNonRecursive(const Class& cls,
|
| Zone* zone = Thread::Current()->zone();
|
| Class& thsi = Class::Handle(zone, cls.raw());
|
| while (true) {
|
| + ASSERT(!thsi.IsVoidClass());
|
| // Check for DynamicType.
|
| // Each occurrence of DynamicType in type T is interpreted as the dynamic
|
| // type, a supertype of all types.
|
| @@ -3838,15 +3839,10 @@ bool Class::TypeTestNonRecursive(const Class& cls,
|
| return test_kind == Class::kIsSubtypeOf;
|
| }
|
| // Check for ObjectType. Any type that is not NullType or DynamicType
|
| - // (already checked above), is more specific than ObjectType/VoidType.
|
| - if (other.IsObjectClass() || other.IsVoidClass()) {
|
| + // (already checked above), is more specific than ObjectType.
|
| + if (other.IsObjectClass()) {
|
| return true;
|
| }
|
| - // If other is neither Object, dynamic or void, then ObjectType/VoidType
|
| - // can't be a subtype of other.
|
| - if (thsi.IsObjectClass() || thsi.IsVoidClass()) {
|
| - return false;
|
| - }
|
| // Check for reflexivity.
|
| if (thsi.raw() == other.raw()) {
|
| const intptr_t num_type_params = thsi.NumTypeParameters();
|
| @@ -15834,7 +15830,7 @@ bool Instance::IsInstanceOf(
|
| ASSERT(!other.IsMalformed());
|
| ASSERT(!other.IsMalbounded());
|
| if (other.IsVoidType()) {
|
| - return true;
|
| + return false;
|
| }
|
| Zone* zone = Thread::Current()->zone();
|
| const Class& cls = Class::Handle(zone, clazz());
|
| @@ -16652,12 +16648,9 @@ bool AbstractType::TypeTest(TypeTestKind test_kind,
|
| return false;
|
| }
|
| // Any type is a subtype of (and is more specific than) Object and dynamic.
|
| - // As of Dart 1.24, void is dynamically treated like Object (except when
|
| - // comparing function-types).
|
| // As of Dart 1.5, the Null type is a subtype of (and is more specific than)
|
| // any type.
|
| - if (other.IsObjectType() || other.IsDynamicType() || other.IsVoidType() ||
|
| - IsNullType()) {
|
| + if (other.IsObjectType() || other.IsDynamicType() || IsNullType()) {
|
| return true;
|
| }
|
| Zone* zone = Thread::Current()->zone();
|
|
|