Skip to content

Commit f4a5b2d

Browse files
pqCommit Queue
authored and
Commit Queue
committed
[wildcards] unnecessary_final tests
Fixes #55920 See also https://github.com/dart-lang/linter/issues/4969 Change-Id: Id70834d6b71a268ed6037203124ae10a5eb1d592 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375082 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
1 parent e43f086 commit f4a5b2d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pkg/linter/test/rules/unnecessary_final_test.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,29 @@ void f() {
7373
]);
7474
}
7575

76+
test_localVariable_final_wildcard() async {
77+
await assertDiagnostics(r'''
78+
void f() {
79+
final _ = '';
80+
}
81+
''', [
82+
lint(13, 5),
83+
]);
84+
}
85+
86+
test_localVariable_final_wildcard_preWildcards() async {
87+
await assertDiagnostics(r'''
88+
// @dart = 3.4
89+
// (pre wildcard-variables)
90+
91+
void f() {
92+
final _ = '';
93+
}
94+
''', [
95+
lint(57, 5),
96+
]);
97+
}
98+
7699
test_localVariable_var() async {
77100
await assertNoDiagnostics(r'''
78101
void f() {

0 commit comments

Comments
 (0)