Patch 8.2.0806
Problem:    using "func!" after vim9script gives confusing error.
Solution:   Give E477. (closes #6107)
Files:      src/vim9script.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.0805/src/vim9script.c    2020-05-15 18:17:24.590759529 +0200
--- src/vim9script.c    2020-05-21 21:46:00.957620751 +0200
***************
*** 84,89 ****
--- 84,95 ----
        {
            int             lnum_start = SOURCING_LNUM - 1;
  
+           if (*p == '!')
+           {
+               emsg(_(e_nobang));
+               break;
+           }
+ 
            // Handle :function and :def by calling def_function().
            // It will read upto the matching :endded or :endfunction.
            eap->cmdidx = *line == 'f' ? CMD_function : CMD_def;
*** ../vim-8.2.0805/src/testdir/test_vim9_script.vim    2020-05-18 
14:20:33.915289768 +0200
--- src/testdir/test_vim9_script.vim    2020-05-21 21:49:21.572957619 +0200
***************
*** 136,142 ****
    let dict2: dict<number> = #{one: 1, two: 2}
    let dict3: dict<string> = #{key: 'value'}
    let dict4: dict<any> = #{one: 1, two: '2'}
!   let dict5: dict<blob> = #{one: 0z01, tw: 0z02}
  
    call CheckDefExecFailure(['let dd = {}', 'dd[""] = 6'], 'E713:')
  
--- 136,142 ----
    let dict2: dict<number> = #{one: 1, two: 2}
    let dict3: dict<string> = #{key: 'value'}
    let dict4: dict<any> = #{one: 1, two: '2'}
!   let dict5: dict<blob> = #{one: 0z01, two: 0z02}
  
    call CheckDefExecFailure(['let dd = {}', 'dd[""] = 6'], 'E713:')
  
***************
*** 1721,1726 ****
--- 1721,1731 ----
        'dsearch /pat/#comment',
        'bwipe!',
        ], 'E488:')
+ 
+   CheckScriptFailure([
+       'vim9script',
+       'func! SomeFunc()',
+       ], 'E477:')
  enddef
  
  def Test_finish()
*** ../vim-8.2.0805/src/version.c       2020-05-21 20:38:28.039879979 +0200
--- src/version.c       2020-05-21 21:47:46.261272610 +0200
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     806,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
151. You find yourself engaged to someone you've never actually met,
     except through e-mail.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202005211951.04LJpWUh020103%40masaka.moolenaar.net.

Raspunde prin e-mail lui