Skip to content

use_super_parameters doesn't trigger if types change #59226

Open

Description

@goderbauer
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.

Activity

  1. added
    linter-false-negativeIssues related to lint rules that fail to report a problem.
    P3A lower priority bug or feature request
    on Jul 24, 2023
  2. added
    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
    on Apr 3, 2024
  3. goderbauer commented on May 13, 2024

    @goderbauer
    ContributorAuthor
  4. added
    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
    and removed on Feb 21, 2025
  5. self-assigned this
    on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-false-negativeIssues related to lint rules that fail to report a problem.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions