Patch 8.2.3238
Problem:    Vim9: error message does not indicate the location.
Solution:   Add the relevant text. (issue #8634)
Files:      src/errors.h, src/vim9compile.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.3237/src/errors.h        2021-07-27 22:35:38.957378663 +0200
--- src/errors.h        2021-07-28 20:40:06.306784695 +0200
***************
*** 639,641 ****
--- 639,643 ----
        INIT(= N_("E1227: List or Dictionary required for argument %d"));
  EXTERN char e_list_or_dict_or_blob_required_for_argument_nr[]
        INIT(= N_("E1228: List or Dictionary or Blob required for argument 
%d"));
+ EXTERN char e_expected_dictionary_for_using_key_str_but_got_str[]
+       INIT(= N_("E1229: Expected dictionary for using key \"%s\", but got 
%s"));
*** ../vim-8.2.3237/src/vim9compile.c   2021-07-27 22:21:39.827052451 +0200
--- src/vim9compile.c   2021-07-28 20:39:58.954801924 +0200
***************
*** 2177,2183 ****
      type = ((type_T **)stack->ga_data)[stack->ga_len - 1];
      if (type->tt_type != VAR_DICT && type != &t_any)
      {
!       emsg(_(e_dictreq));
        return FAIL;
      }
      // change dict type to dict member type
--- 2177,2187 ----
      type = ((type_T **)stack->ga_data)[stack->ga_len - 1];
      if (type->tt_type != VAR_DICT && type != &t_any)
      {
!       char *tofree;
! 
!       semsg(_(e_expected_dictionary_for_using_key_str_but_got_str),
!                                              name, type_name(type, &tofree));
!       vim_free(tofree);
        return FAIL;
      }
      // change dict type to dict member type
*** ../vim-8.2.3237/src/testdir/test_vim9_expr.vim      2021-07-21 
21:37:24.632071727 +0200
--- src/testdir/test_vim9_expr.vim      2021-07-28 20:47:15.897810233 +0200
***************
*** 3114,3120 ****
    call CheckDefExecAndScriptFailure(["var x = +g:alist"], 'E745:', 1)
    call CheckDefExecAndScriptFailure(["var x = +g:adict"], 'E728:', 1)
  
!   call CheckDefAndScriptFailure2(["var x = ''", "var y = x.memb"], 'E715:', 
'E488:', 2)
  
    call CheckDefAndScriptFailure2(["'yes'->", "Echo()"], 'E488: Trailing 
characters: ->', 'E260: Missing name after ->', 1)
  
--- 3114,3120 ----
    call CheckDefExecAndScriptFailure(["var x = +g:alist"], 'E745:', 1)
    call CheckDefExecAndScriptFailure(["var x = +g:adict"], 'E728:', 1)
  
!   call CheckDefAndScriptFailure2(["var x = ''", "var y = x.memb"], 'E1229: 
Expected dictionary for using key "memb", but got string', 'E488:', 2)
  
    call CheckDefAndScriptFailure2(["'yes'->", "Echo()"], 'E488: Trailing 
characters: ->', 'E260: Missing name after ->', 1)
  
*** ../vim-8.2.3237/src/version.c       2021-07-28 19:34:10.559082899 +0200
--- src/version.c       2021-07-28 20:29:06.228467069 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3238,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
10E. You start counting in hex.

 /// 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/202107281852.16SIqcat1941137%40masaka.moolenaar.net.

Raspunde prin e-mail lui