diff src/list.c @ 21833:e3f9528bddda v8.2.1466

patch 8.2.1466: Vim9: cannot index or slice a variable with type "any" Commit: https://github.com/vim/vim/commit/cc673e746ab98566556ff964d7a76f2fb46d7f84 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 16 17:33:35 2020 +0200 patch 8.2.1466: Vim9: cannot index or slice a variable with type "any" Problem: Vim9: cannot index or slice a variable with type "any". Solution: Add runtime index and slice.
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Aug 2020 17:45:22 +0200
parents d8422de73113
children a211bca98bc3
line wrap: on
line diff
--- a/src/list.c
+++ b/src/list.c
@@ -914,7 +914,7 @@ list_slice_or_index(
 		semsg(_(e_listidx), n1);
 	    return FAIL;
 	}
-	n1 = len;
+	n1 = n1 < 0 ? 0 : len;
     }
     if (range)
     {