mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:21:54 +00:00
[wildcards] avoid_unused_constructor_parameters
wildcard test
Test to ensure that `avoid_unused_constructor_parameters` doesn't overreport in the presence of an unused wildcard param. (Note that underscores are ignored pre-wildcards too and this ensures that that behavior is preserved too.) Fixes: https://github.com/dart-lang/linter/issues/4995 Change-Id: I13ef73eb28cf2501ed292dd3c56c9933a8feefa9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370540 Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Auto-Submit: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
7d7596fe3a
commit
224d19ec06
|
@ -177,7 +177,7 @@ class PubPackageResolutionTest extends _ContextResolutionTest {
|
|||
|
||||
bool get dumpAstOnFailures => true;
|
||||
|
||||
List<String> get experiments => ['macros'];
|
||||
List<String> get experiments => ['macros', 'wildcard-variables'];
|
||||
|
||||
List<String> get lintRules => _lintRules;
|
||||
|
||||
|
|
|
@ -63,6 +63,25 @@ class A {
|
|||
class B extends A {
|
||||
B(super.a, super.b);
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
test_wildcardParam() async {
|
||||
await assertNoDiagnostics(r'''
|
||||
class C {
|
||||
C(int _);
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
test_wildcardParam_preWildcards() async {
|
||||
await assertNoDiagnostics(r'''
|
||||
// @dart = 3.4
|
||||
// (pre wildcard-variables)
|
||||
|
||||
class C {
|
||||
C(int _);
|
||||
}
|
||||
''');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue