File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1902,6 +1902,8 @@ def Test_expr7_dict()
19021902 var dictdict: dict <dict<string> > = #{one: #{a: ' text' }, two: #{}}
19031903 dictdict = #{one: #{}, two: #{a: ' text' }}
19041904 dictdict = #{one: #{}, two: #{}}
1905+
1906+ assert_equal ({' ' : 0 }, {matchstr (' string' , ' wont match' ): 0 })
19051907
19061908 CheckDefFailure ([" var x = #{a:8}" ], ' E1069:' , 1 )
19071909 CheckDefFailure ([" var x = #{a : 8}" ], ' E1068:' , 1 )
Original file line number Diff line number Diff line change @@ -750,6 +750,8 @@ static char *(features[]) =
750750
751751static int included_patches [] =
752752{ /* Add new patch number below this line */
753+ /**/
754+ 1952 ,
753755/**/
754756 1951 ,
755757/**/
Original file line number Diff line number Diff line change @@ -1738,6 +1738,7 @@ call_def_function(
17381738 int count = iptr -> isn_arg .number ;
17391739 dict_T * dict = dict_alloc ();
17401740 dictitem_T * item ;
1741+ char_u * key ;
17411742
17421743 if (dict == NULL )
17431744 goto failed ;
@@ -1746,15 +1747,17 @@ call_def_function(
17461747 // have already checked key type is VAR_STRING
17471748 tv = STACK_TV_BOT (2 * (idx - count ));
17481749 // check key is unique
1749- item = dict_find (dict , tv -> vval .v_string , -1 );
1750+ key = tv -> vval .v_string == NULL
1751+ ? (char_u * )"" : tv -> vval .v_string ;
1752+ item = dict_find (dict , key , -1 );
17501753 if (item != NULL )
17511754 {
17521755 SOURCING_LNUM = iptr -> isn_lnum ;
1753- semsg (_ (e_duplicate_key ), tv -> vval . v_string );
1756+ semsg (_ (e_duplicate_key ), key );
17541757 dict_unref (dict );
17551758 goto on_error ;
17561759 }
1757- item = dictitem_alloc (tv -> vval . v_string );
1760+ item = dictitem_alloc (key );
17581761 clear_tv (tv );
17591762 if (item == NULL )
17601763 {
You can’t perform that action at this time.
0 commit comments