forked from aniani/vim
patch 8.2.2131: Vim9: crash when lambda uses same var as assignment
Problem: Vim9: crash when lambda uses same var as assignment.
Solution: Do not let lookup_local change lv_from_outer, make a copy.
(closes #7461)
This commit is contained in:
@@ -481,6 +481,12 @@ def Test_call_lambda_args()
|
||||
CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected number but got string')
|
||||
enddef
|
||||
|
||||
def Test_lambda_uses_assigned_var()
|
||||
CheckDefSuccess([
|
||||
'var x: any = "aaa"'
|
||||
'x = filter(["bbb"], {_, v -> v =~ x})'])
|
||||
enddef
|
||||
|
||||
" Default arg and varargs
|
||||
def MyDefVarargs(one: string, two = 'foo', ...rest: list<string>): string
|
||||
var res = one .. ',' .. two
|
||||
|
||||
Reference in New Issue
Block a user