Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 30888:54ba95d2d2eb v9.0.0778
patch 9.0.0778: indexing of unknown const type fails during compilation
Commit: https://github.com/vim/vim/commit/4913d420e8e8619cff837372bce87683d6fcaa03
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 17 13:13:32 2022 +0100
patch 9.0.0778: indexing of unknown const type fails during compilation
Problem: Indexing of unknown const type fails during compilation.
Solution: Check for "any" properly. (closes https://github.com/vim/vim/issues/11389)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 17 Oct 2022 14:15:09 +0200 |
parents | b4b51e01dd36 |
children | 4b9b76aac30c |
comparison
equal
deleted
inserted
replaced
30887:cf89c4a14066 | 30888:54ba95d2d2eb |
---|---|
3130 unlet g:teststring | 3130 unlet g:teststring |
3131 unlet g:testblob | 3131 unlet g:testblob |
3132 unlet g:testlist | 3132 unlet g:testlist |
3133 enddef | 3133 enddef |
3134 | 3134 |
3135 def Test_expr9_const_any_index_slice() | |
3136 var lines =<< trim END | |
3137 vim9script | |
3138 | |
3139 export def V(): dict<any> | |
3140 return {a: [1, 43], b: 0} | |
3141 enddef | |
3142 END | |
3143 writefile(lines, 'XexportDict.vim', 'D') | |
3144 | |
3145 lines =<< trim END | |
3146 vim9script | |
3147 | |
3148 import './XexportDict.vim' as x | |
3149 | |
3150 def Test() | |
3151 const v = x.V() | |
3152 assert_equal(43, v.a[1]) | |
3153 enddef | |
3154 Test() | |
3155 END | |
3156 v9.CheckScriptSuccess(lines) | |
3157 enddef | |
3158 | |
3135 def Test_expr_member_vim9script() | 3159 def Test_expr_member_vim9script() |
3136 var lines =<< trim END | 3160 var lines =<< trim END |
3137 var d = {one: | 3161 var d = {one: |
3138 'one', | 3162 'one', |
3139 two: 'two', | 3163 two: 'two', |