diff src/testdir/test_vim9_disassemble.vim @ 21717:ef3b31d510d2 v8.2.1408

patch 8.2.1408: Vim9: type casting not supported Commit: https://github.com/vim/vim/commit/64d662d5fc2ff8af4dbf399ff02aa9d711cc9312 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 9 19:02:50 2020 +0200 patch 8.2.1408: Vim9: type casting not supported Problem: Vim9: type casting not supported. Solution: Introduce type casting.
author Bram Moolenaar <Bram@vim.org>
date Sun, 09 Aug 2020 19:15:03 +0200
parents 1c4d4aa22b37
children 3b312e56e2b8
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim
+++ b/src/testdir/test_vim9_disassemble.vim
@@ -817,6 +817,24 @@ enddef
 
 let g:number = 42
 
+def TypeCast()
+  let l: list<number> = [23, <number>g:number]
+enddef
+
+def Test_disassemble_typecast()
+  let instr = execute('disassemble TypeCast')
+  assert_match('TypeCast.*' ..
+        'let l: list<number> = \[23, <number>g:number\].*' ..
+        '\d PUSHNR 23\_s*' ..
+        '\d LOADG g:number\_s*' ..
+        '\d CHECKTYPE number stack\[-1\]\_s*' ..
+        '\d NEWLIST size 2\_s*' ..
+        '\d STORE $0\_s*' ..
+        '\d PUSHNR 0\_s*' ..
+        '\d RETURN\_s*',
+        instr)
+enddef
+
 def Computing()
   let nr = 3
   let nrres = nr + 7