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

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

Issue 252693006: Fix for 18468- T << Type where T is a type parameter and Type is the type Type from dart.core (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase and code review change Created 6 years, 8 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_test/src/com/google/dart/engine/internal/type/InterfaceTypeImplTest.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 519d892f4880cc74c16e0695f054e15a4dcf4602..de24c59b3b72647138b28a755eee455d04c4bef2 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,6 +13,8 @@
*/
package com.google.dart.engine.internal.type;
+import com.google.dart.engine.element.Element;
+import com.google.dart.engine.element.LibraryElement;
import com.google.dart.engine.element.TypeParameterElement;
import com.google.dart.engine.internal.element.ElementPair;
import com.google.dart.engine.type.Type;
@@ -35,6 +37,11 @@ public class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType
public static final TypeParameterType[] EMPTY_ARRAY = new TypeParameterType[0];
/**
+ * The name of the type Type from dart.core.
+ */
+ private static final String TYPE_CLASS_NAME = "Type"; //$NON-NLS-1$
+
+ /**
* Return an array containing the type parameter types defined by the given array of type
* parameter elements.
*
@@ -131,6 +138,16 @@ public class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType
private boolean isMoreSpecificThan(Type s, Set<Type> visitedTypes, boolean withDynamic,
Set<TypePair> visitedTypePairs) {
+ //
+ // If s is of type Type from dart.core, return true
karlklose 2014/04/30 09:42:40 This is not correct: [Type] is a normal class and
+ //
+ Element sElement = s.getElement();
+ LibraryElement sLibrary = sElement != null ? sElement.getLibrary() : null;
+ if (sLibrary != null && sLibrary.isDartCore() && s.getName().equals(TYPE_CLASS_NAME)) {
+ return true;
+ }
+
+ //
// T is a type parameter and S is the upper bound of T.
//
Type bound = getElement().getBound();
@@ -138,6 +155,7 @@ public class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType
return true;
}
+ //
// T is a type parameter and S is Object.
//
if (s.isObject()) {
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/InterfaceTypeImplTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698