Loading ...
Sorry, an error occurred while loading the content.

[PATCH] duplicated argument in vimscript function causes internal error

Expand Messages
  • tyru
    Hi list. Calling a vimscript function which has duplicated argument causes internal error. ... function! s:foo(a, a) endfunction call s:foo(1, 2) ... $ vim -u
    Message 1 of 2 , Sep 26, 2011
    • 0 Attachment
      Hi list.

      Calling a vimscript function which has duplicated argument causes
      internal error.

      ----- test.vim -----
      function! s:foo(a, a)
      endfunction
      call s:foo(1, 2)
      ----- test.vim end -----

      $ vim -u NONE -i NONE -S test.vim
      will output "E685: Internal error: hash_add()".

      Attached patch fixed it to output general error message to command-line
      like "E853: Duplicated argument variables: {variable name}" ,
      when declaring function. (not when calling function)

      --
      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
    • Bram Moolenaar
      ... Thanks, I ll put it in the todo list. -- How To Keep A Healthy Level Of Insanity: 17. When the money comes out the ATM, scream I won!, I won! 3rd time
      Message 2 of 2 , Sep 26, 2011
      • 0 Attachment
        Tyru wrote:

        > Calling a vimscript function which has duplicated argument causes
        > internal error.
        >
        > ----- test.vim -----
        > function! s:foo(a, a)
        > endfunction
        > call s:foo(1, 2)
        > ----- test.vim end -----
        >
        > $ vim -u NONE -i NONE -S test.vim
        > will output "E685: Internal error: hash_add()".
        >
        > Attached patch fixed it to output general error message to command-line
        > like "E853: Duplicated argument variables: {variable name}" ,
        > when declaring function. (not when calling function)

        Thanks, I'll put it in the todo list.

        --
        How To Keep A Healthy Level Of Insanity:
        17. When the money comes out the ATM, scream "I won!, I won! 3rd
        time this week!!!!!"

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ 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
      Your message has been successfully submitted and would be delivered to recipients shortly.