Skip to content
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

use_super_parameters doesn't trigger if types change #4614

Open
goderbauer opened this issue Jul 24, 2023 · 1 comment
Open

use_super_parameters doesn't trigger if types change #4614

goderbauer opened this issue Jul 24, 2023 · 1 comment
Labels
false-negative P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@goderbauer
Copy link
Contributor

class Foo {
  Foo({required this.foo});

  num foo;
}

class Bar extends Foo {
  Bar({required int foo}) : super(foo: foo);
}

The code above can be refactored to use super params as shown below, but the lint doesn't trigger

class Foo {
  Foo({required this.foo});

  num foo;
}

class Bar extends Foo {
  Bar({required int super.foo});
}

Note: if in the original example int is removed, the lint triggers as expected.

@pq pq added false-negative P3 A lower priority bug or feature request labels Jul 24, 2023
@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Apr 3, 2024
@goderbauer
Copy link
Contributor Author

There are some more examples of this in https://github.com/flutter/flutter/pull/147621/files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false-negative P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants