Skip to content

Commit

Permalink
[linter] Add field and super parameter tests for comment_references lint
Browse files Browse the repository at this point in the history
The core issue was solved in c8b1843.
This CL adds tests to verify the linter correctly finds the associated static elements and doesn't report a comment_references lint.

Closes https://github.com/dart-lang/linter/issues/3563

Bug: https://github.com/dart-lang/linter/issues/3563
Change-Id: Icf281faf1934b135b51e98271be461b527b83a14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339061
Auto-Submit: Parker Lougheed <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Reviewed-by: Phil Quitslund <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
  • Loading branch information
parlough authored and Commit Queue committed Dec 2, 2023
1 parent 24fafa3 commit 80ad968
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/linter/test/rules/comment_references_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,30 @@ class A {
''');
}

test_parameter_constructor_field() async {
await assertNoDiagnostics(r'''
class A {
final int x;
/// [x]
A(this.x);
}
''');
}

test_parameter_constructor_super() async {
await assertNoDiagnostics(r'''
class A {
A(int x);
}
class B extends A {
/// [x]
B(super.x);
}
''');
}

test_this() async {
await assertDiagnostics(r'''
/// [this]
Expand Down

0 comments on commit 80ad968

Please sign in to comment.