File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
4+ import 'package:analyzer/dart/ast/ast.dart' ;
45import 'package:test/test.dart' ;
56import 'package:test_reflective_loader/test_reflective_loader.dart' ;
67
@@ -40,7 +41,7 @@ class C {
4041 );
4142 }
4243
43- void test_doc_dot_shorthand_method_invocation_success () async {
44+ void test_doc_dot_shorthand_constructor_invocation_success () async {
4445 var library = await bootPackageWithLibrary ('''
4546class C {
4647 /// Cannot link [.c()]
@@ -57,4 +58,23 @@ class C {
5758 '<p>Cannot link <code>.c()</code></p>' ,
5859 );
5960 }
61+
62+ void test_doc_dot_shorthand_method_invocation_success () async {
63+ var library = await bootPackageWithLibrary ('''
64+ class C {
65+ /// Cannot link [.f()]
66+ void m(String p) {}
67+
68+
69+ static C f() => C();
70+ }
71+ ''' );
72+ var m = library.classes.named ('C' ).instanceMethods.named ('m' );
73+
74+ expect (m.hasDocumentationComment, true );
75+ expect (
76+ m.documentationAsHtml,
77+ '<p>Cannot link <code>.f()</code></p>' ,
78+ );
79+ }
6080}
You can’t perform that action at this time.
0 commit comments