MainCatch.hx 302 B

123456789101112131415161718192021
  1. class MainCatch {
  2. public static function main():Void {
  3. test();
  4. }
  5. static function test() {
  6. function log() {
  7. log();
  8. //prevent tail recursion elimination
  9. return 0;
  10. }
  11. try {
  12. log();
  13. } catch(s:String) {
  14. if(s != 'Stack overflow') {
  15. Sys.exit(1);
  16. }
  17. }
  18. return macro {};
  19. }
  20. }