getterWithDocs property
+ + +Some really great topics.
+diff --git a/test/model_test.dart b/test/model_test.dart
index c9fc44569b..1122d0004b 100644
--- a/test/model_test.dart
+++ b/test/model_test.dart
@@ -1201,6 +1201,12 @@ void main() {
expect(localMethod.documentationAsHtml, contains('bar
'));
});
+ test('doc comment inherited from getter', () {
+ Field getterWithDocs = subForDocComments.instanceProperties
+ .firstWhere((m) => m.name == 'getterWithDocs');
+ expect(getterWithDocs.documentationAsHtml, contains('Some really great topics.'));
+ });
+
test(
'a property with no explicit getters and setters does not duplicate docs',
() {
diff --git a/testing/test_package/lib/fake.dart b/testing/test_package/lib/fake.dart
index 9b8bb4f92e..9afbbc57c6 100644
--- a/testing/test_package/lib/fake.dart
+++ b/testing/test_package/lib/fake.dart
@@ -839,6 +839,9 @@ class BaseForDocComments {
void anotherMethod() {}
+ /// Some really great topics.
+ bool get getterWithDocs => true;
+
String operator [](String key) => "${key}'s value";
}
@@ -847,6 +850,9 @@ class BaseForDocComments {
class SubForDocComments extends BaseForDocComments {
/// Reference to [foo] and [bar]
void localMethod(String foo, bar) {}
+
+ @override
+ final bool getterWithDocs = false;
}
typedef void VoidCallback();
diff --git a/testing/test_package_docs/fake/BaseForDocComments-class.html b/testing/test_package_docs/fake/BaseForDocComments-class.html
index 41a4d427e1..a5d7f0bb63 100644
--- a/testing/test_package_docs/fake/BaseForDocComments-class.html
+++ b/testing/test_package_docs/fake/BaseForDocComments-class.html
@@ -203,10 +203,18 @@
Some really great topics.
+Some really great topics.
+Some really great topics.
+Some really great topics.
+