Mercurial > vim
comparison src/vim9compile.c @ 21345:5dd4cbc1e9e6 v8.2.1223
patch 8.2.1223: Vim9: invalid type error for function default value
Commit: https://github.com/vim/vim/commit/e30f64b4b551bb00318dc09c2f13ecd3d711119a
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 15 19:48:20 2020 +0200
patch 8.2.1223: Vim9: invalid type error for function default value
Problem: Vim9: invalid type error for function default value.
Solution: Use right argument index. (closes https://github.com/vim/vim/issues/6458)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 15 Jul 2020 20:00:04 +0200 |
parents | af3663df42bf |
children | fb8c8fcb7b60 |
comparison
equal
deleted
inserted
replaced
21344:f70c4c3c13ce | 21345:5dd4cbc1e9e6 |
---|---|
6863 // Otherwise check that the default value type matches the | 6863 // Otherwise check that the default value type matches the |
6864 // specified type. | 6864 // specified type. |
6865 val_type = ((type_T **)stack->ga_data)[stack->ga_len - 1]; | 6865 val_type = ((type_T **)stack->ga_data)[stack->ga_len - 1]; |
6866 if (ufunc->uf_arg_types[arg_idx] == &t_unknown) | 6866 if (ufunc->uf_arg_types[arg_idx] == &t_unknown) |
6867 ufunc->uf_arg_types[arg_idx] = val_type; | 6867 ufunc->uf_arg_types[arg_idx] = val_type; |
6868 else if (check_type(ufunc->uf_arg_types[i], val_type, FALSE) | 6868 else if (check_type(ufunc->uf_arg_types[arg_idx], val_type, FALSE) |
6869 == FAIL) | 6869 == FAIL) |
6870 { | 6870 { |
6871 arg_type_mismatch(ufunc->uf_arg_types[arg_idx], val_type, | 6871 arg_type_mismatch(ufunc->uf_arg_types[arg_idx], val_type, |
6872 arg_idx + 1); | 6872 arg_idx + 1); |
6873 goto erret; | 6873 goto erret; |