Skip to content

Commit 80ad968

Browse files
parloughCommit Queue
authored and
Commit Queue
committed
[linter] Add field and super parameter tests for comment_references lint
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]>
1 parent 24fafa3 commit 80ad968

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pkg/linter/test/rules/comment_references_test.dart

+24
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,30 @@ class A {
9393
''');
9494
}
9595

96+
test_parameter_constructor_field() async {
97+
await assertNoDiagnostics(r'''
98+
class A {
99+
final int x;
100+
101+
/// [x]
102+
A(this.x);
103+
}
104+
''');
105+
}
106+
107+
test_parameter_constructor_super() async {
108+
await assertNoDiagnostics(r'''
109+
class A {
110+
A(int x);
111+
}
112+
113+
class B extends A {
114+
/// [x]
115+
B(super.x);
116+
}
117+
''');
118+
}
119+
96120
test_this() async {
97121
await assertDiagnostics(r'''
98122
/// [this]

0 commit comments

Comments
 (0)