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

Unified Diff: pkg/analyzer/lib/src/dart/element/member.dart

Issue 2291103004: fix #25740 again, making sure we have the substituted bound in inference (Closed)
Patch Set: merge and add todo Created 4 years, 4 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 | pkg/analyzer/test/generated/type_system_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/member.dart
diff --git a/pkg/analyzer/lib/src/dart/element/member.dart b/pkg/analyzer/lib/src/dart/element/member.dart
index 76ec36c2a0e31ff8cadeb6deeb2474bde6859297..4c95b28e2d80ca569c39633cdb9c2a106cf8cbc3 100644
--- a/pkg/analyzer/lib/src/dart/element/member.dart
+++ b/pkg/analyzer/lib/src/dart/element/member.dart
@@ -937,9 +937,13 @@ class TypeParameterMember extends Member implements TypeParameterElement {
@override
final DartType bound;
+ DartType _type;
+
TypeParameterMember(
TypeParameterElement baseElement, DartType definingType, this.bound)
- : super(baseElement, definingType);
+ : super(baseElement, definingType) {
+ _type = new TypeParameterTypeImpl(this);
+ }
@override
TypeParameterElement get baseElement =>
@@ -949,11 +953,20 @@ class TypeParameterMember extends Member implements TypeParameterElement {
Element get enclosingElement => baseElement.enclosingElement;
@override
- TypeParameterType get type => baseElement.type;
+ TypeParameterType get type => _type;
@override
accept(ElementVisitor visitor) => visitor.visitTypeParameterElement(this);
+ @override
+ int get hashCode => baseElement.hashCode;
+
+ @override
+ bool operator ==(obj) =>
+ // TODO(jmesserly): this equality should consider the bound, see:
+ // https://github.com/dart-lang/sdk/issues/27210
+ obj is TypeParameterMember && obj.baseElement == baseElement;
+
/**
* If the given [parameter]'s type is different when any type parameters from
* the defining type's declaration are replaced with the actual type
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/type_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698