File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,11 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
186186 return _nodeExits (node.argumentList);
187187 }
188188
189+ @override
190+ bool visitDotShorthandPropertyAccess (DotShorthandPropertyAccess node) {
191+ return _elementExits (node.propertyName.element);
192+ }
193+
189194 @override
190195 bool visitEmptyStatement (EmptyStatement node) => false ;
191196
Original file line number Diff line number Diff line change @@ -1027,6 +1027,28 @@ void f() {
10271027''' , 0 );
10281028 }
10291029
1030+ test_dotShorthandPropertyAccess_getterReturnsNever () async {
1031+ await _assertNthStatementExits (r'''
1032+ class C {
1033+ static Never get foo => throw 42;
1034+ }
1035+ void f() {
1036+ C _ = .foo;
1037+ }
1038+ ''' , 0 );
1039+ }
1040+
1041+ test_dotShorthandPropertyAccess_noExit () async {
1042+ await _assertNthStatementDoesNotExit (r'''
1043+ class C {
1044+ static C get foo => C();
1045+ }
1046+ void f() {
1047+ C _ = .foo;
1048+ }
1049+ ''' , 0 );
1050+ }
1051+
10301052 test_forStatement_implicitTrue_breakWithLabel () async {
10311053 await _assertNthStatementDoesNotExit (r'''
10321054void f() {
You can’t perform that action at this time.
0 commit comments