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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/DynamicTypeImpl.java

Issue 62523002: Fix for 11987. (Closed) Base URL: https://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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/DynamicTypeImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/DynamicTypeImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/DynamicTypeImpl.java
index cd8d22452e019a7e0322a162faeecccba7109afa..966ac29ce4aa5b14efc93743bf449099d959fee0 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/DynamicTypeImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/DynamicTypeImpl.java
@@ -17,6 +17,8 @@ import com.google.dart.engine.internal.element.DynamicElementImpl;
import com.google.dart.engine.scanner.Keyword;
import com.google.dart.engine.type.Type;
+import java.util.Set;
+
/**
* The unique instance of the class {@code DynamicTypeImpl} implements the type {@code dynamic}.
*
@@ -56,22 +58,6 @@ public class DynamicTypeImpl extends TypeImpl {
}
@Override
- public boolean isMoreSpecificThan(Type type, boolean withDynamic) {
- // T is S
- if (this == type) {
- return true;
- }
- // else
- return withDynamic;
- }
-
- @Override
- public boolean isSubtypeOf(Type type) {
- // dynamic is a subtype of all types
- return true;
- }
-
- @Override
public boolean isSupertypeOf(Type type) {
// dynamic is a supertype of all types
return true;
@@ -87,4 +73,21 @@ public class DynamicTypeImpl extends TypeImpl {
}
return this;
}
+
+ @Override
+ protected boolean internalIsMoreSpecificThan(Type type, boolean withDynamic,
+ Set<TypePair> visitedTypePairs) {
+ // T is S
+ if (this == type) {
+ return true;
+ }
+ // else
+ return withDynamic;
+ }
+
+ @Override
+ protected boolean internalIsSubtypeOf(Type type, Set<TypePair> visitedTypePairs) {
+ //dynamic is a subtype of all types
+ return true;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698