diff src/vim9type.c @ 22492:0e03ef68e738 v8.2.1794

patch 8.2.1794: no falsy Coalescing operator Commit: https://github.com/vim/vim/commit/92f26c256e06277ff2ec4ce7adea1eb58c85abe0 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 3 20:17:30 2020 +0200 patch 8.2.1794: no falsy Coalescing operator Problem: No falsy Coalescing operator. Solution: Add the "??" operator. Fix mistake with function argument count.
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Oct 2020 20:30:04 +0200
parents 6a9e5c087c86
children 4c21f7f6f9e3
line wrap: on
line diff
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -924,6 +924,10 @@ common_type(type_T *type1, type_T *type2
 	    }
 	    else
 		*dest = alloc_func_type(common, -1, type_gap);
+	    // Use the minimum of min_argcount.
+	    (*dest)->tt_min_argcount =
+			type1->tt_min_argcount < type2->tt_min_argcount
+			     ? type1->tt_min_argcount : type2->tt_min_argcount;
 	    return;
 	}
     }