Skip to content

Commit b39f386

Browse files
pqCommit Queue
authored and
Commit Queue
committed
[wildcards] don’t overreport parameter_assignments
Fixes: https://github.com/dart-lang/linter/issues/5041 Change-Id: I128933b8f5c720acbbc2ec57a90dc2992977bb05 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378571 Commit-Queue: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 4ec57e2 commit b39f386

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/linter/test/rules/parameter_assignments_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ void f({int? p}) {
3939
]);
4040
}
4141

42+
test_assignment_wildcard() async {
43+
await assertDiagnostics(r'''
44+
void f([int? _]) {
45+
_ = 8;
46+
}
47+
''', [
48+
// No lint.
49+
error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 21, 1),
50+
]);
51+
}
52+
4253
@FailingTest(reason: 'Closures not implemented')
4354
test_closure_assignment() async {
4455
await assertDiagnostics(r'''

0 commit comments

Comments
 (0)