-
Notifications
You must be signed in to change notification settings - Fork 1.7k
iterable_contains_unrelated_type not working for List #57708
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
Comments
I just tried adding the example you provide and the test fails, also confirmed that if I remove the I have no idea what the problem is :( |
👍 We mock the SDK to speed up testing and it looks like (In the SDK, |
/cc @alexeieleusis |
I think the issue is that Indeed, in the SDK Perhaps replacing that bespoke method with a call to |
I take that back -- after changing the mock NB: The mock SDK has been moved to the analyzer package. |
I think the lint
// main.dart
void someFunction() {
var list = <int>[];
if (list.contains('1')) print('someFunction');
} # analysis_options.yaml
linter:
rules:
- iterable_contains_unrelated_type
|
In IntelliJ, I see this triggers the lint:
and this:
but not this:
I'm at a loss as to why not; it looks like there are test cases that should catch this in the linter code, and they pass. Maybe there is something in the test setup that is now different from the actual
List
?The text was updated successfully, but these errors were encountered: