Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 23640:8dcb2255ff9a v8.2.2362
patch 8.2.2362: Vim9: check of builtin function argument type is incomplete
Commit: https://github.com/vim/vim/commit/351ead09dd365ebdee2bfa27ab22542d4920c779
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 16 16:07:01 2021 +0100
patch 8.2.2362: Vim9: check of builtin function argument type is incomplete
Problem: Vim9: check of builtin function argument type is incomplete.
Solution: Use need_type() instead of check_arg_type().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 16 Jan 2021 16:15:04 +0100 |
parents | 1816ea68c022 |
children | 5d77a7587927 |
comparison
equal
deleted
inserted
replaced
23639:a93ecfa78aef | 23640:8dcb2255ff9a |
---|---|
239 CheckDefFailure(['extend([1, 2], [3], "x")'], 'E1013: Argument 3: type mismatch, expected number but got string') | 239 CheckDefFailure(['extend([1, 2], [3], "x")'], 'E1013: Argument 3: type mismatch, expected number but got string') |
240 | 240 |
241 CheckDefFailure(['extend({a: 1}, 42)'], 'E1013: Argument 2: type mismatch, expected dict<number> but got number') | 241 CheckDefFailure(['extend({a: 1}, 42)'], 'E1013: Argument 2: type mismatch, expected dict<number> but got number') |
242 CheckDefFailure(['extend({a: 1}, {b: "x"})'], 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string>') | 242 CheckDefFailure(['extend({a: 1}, {b: "x"})'], 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string>') |
243 CheckDefFailure(['extend({a: 1}, {b: 2}, 1)'], 'E1013: Argument 3: type mismatch, expected string but got number') | 243 CheckDefFailure(['extend({a: 1}, {b: 2}, 1)'], 'E1013: Argument 3: type mismatch, expected string but got number') |
244 | |
245 CheckDefFailure(['extend([1], ["b"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') | |
246 CheckDefExecFailure(['extend([1], ["b", 1])'], 'E1012: Type mismatch; expected list<number> but got list<any>') | |
244 enddef | 247 enddef |
245 | 248 |
246 def Test_extendnew() | 249 def Test_extendnew() |
247 assert_equal([1, 2, 'a'], extendnew([1, 2], ['a'])) | 250 assert_equal([1, 2, 'a'], extendnew([1, 2], ['a'])) |
248 assert_equal({one: 1, two: 'a'}, extendnew({one: 1}, {two: 'a'})) | 251 assert_equal({one: 1, two: 'a'}, extendnew({one: 1}, {two: 'a'})) |