Yegappan wrote:
> > > > > The Vim9 LSP plugin (https://github.com/yegappan/lsp) has the > > > > > following line in the autoload/lsp/lspserver.vim file: > > > > > > > > > > hover: function(Hover, [lspserver]), > > > > > > > > > > If this line is changed to: > > > > > > > > > > hover: function('Hover', [lspserver]), > > > > > > > > > > then Vim crashes with the "E342: Out of memory! (allocating > > > > > 18446744073709551608 bytes)" error. > > > > > > > > > What is the smallest script to reproduce this problem? > > The quoted line is missing context. > > > > I am able to reproduce this crash with the following two minimal scripts. > > ------------------------ x.vim ------------------------------ > vim9script > > import './y.vim' as server > > export def Hover() > enddef > > def AddServer() > var d: dict<any> = server.NewLspServer() > enddef > AddServer() > --------------------------------------------------------------- > > ------------------------ y.vim ------------------------------ > vim9script > > def Hover(d: dict<any>): void > enddef > > export def NewLspServer(): dict<any> > var d: dict<any> = {} > d->extend({hover: function('Hover', [d])}) > return d > enddef > > NewLspServer() > --------------------------------------------------------------- > > With the above two x.vim and y.vim scripts, if you source x.vim, > then Vim crashes. Thanks. It somehow finds the wrong Hover() function, the one that has no arguments while the partial expects at least one argument. It then ends up with a negative argument count. -- hundred-and-one symptoms of being an internet addict: 90. Instead of calling you to dinner, your spouse sends e-mail. /// 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/20220221115111.5C9561C0FE0%40moolenaar.net.
