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

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

Issue 26888007: Propagate type arguments into type variable bounds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/TypeParameterTypeImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/TypeParameterTypeImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/TypeParameterTypeImpl.java
index 397a2f91406cc6882203ef881270650bdd80ec87..7aa259bed23890e5f8f4010149937eaf0d1d28d9 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/TypeParameterTypeImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/TypeParameterTypeImpl.java
@@ -13,10 +13,7 @@
*/
package com.google.dart.engine.internal.type;
-import com.google.common.base.Objects;
-import com.google.dart.engine.element.ClassElement;
import com.google.dart.engine.element.TypeParameterElement;
-import com.google.dart.engine.type.InterfaceType;
import com.google.dart.engine.type.Type;
import com.google.dart.engine.type.TypeParameterType;
import com.google.dart.engine.utilities.general.ObjectUtilities;
@@ -125,24 +122,6 @@ public class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType
return this;
}
- /**
- * Returns <i>Base</i> if given class is <i>Base&lt;T></i> where <i>T extends Base&lt;T></i>, or
- * {@code null} otherwise.
- */
- private ClassElement getSelfBoundTypeParameterClass(InterfaceType interfaceType) {
- Type[] typeArguments = interfaceType.getTypeArguments();
- if (typeArguments.length == 1) {
- Type typeArgument = typeArguments[0];
- if (typeArgument instanceof TypeParameterType) {
- TypeParameterType typeParameter = (TypeParameterType) typeArgument;
- if (Objects.equal(typeParameter.getElement().getBound(), interfaceType)) {
- return interfaceType.getElement();
- }
- }
- }
- return null;
- }
-
private boolean isMoreSpecificThan(Type s, Set<Type> visitedTypes) {
// T is a type parameter and S is the upper bound of T.
//
@@ -176,19 +155,6 @@ public class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType
return boundTypeParameter.isMoreSpecificThan(s, visitedTypes);
}
- // <W extends Base<W>> is the same as <U extends Base<U>>
- if (bound instanceof InterfaceType && s instanceof InterfaceType) {
- InterfaceType boundInterfaceType = (InterfaceType) bound;
- InterfaceType sInterfaceType = (InterfaceType) s;
- ClassElement sSelfClass = getSelfBoundTypeParameterClass(sInterfaceType);
- if (sSelfClass != null) {
- ClassElement boundSelfClass = getSelfBoundTypeParameterClass(boundInterfaceType);
- if (sSelfClass.equals(boundSelfClass)) {
- return true;
- }
- }
- }
-
// Check interface type.
return bound.isMoreSpecificThan(s);
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698