Mercurial > vim
comparison src/eval.c @ 8601:46306a98407c v7.4.1590
commit https://github.com/vim/vim/commit/3f242a844e83a5a04943869f6e3bcbf8650dc465
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 18 19:39:25 2016 +0100
patch 7.4.1590
Problem: Warning for shadowed variable. (Christian Brabandt)
Solution: Move the variable into a local block.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 18 Mar 2016 19:45:04 +0100 |
parents | ddb04cbe1e0c |
children | 99aed8c33bbf |
comparison
equal
deleted
inserted
replaced
8600:5ebc0b775fb7 | 8601:46306a98407c |
---|---|
21658 int ret = OK; | 21658 int ret = OK; |
21659 dict_T *selfdict = NULL; | 21659 dict_T *selfdict = NULL; |
21660 char_u *s; | 21660 char_u *s; |
21661 int len; | 21661 int len; |
21662 typval_T functv; | 21662 typval_T functv; |
21663 partial_T *pt = NULL; | |
21664 | 21663 |
21665 while (ret == OK | 21664 while (ret == OK |
21666 && (**arg == '[' | 21665 && (**arg == '[' |
21667 || (**arg == '.' && rettv->v_type == VAR_DICT) | 21666 || (**arg == '.' && rettv->v_type == VAR_DICT) |
21668 || (**arg == '(' && (!evaluate || rettv->v_type == VAR_FUNC | 21667 || (**arg == '(' && (!evaluate || rettv->v_type == VAR_FUNC |
21669 || rettv->v_type == VAR_PARTIAL))) | 21668 || rettv->v_type == VAR_PARTIAL))) |
21670 && !vim_iswhite(*(*arg - 1))) | 21669 && !vim_iswhite(*(*arg - 1))) |
21671 { | 21670 { |
21672 if (**arg == '(') | 21671 if (**arg == '(') |
21673 { | 21672 { |
21673 partial_T *pt = NULL; | |
21674 | |
21674 /* need to copy the funcref so that we can clear rettv */ | 21675 /* need to copy the funcref so that we can clear rettv */ |
21675 if (evaluate) | 21676 if (evaluate) |
21676 { | 21677 { |
21677 functv = *rettv; | 21678 functv = *rettv; |
21678 rettv->v_type = VAR_UNKNOWN; | 21679 rettv->v_type = VAR_UNKNOWN; |