diff src/vim9instr.c @ 27406:4c1bdee75bed v8.2.4231

patch 8.2.4231: Vim9: map() gives type error when type was not declared Commit: https://github.com/vim/vim/commit/35c807df1f5774f09612d756ddc3cd5c44eacaca Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 27 16:36:29 2022 +0000 patch 8.2.4231: Vim9: map() gives type error when type was not declared Problem: Vim9: map() gives type error when type was not declared. Solution: Only check the type when it was declared, like extend() does. (closes #9635)
author Bram Moolenaar <Bram@vim.org>
date Thu, 27 Jan 2022 17:45:03 +0100
parents 1a6421c5be20
children 4cea92e99a5a
line wrap: on
line diff
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -1331,10 +1331,10 @@ generate_BCALL(cctx_T *cctx, int func_id
     if (push_type_stack(cctx, type) == FAIL)
 	return FAIL;
 
-    if (maptype != NULL && maptype[0].type_curr->tt_member != NULL
-				  && maptype[0].type_curr->tt_member != &t_any)
+    if (maptype != NULL && maptype[0].type_decl->tt_member != NULL
+				  && maptype[0].type_decl->tt_member != &t_any)
 	// Check that map() didn't change the item types.
-	generate_TYPECHECK(cctx, maptype[0].type_curr, -1, 1);
+	generate_TYPECHECK(cctx, maptype[0].type_decl, -1, 1);
 
     return OK;
 }