File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -76,4 +76,42 @@ class C {
7676 '<p>Cannot link <code>.f()</code></p>' ,
7777 );
7878 }
79+
80+ void test_doc_dot_shorthand_default_values_success () async {
81+ // For now parameter default values are not linked so this test is just to
82+ // make sure we don't crash.
83+ var library = await bootPackageWithLibrary ('''
84+ enum Color {
85+ red, green
86+ }
87+
88+ class C {
89+ void m({Color c = .red}) {}
90+ }
91+ ''' );
92+ var m = library.classes.named ('C' ).instanceMethods.named ('m' );
93+
94+ expect (m.hasDocumentationComment, false );
95+ }
96+
97+ void test_doc_dot_shorthand_annotation_success () async {
98+ // For now parameters in annotations are not linked so this test is just to
99+ // make sure we don't crash.
100+ var library = await bootPackageWithLibrary ('''
101+ enum Color {
102+ red, green
103+ }
104+
105+ class C {
106+ final Color c;
107+ const C(this.c);
108+ }
109+
110+ @C(.red)
111+ void m(){}
112+ ''' );
113+ var m = library.functions.named ('m' );
114+
115+ expect (m.hasAnnotations, true );
116+ }
79117}
You can’t perform that action at this time.
0 commit comments