diff src/testdir/test_vim9_cmd.vim @ 21212:874a28fac941 v8.2.1157

patch 8.2.1157: Vim9: dict.name is not recognized as an expression Commit: https://github.com/vim/vim/commit/0a47e0970a0e5d99aa7089169e0bcca0401decce Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 8 18:30:06 2020 +0200 patch 8.2.1157: Vim9: dict.name is not recognized as an expression Problem: Vim9: dict.name is not recognized as an expression. Solution: Recognize ".name". (closes https://github.com/vim/vim/issues/6418)
author Bram Moolenaar <Bram@vim.org>
date Wed, 08 Jul 2020 18:45:07 +0200
parents f45ce1ce284c
children 4be91a7eafb2
line wrap: on
line diff
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -208,6 +208,23 @@ def Test_method_call_linebreak()
   CheckScriptSuccess(lines)
 enddef
 
+def Test_dict_member()
+   let test: dict<list<number>> = {'data': [3, 1, 2]}
+   test.data->sort()
+   assert_equal(#{data: [1, 2, 3]}, test)
+   test.data
+      ->reverse()
+   assert_equal(#{data: [3, 2, 1]}, test)
+
+  let lines =<< trim END
+      vim9script
+      let test: dict<list<number>> = {'data': [3, 1, 2]}
+      test.data->sort()
+      assert_equal(#{data: [1, 2, 3]}, test)
+  END
+  CheckScriptSuccess(lines)
+enddef
+
 def Test_bar_after_command()
   def RedrawAndEcho()
     let x = 'did redraw'