Description
This is a little strange and doesn't reproduce consistently, but I'll try to provide as much details as I have. In IntelliJ I have a workspace that has a bunch of projects open (including the flutter repository). In this one, I also have a tiny playground project with two files:
foo.dart:
class Foo {
Foo({required this.foo});
Bar? foo;
}
class Bar {
}
main.dart:
// @dart = 2.9
import 'foo.dart';
void main() {
Foo(foo: null); // 🔥 sometimes this line has an incorrect avoid_redundant_argument_values
}
Now, sometimes I see what appears to be an incorrect avoid_redundant_argument_values
warning on the line with the 🔥. The warning doesn't show up consistently. Sometimes it doesn't show up at all, sometimes it shows up for 5s to 10s and then disappears. Sometimes it sticks around indefinitely until I edit the code again. It's a bit of a mystery.
Here are random changes I have made to the files to make the warning appear/disappear (I believe the warning is incorrect in all cases):
- change the type of the
foo
field toint?
- change it back to
Bar?
- remove the
@dart
directive from main.dart - put the
@dart
directive back in - add empty new lines at the end of the main.dart file