-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
The existence of the DartType.isEquivalentTo method is confusing. Two DartType objects should be considered equal (and have the same hashCode) if and only if the represent the same type as defined by the spec.
So for instance, given the typedef:
typedef void F<T>(); // T is not used!F<int>, F<bool>, and () -> void all represent the same type in the eyes of the spec. The analyzer's isEquivalentTo method reports that they are equivalent, but operator== and hashCode treat them as different.
We should fix this so that operator== and hashCode treat the types as equivalent.
I suspect this will require substantial rework of the FunctionType class.
For more details see comments in https://dart-review.googlesource.com/c/sdk/+/86222/2/pkg/analyzer/lib/dart/element/type.dart.