[vim/vim] Double error messages when using a Dictionary as first argument to append() in legacy Vim script (Issue #11335)

5 views
Skip to first unread message

zeertzjq

unread,
Oct 10, 2022, 10:17:49 AM10/10/22
to vim/vim, Subscribed

Steps to reproduce

  1. Run vim --clean
  2. Run `:call append({}, '')
  3. Double error messages:
E728: Using a Dictionary as a Number
E731: Using a Dictionary as a String

Expected behaviour

Only one error message

Version of Vim

9.0.354

Environment

Operating system: Arch Linux
Terminal: kitty
Value of $TERM: xterm-kitty
Shell: fish

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11335@github.com>

Yegappan Lakshmanan

unread,
Oct 10, 2022, 10:29:54 AM10/10/22
to vim...@googlegroups.com, reply+ACY5DGAOH7GZRYEMR3...@reply.github.com, vim/vim, Subscribed
Hi,

On Mon, Oct 10, 2022 at 7:17 AM zeertzjq <vim-dev...@256bit.org> wrote:

Steps to reproduce

  1. Run vim --clean
  2. Run `:call append({}, '')
  3. Double error messages:
E728: Using a Dictionary as a Number
E731: Using a Dictionary as a String

To address this, in the f_append() function, the check for in_vim9script() should be removed.
This will display a different error message. So the tests need to be changed.

- Yegappan

vim-dev ML

unread,
Oct 10, 2022, 10:30:14 AM10/10/22
to vim/vim, vim-dev ML, Your activity

Hi,

On Mon, Oct 10, 2022 at 7:17 AM zeertzjq ***@***.***> wrote:

> Steps to reproduce
>
> 1. Run vim --clean
> 2. Run `:call append({}, '')
> 3. Double error messages:

>
> E728: Using a Dictionary as a Number
> E731: Using a Dictionary as a String
>
>
To address this, in the f_append() function, the check for in_vim9script()
should be removed.
This will display a different error message. So the tests need to be
changed.

- Yegappan


> Expected behaviour
>
> Only one error message
> Version of Vim
>
> 9.0.354
> Environment
>
> Operating system: Arch Linux
> Terminal: kitty
> Value of $TERM: xterm-kitty
> Shell: fish
> Logs and stack traces
>
> *No response*
>
>
>


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11335/1273405509@github.com>

zeertzjq

unread,
Oct 10, 2022, 10:39:02 AM10/10/22
to vim/vim, vim-dev ML, Comment

It seems that the lnum entry of the dict argument of sign_place() can also have this double error messages problem, and in this case it is not covered by types checks.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/11335/1273418135@github.com>

Bram Moolenaar

unread,
Oct 10, 2022, 11:08:46 AM10/10/22
to vim/vim, vim-dev ML, Comment

Closed #11335 as completed via 801cd35.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issue/11335/issue_event/7554997469@github.com>

Bram Moolenaar

unread,
Oct 10, 2022, 11:12:08 AM10/10/22
to vim...@googlegroups.com, Yegappan Lakshmanan, reply+ACY5DGAOH7GZRYEMR3...@reply.github.com

> On Mon, Oct 10, 2022 at 7:17 AM zeertzjq <vim-dev...@256bit.org> wrote:
>
> > Steps to reproduce
> >
> > 1. Run vim --clean
> > 2. Run `:call append({}, '')
> > 3. Double error messages:
> >
> > E728: Using a Dictionary as a Number
> > E731: Using a Dictionary as a String
> >
> >
> To address this, in the f_append() function, the check for in_vim9script()
> should be removed.

I don't think that works, the problem comes from the argument can be a
number or a string. It tries both, but that shouldn't happen when using
it as a number produced an error.

--
ARTHUR: Well, I AM king...
DENNIS: Oh king, eh, very nice. An' how'd you get that, eh? By exploitin'
the workers -- by 'angin' on to outdated imperialist dogma which
perpetuates the economic an' social differences in our society! If
there's ever going to be any progress--
The Quest for the Holy Grail (Monty Python)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

vim-dev ML

unread,
Oct 10, 2022, 11:12:27 AM10/10/22
to vim/vim, vim-dev ML, Your activity


> On Mon, Oct 10, 2022 at 7:17 AM zeertzjq ***@***.***> wrote:
>
> > Steps to reproduce
> >
> > 1. Run vim --clean
> > 2. Run `:call append({}, '')
> > 3. Double error messages:

> >
> > E728: Using a Dictionary as a Number
> > E731: Using a Dictionary as a String
> >
> >
> To address this, in the f_append() function, the check for in_vim9script()
> should be removed.

I don't think that works, the problem comes from the argument can be a
number or a string. It tries both, but that shouldn't happen when using
it as a number produced an error.

--
ARTHUR: Well, I AM king...
DENNIS: Oh king, eh, very nice. An' how'd you get that, eh? By exploitin'
the workers -- by 'angin' on to outdated imperialist dogma which
perpetuates the economic an' social differences in our society! If
there's ever going to be any progress--
The Quest for the Holy Grail (Monty Python)

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\

/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11335/1273464204@github.com>

Bram Moolenaar

unread,
Oct 10, 2022, 11:16:12 AM10/10/22
to vim/vim, vim-dev ML, Comment


> It seems that the `lnum` entry of the `dict` argument of
> `sign_place()` can also have this double error messages problem, and
> in this case it is not covered by types checks.

Also uses tv_get_lnum() thus fixed as well.

--
Q: Is selling software the same as selling hardware?
A: No, good hardware is sold new, good software has already been used by many.


/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/11335/1273469151@github.com>

Reply all
Reply to author
Forward
0 new messages