Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 24077:5006d95ef82d v8.2.2580
patch 8.2.2580: Vim9: checking vararg type may be wrong
Commit: https://github.com/vim/vim/commit/e3ffcd9902efc756178900d9bd972c74a09c3fcd
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Mar 8 21:47:13 2021 +0100
patch 8.2.2580: Vim9: checking vararg type may be wrong
Problem: Vim9: checking vararg type is wrong when function is auto-loaded.
Solution: Use the member type. (closes https://github.com/vim/vim/issues/7933)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 08 Mar 2021 22:00:03 +0100 |
parents | da8347e453b4 |
children | a9ff8368d35f |
comparison
equal
deleted
inserted
replaced
24076:2828d6cfb0b1 | 24077:5006d95ef82d |
---|---|
3152 vim9script | 3152 vim9script |
3153 def some#gettest(): string | 3153 def some#gettest(): string |
3154 return 'test' | 3154 return 'test' |
3155 enddef | 3155 enddef |
3156 g:some#name = 'name' | 3156 g:some#name = 'name' |
3157 | |
3158 def some#varargs(a1: string, ...l: list<string>): string | |
3159 return a1 .. l[0] .. l[1] | |
3160 enddef | |
3157 END | 3161 END |
3158 | 3162 |
3159 mkdir('Xdir/autoload', 'p') | 3163 mkdir('Xdir/autoload', 'p') |
3160 writefile(lines, 'Xdir/autoload/some.vim') | 3164 writefile(lines, 'Xdir/autoload/some.vim') |
3161 var save_rtp = &rtp | 3165 var save_rtp = &rtp |
3163 | 3167 |
3164 assert_equal('test', g:some#gettest()) | 3168 assert_equal('test', g:some#gettest()) |
3165 assert_equal('name', g:some#name) | 3169 assert_equal('name', g:some#name) |
3166 g:some#other = 'other' | 3170 g:some#other = 'other' |
3167 assert_equal('other', g:some#other) | 3171 assert_equal('other', g:some#other) |
3172 | |
3173 assert_equal('abc', some#varargs('a', 'b', 'c')) | |
3168 | 3174 |
3169 # upper case script name works | 3175 # upper case script name works |
3170 lines =<< trim END | 3176 lines =<< trim END |
3171 vim9script | 3177 vim9script |
3172 def Other#getOther(): string | 3178 def Other#getOther(): string |