Skip to content

Commit

Permalink
[wildcards] unnecessary_final tests
Browse files Browse the repository at this point in the history
Fixes #55920

See also dart-lang/linter#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]>
  • Loading branch information
pq authored and Commit Queue committed Jul 10, 2024
1 parent e43f086 commit f4a5b2d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/linter/test/rules/unnecessary_final_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,29 @@ void f() {
]);
}

test_localVariable_final_wildcard() async {
await assertDiagnostics(r'''
void f() {
final _ = '';
}
''', [
lint(13, 5),
]);
}

test_localVariable_final_wildcard_preWildcards() async {
await assertDiagnostics(r'''
// @dart = 3.4
// (pre wildcard-variables)
void f() {
final _ = '';
}
''', [
lint(57, 5),
]);
}

test_localVariable_var() async {
await assertNoDiagnostics(r'''
void f() {
Expand Down

0 comments on commit f4a5b2d

Please sign in to comment.