summaryrefslogtreecommitdiffstats
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-05 17:08:17 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-05 17:08:17 +0200
commit5deeb3f1f9db4eabd36e99cbf857fe376eb37e10 (patch)
tree929f788bcba4325b1bd8141182e433c47d53666f /src/structs.h
parentd7ffc0ba8ccb039dd19b255368302d9bfe0e010b (diff)
patch 8.2.0512: Vim9: no optional arguments in func typev8.2.0512
Problem: Vim9: no optional arguments in func type. Solution: Check for question mark after type. Find function reference without function().
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/structs.h b/src/structs.h
index efc74da175..4a5128171b 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1341,10 +1341,11 @@ typedef enum
typedef struct type_S type_T;
struct type_S {
vartype_T tt_type;
- short tt_argcount; // for func, partial, -1 for unknown
- short tt_flags; // TTFLAG_ values
+ char tt_argcount; // for func, -1 for unknown
+ char tt_min_argcount; // number of non-optional arguments
+ char tt_flags; // TTFLAG_ values
type_T *tt_member; // for list, dict, func return type
- type_T **tt_args; // func arguments, allocated
+ type_T **tt_args; // func argument types, allocated
};
#define TTFLAG_VARARGS 1 // func args ends with "..."
@@ -1520,7 +1521,7 @@ typedef struct
int uf_calls; // nr of active calls
int uf_cleared; // func_clear() was already called
int uf_dfunc_idx; // >= 0 for :def function only
- garray_T uf_args; // arguments
+ garray_T uf_args; // arguments, including optional arguments
garray_T uf_def_args; // default argument expressions
// for :def (for :function uf_ret_type is NULL)
@@ -1531,6 +1532,7 @@ typedef struct
// uf_def_args; length: uf_def_args.ga_len + 1
char_u *uf_va_name; // name from "...name" or NULL
type_T *uf_va_type; // type from "...name: type" or NULL
+ type_T *uf_func_type; // type of the function, &t_func_any if unknown
garray_T uf_lines; // function lines
# ifdef FEAT_PROFILE