[vim/vim] Vim9script variable duplication check is too strict. (Issue #20240)

5 views
Skip to first unread message

BenYip

unread,
May 18, 2026, 5:47:30 AM (20 hours ago) May 18
to vim/vim, Subscribed
bennyyip created an issue (vim/vim#20240)

Steps to reproduce

  1. save this script to a file
vim9script

class Foo
  var bar: number
  var _bar: number
endclass
  1. :soure %

error:

line    5:
E1369: Duplicate variable: _bar

Expected behaviour

_bar and bar is not duplicate.

Version of Vim

9.2.0498

Environment

doesn't matter

Logs and stack traces


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20240@github.com>

h_east

unread,
May 18, 2026, 12:13:25 PM (13 hours ago) May 18
to vim/vim, Subscribed
h-east left a comment (vim/vim#20240)

It might not be immediately obvious, but there is an explanation in the help files.

:h E1369

							*E1355* *E1369*
(snip...)
It is not possible to use a public and protected member variable with the same name.

For protected member variable, See :h protected-variable.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

BenYip

unread,
May 18, 2026, 10:19:50 PM (3 hours ago) May 18
to vim/vim, Subscribed
bennyyip left a comment (vim/vim#20240)

Thanks. I don't know there is protected member.
I think the error message can be improved, like "E1369: Duplicate protected and public member: _bar and bar".


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Reply all
Reply to author
Forward
0 new messages