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

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

Issue 47923014: Issue 14364. Strengthen isDirectSupertypeOf() to check type parameters. (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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/FunctionTypeImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/FunctionTypeImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/FunctionTypeImpl.java
index 6c2d96934ca4ae490ce944fd2345c5096880b509..54a9a52d25e5e4d07b19ab585ca57fb733a21329 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/FunctionTypeImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/FunctionTypeImpl.java
@@ -286,7 +286,7 @@ public class FunctionTypeImpl extends TypeImpl implements FunctionType {
}
@Override
- public boolean isMoreSpecificThan(Type type) {
+ public boolean isMoreSpecificThan(Type type, boolean withDynamic) {
// trivial base cases
if (type == null) {
return false;
@@ -319,7 +319,7 @@ public class FunctionTypeImpl extends TypeImpl implements FunctionType {
return false;
} else if (t.getNormalParameterTypes().length > 0) {
for (int i = 0; i < tTypes.length; i++) {
- if (!tTypes[i].isMoreSpecificThan(sTypes[i])) {
+ if (!tTypes[i].isMoreSpecificThan(sTypes[i], withDynamic)) {
return false;
}
}
@@ -339,7 +339,7 @@ public class FunctionTypeImpl extends TypeImpl implements FunctionType {
if (typeT == null) {
return false;
}
- if (!typeT.isMoreSpecificThan(entryS.getValue())) {
+ if (!typeT.isMoreSpecificThan(entryS.getValue(), withDynamic)) {
return false;
}
}
@@ -358,7 +358,7 @@ public class FunctionTypeImpl extends TypeImpl implements FunctionType {
if (tOpTypes.length == 0 && sOpTypes.length == 0) {
// No positional arguments, don't copy contents to new array
for (int i = 0; i < sTypes.length; i++) {
- if (!tTypes[i].isMoreSpecificThan(sTypes[i])) {
+ if (!tTypes[i].isMoreSpecificThan(sTypes[i], withDynamic)) {
return false;
}
}
@@ -380,7 +380,7 @@ public class FunctionTypeImpl extends TypeImpl implements FunctionType {
sAllTypes[i] = sOpTypes[j];
}
for (int i = 0; i < sAllTypes.length; i++) {
- if (!tAllTypes[i].isMoreSpecificThan(sAllTypes[i])) {
+ if (!tAllTypes[i].isMoreSpecificThan(sAllTypes[i], withDynamic)) {
return false;
}
}
@@ -388,7 +388,7 @@ public class FunctionTypeImpl extends TypeImpl implements FunctionType {
}
Type tRetType = t.getReturnType();
Type sRetType = s.getReturnType();
- return sRetType.isVoid() || tRetType.isMoreSpecificThan(sRetType);
+ return sRetType.isVoid() || tRetType.isMoreSpecificThan(sRetType, withDynamic);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698