File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
pkg/analysis_server/test/lsp Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,43 @@ var a; // Not a reference
6464 _testMarkedContent ('''
6565var /*[0*/^a/*0]*/ = [''].where((_) => true).toList();
6666var b = /*[1*/a/*1]*/;
67+ ''' );
68+
69+ Future <void > test_dotShorthand_class () => _testMarkedContent ('''
70+ A topA = ./*[0*/^a/*0]*/;
71+ class A {
72+ static A get /*[1*/a/*1]*/ => A();
73+ }
74+ void fn(A a) => print(a);
75+ void f() {
76+ A a = ./*[2*/a/*2]*/;
77+ fn(./*[3*/a/*3]*/);
78+ A aa = A./*[4*/a/*4]*/;
79+ }
80+ ''' );
81+
82+ Future <void > test_dotShorthand_enum () => _testMarkedContent ('''
83+ const A constA = ./*[0*/^a/*0]*/;
84+ enum A { /*[1*/a/*1]*/ }
85+ void fn(A a) => print(a);
86+ void f() {
87+ A a = ./*[2*/a/*2]*/;
88+ fn(./*[3*/a/*3]*/);
89+ A aa = A./*[4*/a/*4]*/;
90+ }
91+ ''' );
92+
93+ Future <void > test_dotShorthand_extensionType () => _testMarkedContent ('''
94+ A topA = ./*[0*/^a/*0]*/;
95+ extension type A(int x) {
96+ static A get /*[1*/a/*1]*/ => A(1);
97+ }
98+ void fn(A a) => print(a);
99+ void f() {
100+ A a = ./*[2*/a/*2]*/;
101+ fn(./*[3*/a/*3]*/);
102+ A aa = A./*[4*/a/*4]*/;
103+ }
67104''' );
68105
69106 Future <void > test_forInLoop () => _testMarkedContent ('''
You can’t perform that action at this time.
0 commit comments