dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.3k stars 1.59k forks source link

use_super_parameters doesn't trigger if types change #59226

Open goderbauer opened 1 year ago

goderbauer commented 1 year ago
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.

goderbauer commented 6 months ago

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