comparison src/evalvars.c @ 27690:fae9567b8024 v8.2.4371

patch 8.2.4371: Vim9: can create a script variable from a legacy function Commit: https://github.com/vim/vim/commit/75e27d78f5370e7d2e0898326d9b080937e7b090 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 13 13:56:29 2022 +0000 patch 8.2.4371: Vim9: can create a script variable from a legacy function Problem: Vim9: can create a script variable from a legacy function. Solution: Disallow creating a script variable from a function.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Feb 2022 15:00:03 +0100
parents d4921b91542c
children 3813036f19cb
comparison
equal deleted inserted replaced
27689:162c1a47e616 27690:fae9567b8024
3502 goto failed; 3502 goto failed;
3503 } 3503 }
3504 semsg(_(e_cannot_use_str_itself_it_is_imported), name); 3504 semsg(_(e_cannot_use_str_itself_it_is_imported), name);
3505 goto failed; 3505 goto failed;
3506 } 3506 }
3507 if (!in_vim9script())
3508 {
3509 semsg(_(e_cannot_create_vim9_script_variable_in_function_str),
3510 name);
3511 goto failed;
3512 }
3507 } 3513 }
3508 3514
3509 if (dest_tv == NULL) 3515 if (dest_tv == NULL)
3510 { 3516 {
3511 // Search in parent scope which is possible to reference from lambda 3517 // Search in parent scope which is possible to reference from lambda