| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/VoidTypeImpl.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/VoidTypeImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/VoidTypeImpl.java
|
| index 3589b278b85703088aeeaa03d231fe8bdd49b25d..a238cecf3bdb81ddc998e6faadabc40445bd5ef4 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/VoidTypeImpl.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/VoidTypeImpl.java
|
| @@ -17,6 +17,8 @@ import com.google.dart.engine.scanner.Keyword;
|
| import com.google.dart.engine.type.Type;
|
| import com.google.dart.engine.type.VoidType;
|
|
|
| +import java.util.Set;
|
| +
|
| /**
|
| * The unique instance of the class {@code VoidTypeImpl} implements the type {@code void}.
|
| *
|
| @@ -50,26 +52,27 @@ public class VoidTypeImpl extends TypeImpl implements VoidType {
|
| }
|
|
|
| @Override
|
| - public boolean isMoreSpecificThan(Type type, boolean withDynamic) {
|
| - return isSubtypeOf(type);
|
| + public boolean isVoid() {
|
| + return true;
|
| }
|
|
|
| @Override
|
| - public boolean isSubtypeOf(Type type) {
|
| - // The only subtype relations that pertain to void are therefore:
|
| - // void <: void (by reflexivity)
|
| - // bottom <: void (as bottom is a subtype of all types).
|
| - // void <: dynamic (as dynamic is a supertype of all types)
|
| - return type == this || type == DynamicTypeImpl.getInstance();
|
| + public VoidTypeImpl substitute(Type[] argumentTypes, Type[] parameterTypes) {
|
| + return this;
|
| }
|
|
|
| @Override
|
| - public boolean isVoid() {
|
| - return true;
|
| + protected boolean internalIsMoreSpecificThan(Type type, boolean withDynamic,
|
| + Set<TypePair> visitedTypePairs) {
|
| + return isSubtypeOf(type);
|
| }
|
|
|
| @Override
|
| - public VoidTypeImpl substitute(Type[] argumentTypes, Type[] parameterTypes) {
|
| - return this;
|
| + protected boolean internalIsSubtypeOf(Type type, Set<TypePair> visitedTypePairs) {
|
| + // The only subtype relations that pertain to void are therefore:
|
| + // void <: void (by reflexivity)
|
| + // bottom <: void (as bottom is a subtype of all types).
|
| + // void <: dynamic (as dynamic is a supertype of all types)
|
| + return type == this || type == DynamicTypeImpl.getInstance();
|
| }
|
| }
|
|
|