patch 8.2.3997: Vim9: not enough testing for extend() and map()

Problem:    Vim9: not enough testing for extend() and map().
Solution:   Add more test cases.  Fix uncovered problems.  Remove unused type
            fields.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index a243e64..cccf02c 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2279,14 +2279,12 @@
 		// ":const var": lock the value, but not referenced variables
 		generate_LOCKCONST(cctx);
 
-	    if (is_decl
-		    && (lhs.lhs_type->tt_type == VAR_DICT
+	    if ((lhs.lhs_type->tt_type == VAR_DICT
 					  || lhs.lhs_type->tt_type == VAR_LIST)
 		    && lhs.lhs_type->tt_member != NULL
 		    && lhs.lhs_type->tt_member != &t_unknown)
 		// Set the type in the list or dict, so that it can be checked,
-		// also in legacy script.  Not for "list<any> = val", then the
-		// type of "val" is used.
+		// also in legacy script.
 		generate_SETTYPE(cctx, lhs.lhs_type);
 
 	    if (!skip_store && generate_store_lhs(cctx, &lhs,