]> granicus.if.org Git - vim/commitdiff
patch 8.2.1284: Vim9: skipping over type includes following white space v8.2.1284
authorBram Moolenaar <Bram@vim.org>
Thu, 23 Jul 2020 18:09:10 +0000 (20:09 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 23 Jul 2020 18:09:10 +0000 (20:09 +0200)
Problem:    Vim9: skipping over type includes following white space, leading
            to an error for missing white space.
Solution:   Do not skip over white space after the type.

src/testdir/test_vim9_func.vim
src/version.c
src/vim9compile.c

index 25c40c8b98b22925f05d4f941fc1717cd1279474..c8c6afee09df2e1a083af3dea9b55a3054cf04ef 100644 (file)
@@ -283,6 +283,16 @@ def Test_call_funcref()
     assert_equal(123, Bar(Funcref))
   END
   CheckScriptSuccess(lines)
+
+  lines =<< trim END
+    vim9script
+    def UseNumber(nr: number)
+      echo nr
+    enddef
+    let Funcref: func(number) = function('UseNumber')
+    Funcref(123)
+  END
+  CheckScriptSuccess(lines)
 enddef
 
 let SomeFunc = function('len')
index ab410712a53518158537bcaae31ab758b39028a8..91edd4ad85f219080b8c9f576fdf8b88de2c4f55 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1284,
 /**/
     1283,
 /**/
index 3be8733eafa14db6f4c42b7bdd9db51c54c0366c..e032e23a92e0cdb1e63b624ce7981e3195fbf28a 100644 (file)
@@ -1944,7 +1944,7 @@ skip_type(char_u *start)
                if (p[1] == ':')
                    p = skip_type(skipwhite(p + 2));
                else
-                   p = skipwhite(p + 1);
+                   ++p;
            }
        }
        else