Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 26506:4a1d2abc2016 v8.2.3783
patch 8.2.3783: confusing error for using a variable as a function
Commit: https://github.com/vim/vim/commit/2ef9156b4284e4a52613c36e3d4667245273a28d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 11 16:14:07 2021 +0000
patch 8.2.3783: confusing error for using a variable as a function
Problem: Confusing error for using a variable as a function.
Solution: If a function is not found but there is a variable, give a more
useful error. (issue #9310)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 11 Dec 2021 17:15:03 +0100 |
parents | 7821550ba3a8 |
children | dff04b7fa6b2 |
comparison
equal
deleted
inserted
replaced
26505:6db198ec38ac | 26506:4a1d2abc2016 |
---|---|
1920 undo | 1920 undo |
1921 END | 1921 END |
1922 CheckDefAndScriptFailure(lines, 'E1207:', 2) | 1922 CheckDefAndScriptFailure(lines, 'E1207:', 2) |
1923 enddef | 1923 enddef |
1924 | 1924 |
1925 def Test_vim9script_call_wrong_type() | |
1926 var lines =<< trim END | |
1927 vim9script | |
1928 var Time = 'localtime' | |
1929 Time() | |
1930 END | |
1931 CheckScriptFailure(lines, 'E1085:') | |
1932 enddef | |
1933 | |
1925 def s:RetSome(): string | 1934 def s:RetSome(): string |
1926 return 'some' | 1935 return 'some' |
1927 enddef | 1936 enddef |
1928 | 1937 |
1929 " Not exported function that is referenced needs to be accessed by the | 1938 " Not exported function that is referenced needs to be accessed by the |