Patch 8.2.2774
Problem:    Vim9: cannot import an existing name even when using "as".
Solution:   Do not check for an existing name when using "as". (closes #8113)
Files:      src/vim9script.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.2773/src/vim9script.c    2021-04-13 20:53:09.846201149 +0200
--- src/vim9script.c    2021-04-17 16:37:47.955147433 +0200
***************
*** 600,606 ****
            }
            else
            {
!               if (check_defined(name, len, cctx, FALSE) == FAIL)
                    goto erret;
  
                imported = new_imported(gap != NULL ? gap
--- 600,607 ----
            }
            else
            {
!               if (as_name == NULL
!                             && check_defined(name, len, cctx, FALSE) == FAIL)
                    goto erret;
  
                imported = new_imported(gap != NULL ? gap
*** ../vim-8.2.2773/src/testdir/test_vim9_script.vim    2021-04-15 
21:48:29.023181466 +0200
--- src/testdir/test_vim9_script.vim    2021-04-17 16:37:18.487241543 +0200
***************
*** 1280,1285 ****
--- 1280,1287 ----
  
    var import_lines =<< trim END
      vim9script
+     var one = 'notused'
+     var yes = 777
      import one as thatOne from './XexportAs'
      assert_equal(1, thatOne)
      import yes as yesYes from './XexportAs'
*** ../vim-8.2.2773/src/version.c       2021-04-17 14:06:36.014598855 +0200
--- src/version.c       2021-04-17 16:36:06.139473871 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2774,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
113. You are asked about a bus schedule, you wonder if it is 16 or 32 bits.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202104171439.13HEdPl4067275%40masaka.moolenaar.net.

Raspunde prin e-mail lui