summaryrefslogtreecommitdiffstats
path: root/src/userfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index ce144a3978..9a307966b7 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -570,10 +570,16 @@ parse_argument_types(
fp->uf_arg_types[i] = type;
if (i < fp->uf_args.ga_len
&& (type->tt_type == VAR_FUNC
- || type->tt_type == VAR_PARTIAL)
- && var_wrong_func_name(
- ((char_u **)fp->uf_args.ga_data)[i], TRUE))
- return FAIL;
+ || type->tt_type == VAR_PARTIAL))
+ {
+ char_u *name = ((char_u **)fp->uf_args.ga_data)[i];
+ if (obj_members != NULL && *name == '_')
+ // protected object method
+ name++;
+
+ if (var_wrong_func_name(name, TRUE))
+ return FAIL;
+ }
}
}
}