avoid_shadowing_type_parameters
Avoid shadowing type parameters.
This rule is available as of Dart 2.1.
Rule sets: core, recommended, flutter
Details
#AVOID shadowing type parameters.
BAD:
dart
class A<T> {
void fn<T>() {}
}
GOOD:
dart
class A<T> {
void fn<U>() {}
}
Usage
#To enable the avoid_shadowing_type_parameters
rule, add avoid_shadowing_type_parameters
under linter > rules in your analysis_options.yaml
file:
analysis_options.yaml
yaml
linter:
rules:
- avoid_shadowing_type_parameters
Unless stated otherwise, the documentation on this site reflects Dart 3.5.4. Page last updated on 2024-07-03. View source or report an issue.