diff src/vim9compile.c @ 32450:72ffe2b9a4b1 v9.0.1556

patch 9.0.1556: Vim9: error for missing "return" after "throw" Commit: https://github.com/vim/vim/commit/cf2610c82b64b1785af0804916789295cae45e93 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 14 19:59:59 2023 +0100 patch 9.0.1556: Vim9: error for missing "return" after "throw" Problem: Vim9: error for missing "return" after "throw". Solution: Set had_return flag for "throw". (closes https://github.com/vim/vim/issues/12262)
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 May 2023 21:15:03 +0200
parents b8e9ea3c1ed0
children c1f730c2b51e
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3611,6 +3611,7 @@ compile_def_function(
 		    break;
 	    case CMD_throw:
 		    line = compile_throw(p, &cctx);
+		    cctx.ctx_had_return = TRUE;
 		    break;
 
 	    case CMD_eval: