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

Unified Diff: pkg/analyzer/lib/src/generated/type_system.dart

Issue 2375103004: fix #27210, remove TypeParameterMember equality (Closed)
Patch Set: fix bound check to use == Created 4 years, 3 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 | « pkg/analyzer/lib/src/dart/element/type.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/type_system.dart
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart
index 5574aed89f2b09b3e9abf83af23f13bfb8b2f982..51945ec29601fdc2ee281a695d9af796f451f072 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -851,7 +851,7 @@ class StrongTypeSystemImpl extends TypeSystem {
if (identical(i1, i2)) {
return true;
}
-
+
// Guard recursive calls
_GuardedSubtypeChecker<InterfaceType> guardedInterfaceSubtype = _guard(
(DartType i1, DartType i2, Set<Element> visited) =>
@@ -932,14 +932,15 @@ class StrongTypeSystemImpl extends TypeSystem {
// True if T == S
// Or true if bound of S is S' and S' <: T
if (t1 is TypeParameterType) {
- if (t1 == t2) {
+ if (t2 is TypeParameterType &&
+ t1.definition == t2.definition &&
+ t1.bound == t2.bound) {
return true;
}
if (guardedInferTypeParameter(t1, t2, visited)) {
return true;
}
- DartType bound = t1.element.bound;
- return bound == null ? false : guardedSubtype(bound, t2, visited);
+ return guardedSubtype(t1.bound, t2, visited);
}
if (t2 is TypeParameterType) {
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/type.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698