diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index c6a6829fd..e77c1f7e6 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -2417,6 +2417,11 @@ def Test_expr7_option() &grepprg = test_null_string() assert_equal('', &grepprg) set grepprg& + + # check matching type + var bval: bool = &tgc + var nval: number = &ts + var sval: string = &path enddef def Test_expr7_environment() diff --git a/src/version.c b/src/version.c index a1b32e853..b016c289e 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2261, /**/ 2260, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index b483a6094..d44fe487c 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -3172,8 +3172,9 @@ compile_get_option(char_u **arg, cctx_T *cctx) if (ret == OK) { // include the '&' in the name, eval_option() expects it. - char_u *name = vim_strnsave(start, *arg - start); - type_T *type = rettv.v_type == VAR_NUMBER ? &t_number : &t_string; + char_u *name = vim_strnsave(start, *arg - start); + type_T *type = rettv.v_type == VAR_BOOL ? &t_bool + : rettv.v_type == VAR_NUMBER ? &t_number : &t_string; ret = generate_LOAD(cctx, ISN_LOADOPT, 0, name, type); vim_free(name);