File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,6 +224,13 @@ class Client
224224 default :
225225 }
226226
227+ switch ReturnExpressions .testClientThisReturn () {
228+ case Error (message ):
229+ Common .status = ' Failed test for client this return stopping evaluation: ' + message ;
230+ return ;
231+ default :
232+ }
233+
227234 switch ReturnExpressions .testFuncReturn () {
228235 case Error (message ):
229236 Common .status = ' Failed test for function value return stopping evaluation: ' + message ;
Original file line number Diff line number Diff line change @@ -45,4 +45,22 @@ class ReturnExpressions {
4545 }
4646 return Error (" Host method executed after return" );
4747 }
48+
49+ function vtableMethod (_ ) {}
50+
51+ @:analyzer (ignore )
52+ public static function returnAsClientThis () {
53+ // if return is not handled, there is no instance to run the method with
54+ // so this will give a null function exception
55+ (cast return : ReturnExpressions ).vtableMethod (Common .incrementCount ());
56+ }
57+
58+ public static function testClientThisReturn () {
59+ Common .count = 0 ;
60+ returnAsClientThis ();
61+ if (Common .count == 0 ) {
62+ return Ok ;
63+ }
64+ return Error (" Host method executed after return" );
65+ }
4866}
You can’t perform that action at this time.
0 commit comments