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 .testFuncReturn () {
228+ case Error (message ):
229+ Common .status = ' Failed test for function value return stopping evaluation: ' + message ;
230+ return ;
231+ default :
232+ }
233+
227234 // regression test for #926
228235 var x : Dynamic = 3 ;
229236 x * = 5 ;
Original file line number Diff line number Diff line change @@ -29,4 +29,20 @@ class ReturnExpressions {
2929 }
3030 return Error (" Host method executed after return" );
3131 }
32+
33+ @:analyzer (ignore )
34+ static function returnAsFunction () {
35+ // if return is not handled, there is no function to run so this will
36+ // give a null function exception
37+ (cast return : (Int ) -> Void )(Common .incrementCount ());
38+ }
39+
40+ public static function testFuncReturn () {
41+ Common .count = 0 ;
42+ returnAsFunction ();
43+ if (Common .count == 0 ) {
44+ return Ok ;
45+ }
46+ return Error (" Host method executed after return" );
47+ }
3248}
You can’t perform that action at this time.
0 commit comments