Skip to content

Vim9: type variable can have the name of the generic function - #21505

Open
yegappan wants to merge 1 commit into
vim:masterfrom
yegappan:fix-generic-type-var-function-name
Open

yegappan wants to merge 1 commit into
vim:masterfrom
yegappan:fix-generic-type-var-function-name

Conversation

@yegappan

Copy link
Copy Markdown
Member

Problem: Vim9: a type variable of a generic function can have the name of the function itself, e.g. "def Foo()".
Solution: Give an error for a type variable with the name of the function, like for other script items.

AI assistance

  • AI involvement is disclosed in the commit message
  • No AI was used

Checklist

  • The commit message follows the Problem/Solution form above
  • Signed-off-by: trailer is present (git commit -s), recommended but not required

Tests

  • Tests were added
  • Existing tests cover the change
  • The change cannot be tested (explain below)

Documentation

  • Documentation under runtime/doc/ was updated
  • No documentation update is needed

Anything reviewers should know

Found by Claude when assisting in the generic classes and interfaces implementation (#18910).

Problem:  Vim9: a type variable of a generic function can have the name of
          the function itself, e.g. "def Foo<Foo>()".
Solution: Give an error for a type variable with the name of the function,
          like for other script items (Yegappan Lakshmanan).

Assisted-by: Claude
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant