Skip to content

Commit f5a64a8

Browse files
authored
Add a test for getter doc inheritance when overridden by variable. (#1781)
* Implement new-style mixin support * Regenerate package documentation, dropping stable * Fix problem where we created Fields without accessors * Use published analyzer in override * Disable try_publish and make grind more tolerant of preexisting overrides to make travis green * Test for #1779 * Review comments * dartfmt
1 parent 066e7b8 commit f5a64a8

34 files changed

+568
-30
lines changed

test/model_test.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,12 @@ void main() {
12011201
expect(localMethod.documentationAsHtml, contains('<code>bar</code>'));
12021202
});
12031203

1204+
test('doc comment inherited from getter', () {
1205+
Field getterWithDocs = subForDocComments.instanceProperties
1206+
.firstWhere((m) => m.name == 'getterWithDocs');
1207+
expect(getterWithDocs.documentationAsHtml, contains('Some really great topics.'));
1208+
});
1209+
12041210
test(
12051211
'a property with no explicit getters and setters does not duplicate docs',
12061212
() {

testing/test_package/lib/fake.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,9 @@ class BaseForDocComments {
839839

840840
void anotherMethod() {}
841841

842+
/// Some really great topics.
843+
bool get getterWithDocs => true;
844+
842845
String operator [](String key) => "${key}'s value";
843846
}
844847

@@ -847,6 +850,9 @@ class BaseForDocComments {
847850
class SubForDocComments extends BaseForDocComments {
848851
/// Reference to [foo] and [bar]
849852
void localMethod(String foo, bar) {}
853+
854+
@override
855+
final bool getterWithDocs = false;
850856
}
851857

852858
typedef void VoidCallback();

testing/test_package_docs/fake/BaseForDocComments-class.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,18 @@ <h2>Constructors</h2>
203203
</dl>
204204
</section>
205205

206-
<section class="summary offset-anchor inherited" id="instance-properties">
206+
<section class="summary offset-anchor" id="instance-properties">
207207
<h2>Properties</h2>
208208

209209
<dl class="properties">
210+
<dt id="getterWithDocs" class="property">
211+
<span class="name"><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></span>
212+
<span class="signature">&#8594; bool</span>
213+
</dt>
214+
<dd>
215+
Some really great topics.
216+
<div class="features">read-only</div>
217+
</dd>
210218
<dt id="hashCode" class="property inherited">
211219
<span class="name"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></span>
212220
<span class="signature">&#8594; int</span>
@@ -302,9 +310,10 @@ <h2>Operators</h2>
302310
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
303311
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
304312

305-
<li class="section-title inherited">
313+
<li class="section-title">
306314
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
307315
</li>
316+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
308317
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
309318
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
310319

testing/test_package_docs/fake/BaseForDocComments/BaseForDocComments.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

testing/test_package_docs/fake/BaseForDocComments/anotherMethod.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

testing/test_package_docs/fake/BaseForDocComments/doAwesomeStuff.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<meta name="description" content="API docs for the getterWithDocs property from the BaseForDocComments class, for the Dart programming language.">
8+
<title>getterWithDocs property - BaseForDocComments class - fake library - Dart API</title>
9+
<!-- required because all the links are pseudo-absolute -->
10+
<base href="../..">
11+
12+
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
13+
<link rel="stylesheet" href="static-assets/github.css">
14+
<link rel="stylesheet" href="static-assets/styles.css">
15+
<link rel="icon" href="static-assets/favicon.png">
16+
17+
</head>
18+
19+
<body>
20+
21+
<div id="overlay-under-drawer"></div>
22+
23+
<header id="title">
24+
<button id="sidenav-left-toggle" type="button">&nbsp;</button>
25+
<ol class="breadcrumbs gt-separated dark hidden-xs">
26+
<li><a href="index.html">test_package</a></li>
27+
<li><a href="fake/fake-library.html">fake</a></li>
28+
<li><a href="fake/BaseForDocComments-class.html">BaseForDocComments</a></li>
29+
<li class="self-crumb">getterWithDocs property</li>
30+
</ol>
31+
<div class="self-name">getterWithDocs</div>
32+
<form class="search navbar-right" role="search">
33+
<input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
34+
</form>
35+
</header>
36+
37+
<main>
38+
39+
<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
40+
<h5>BaseForDocComments class</h5>
41+
<ol>
42+
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
43+
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
44+
45+
<li class="section-title">
46+
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
47+
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
49+
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
50+
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
51+
52+
<li class="section-title"><a href="fake/BaseForDocComments-class.html#instance-methods">Methods</a></li>
53+
<li><a href="fake/BaseForDocComments/anotherMethod.html">anotherMethod</a></li>
54+
<li><a href="fake/BaseForDocComments/doAwesomeStuff.html">doAwesomeStuff</a></li>
55+
<li class="inherited"><a href="fake/BaseForDocComments/noSuchMethod.html">noSuchMethod</a></li>
56+
<li class="inherited"><a href="fake/BaseForDocComments/toString.html">toString</a></li>
57+
58+
<li class="section-title"><a href="fake/BaseForDocComments-class.html#operators">Operators</a></li>
59+
<li><a href="fake/BaseForDocComments/operator_get.html">operator []</a></li>
60+
<li class="inherited"><a href="fake/BaseForDocComments/operator_equals.html">operator ==</a></li>
61+
62+
63+
64+
</ol>
65+
</div><!--/.sidebar-offcanvas-->
66+
67+
<div class="col-xs-12 col-sm-9 col-md-8 main-content">
68+
<h1>getterWithDocs property</h1>
69+
70+
71+
<section id="getter">
72+
73+
<section class="multi-line-signature">
74+
<span class="returntype">bool</span>
75+
<span class="name ">getterWithDocs</span>
76+
77+
</section>
78+
79+
<section class="desc markdown">
80+
<p>Some really great topics.</p>
81+
</section>
82+
83+
</section>
84+
85+
</div> <!-- /.main-content -->
86+
87+
<div class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
88+
</div><!--/.sidebar-offcanvas-->
89+
90+
</main>
91+
92+
<footer>
93+
<span class="no-break">
94+
test_package 0.0.1
95+
</span>
96+
97+
</footer>
98+
99+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
100+
<script src="static-assets/typeahead.bundle.min.js"></script>
101+
<script src="static-assets/highlight.pack.js"></script>
102+
<script src="static-assets/URI.js"></script>
103+
<script src="static-assets/script.js"></script>
104+
105+
106+
</body>
107+
108+
</html>

testing/test_package_docs/fake/BaseForDocComments/hashCode.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

testing/test_package_docs/fake/BaseForDocComments/noSuchMethod.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

testing/test_package_docs/fake/BaseForDocComments/operator_equals.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

testing/test_package_docs/fake/BaseForDocComments/operator_get.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

testing/test_package_docs/fake/BaseForDocComments/runtimeType.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

testing/test_package_docs/fake/BaseForDocComments/toString.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
4242
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

testing/test_package_docs/fake/SubForDocComments-class.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,18 @@ <h2>Constructors</h2>
203203
</dl>
204204
</section>
205205

206-
<section class="summary offset-anchor inherited" id="instance-properties">
206+
<section class="summary offset-anchor" id="instance-properties">
207207
<h2>Properties</h2>
208208

209209
<dl class="properties">
210+
<dt id="getterWithDocs" class="property">
211+
<span class="name"><a href="fake/SubForDocComments/getterWithDocs.html">getterWithDocs</a></span>
212+
<span class="signature">&#8594; bool</span>
213+
</dt>
214+
<dd>
215+
Some really great topics.
216+
<div class="features">final</div>
217+
</dd>
210218
<dt id="hashCode" class="property inherited">
211219
<span class="name"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></span>
212220
<span class="signature">&#8594; int</span>
@@ -311,9 +319,10 @@ <h2>Operators</h2>
311319
<li class="section-title"><a href="fake/SubForDocComments-class.html#constructors">Constructors</a></li>
312320
<li><a href="fake/SubForDocComments/SubForDocComments.html">SubForDocComments</a></li>
313321

314-
<li class="section-title inherited">
322+
<li class="section-title">
315323
<a href="fake/SubForDocComments-class.html#instance-properties">Properties</a>
316324
</li>
325+
<li><a href="fake/SubForDocComments/getterWithDocs.html">getterWithDocs</a></li>
317326
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
318327
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
319328

testing/test_package_docs/fake/SubForDocComments/SubForDocComments.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ <h5>SubForDocComments class</h5>
4242
<li class="section-title"><a href="fake/SubForDocComments-class.html#constructors">Constructors</a></li>
4343
<li><a href="fake/SubForDocComments/SubForDocComments.html">SubForDocComments</a></li>
4444

45-
<li class="section-title inherited">
45+
<li class="section-title">
4646
<a href="fake/SubForDocComments-class.html#instance-properties">Properties</a>
4747
</li>
48+
<li><a href="fake/SubForDocComments/getterWithDocs.html">getterWithDocs</a></li>
4849
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
4950
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>
5051

0 commit comments

Comments
 (0)