-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strong mode complains about Equality default constructor params. #703
Comments
Looks like this isn't actually possible in Dart right now due to dart-lang/sdk#22329. |
What version of collection are you using? I don't see any strong-mode errors with the most recent version. |
1.6.0 |
The full line of code that produced the warnings was: I was able to remove the warnings by changing it to: |
What version of Dart are you using? I don't see any strong-mode messages when running the 1.16 analyzer on collection 1.6.0. |
It's v1_17_0_dev_2_0; I can ping you a test link if that helps. |
I can't reproduce this at all.
I can only guess that you're somehow using a different version of |
I understand what's happening now; this was hidden when analyzing the libraries themselves due to dart-lang/sdk#26141. It's actually a duplicate of #700. |
E.g., "const ListEquality()" causes the following warnings:
[INFO] The object type 'DefaultEquality' cannot be assigned to the field '_elementEquality', which has type 'Equality' [CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH]
[INFO] The object type 'DefaultEquality' cannot be assigned to a parameter of type 'Equality' [CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]
This is because of the type mismatch in ListEquality's default constructor parameters:
final Equality _elementEquality;
const ListEquality([Equality elementEquality = const DefaultEquality()])
: _elementEquality = elementEquality;
and can be fixed by adding the generic type. I'll send a pull request for this and similar classes.
The text was updated successfully, but these errors were encountered: