Patch 8.2.4972
Problem:    Vim9: compilation fails when using dict member when skipping.
Solution:   Do not generate ISN_USEDICT when skipping. (closes #10433)
Files:      src/vim9expr.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.4971/src/vim9expr.c      2022-05-13 16:23:33.793284093 +0100
--- src/vim9expr.c      2022-05-17 15:02:14.538628062 +0100
***************
*** 2102,2108 ****
  
      // Turn "dict.Func" into a partial for "Func" bound to "dict".
      // This needs to be done at runtime to be able to check the type.
!     if (keeping_dict && generate_instr(cctx, ISN_USEDICT) == NULL)
        return FAIL;
  
      return OK;
--- 2102,2109 ----
  
      // Turn "dict.Func" into a partial for "Func" bound to "dict".
      // This needs to be done at runtime to be able to check the type.
!     if (keeping_dict && cctx->ctx_skip != SKIP_YES
!                                 && generate_instr(cctx, ISN_USEDICT) == NULL)
        return FAIL;
  
      return OK;
*** ../vim-8.2.4971/src/testdir/test_vim9_expr.vim      2022-05-17 
13:14:19.800706270 +0100
--- src/testdir/test_vim9_expr.vim      2022-05-17 15:00:54.946638840 +0100
***************
*** 452,457 ****
--- 452,463 ----
        g:vals = []
        assert_equal(false, g:Record(1) && g:Record(true) && g:Record(0))
        assert_equal([1, true, 0], g:vals)
+ 
+       var failed = false
+       if false && g:a == g:b.c
+         failed = true
+       endif
+       assert_false(failed)
    END
    v9.CheckDefAndScriptSuccess(lines)
  enddef
*** ../vim-8.2.4971/src/version.c       2022-05-17 13:14:19.800706270 +0100
--- src/version.c       2022-05-17 14:59:05.646637042 +0100
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4972,
  /**/

-- 
Your fault: core dumped

 /// 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/20220517140516.20B771C08A6%40moolenaar.net.

Raspunde prin e-mail lui