Mercurial > vim
diff src/testdir/test_vim9_expr.vim @ 21232:3f14e0d4a4dd v8.2.1167
patch 8.2.1167: Vim9: builtin function method call only supports first arg
Commit: https://github.com/vim/vim/commit/389df259c49d1ca4f7aa129b702f6083985b1e73
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 9 21:20:47 2020 +0200
patch 8.2.1167: Vim9: builtin function method call only supports first arg
Problem: Vim9: builtin function method call only supports first argument.
Solution: Shift arguments when needed. (closes https://github.com/vim/vim/issues/6305, closes https://github.com/vim/vim/issues/6419)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 09 Jul 2020 21:30:03 +0200 |
parents | bcd08812cde3 |
children | 4edc60c9c0aa |
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1411,6 +1411,28 @@ def Test_expr7_subscript_linebreak() one) enddef +def Test_expr7_method_call() + new + setline(1, ['first', 'last']) + eval 'second'->append(1) + assert_equal(['first', 'second', 'last'], getline(1, '$')) + bwipe! + + let bufnr = bufnr() + let loclist = [#{bufnr: bufnr, lnum: 42, col: 17, text: 'wrong'}] + loclist->setloclist(0) + assert_equal([#{bufnr: bufnr, + lnum: 42, + col: 17, + text: 'wrong', + pattern: '', + valid: 1, + vcol: 0, + nr: 0, + type: '', + module: ''} + ], getloclist(0)) +enddef func Test_expr7_trailing_fails() call CheckDefFailure(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107')