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 1
1
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
+ import 'package:analyzer/dart/ast/ast.dart' ;
4
5
import 'package:test/test.dart' ;
5
6
import 'package:test_reflective_loader/test_reflective_loader.dart' ;
6
7
@@ -40,7 +41,7 @@ class C {
40
41
);
41
42
}
42
43
43
- void test_doc_dot_shorthand_method_invocation_success () async {
44
+ void test_doc_dot_shorthand_constructor_invocation_success () async {
44
45
var library = await bootPackageWithLibrary ('''
45
46
class C {
46
47
/// Cannot link [.c()]
@@ -57,4 +58,23 @@ class C {
57
58
'<p>Cannot link <code>.c()</code></p>' ,
58
59
);
59
60
}
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
+ }
60
80
}
You can’t perform that action at this time.
0 commit comments