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 |