Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.8k
Add Vim9 generic function support#17313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Another huge feature in the works, thank you. Can there be more than 26 capital letters to draw a type
|
Uh oh!
There was an error while loading.Please reload this page.
I wonder if it would be feasible to implement type inference (maybe later, not necessarily now):
|
ed77edd
tofd5fb23
CompareScriptScorpion commentedMay 20, 2025
is it just new structure of function in vim9script? |
ScriptScorpion commentedMay 20, 2025
WOW no errors |
A generic function allows you to operate on different types of data without losing type checks and https://en.wikipedia.org/wiki/Generic_function |
c7cfaca
to75ea81b
Compare0ff2ce8
todac21eb
Comparedkearns commentedJul 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
vim9scriptdef Foo<T>(a: T)varb: T=aenddefdef Foo outputs
|
Off topic, I didn't know, or had forgotten, that Doesn't seem to be documented. |
41250d4
toec5541c
Compare
Thanks for reporting this issue. This issue should be addressed in the latest updated PR. |
Thanks for creating these example scripts. This exposed some existing memory leaks which were tricky to fix. |
This is supported now in the latest updated PR. |
I'm glad that this is taken care of. Oops, I don't have any |
Thanks for continuously testing and reporting the problems. |
Thanks, so I assume this is ready now? |
@yegappan, I'm sorry about that merge commit, I haven't the faintest idea where that came from. You may want to force push again. I have a 22 year old cat with hyperthyroidism and a love of keyboard dancing as my initial suspect. |
No problem. I did a force push again. |
@chrisbra Yes. This PR is ready. |
@yegappan and@chrisbra, I don't really consider it a blocker but, just in case it's been overlooked, function listing still needs some work. See:#17313 (comment) |
thanks all. Let me merge it and we can do further improvements with a followup PR for the function listing. |
Match Vim9 generic functions, added invim#17313.Signed-off-by: Doug Kearns <dougkearns@gmail.com>
…nctionsMatch Vim9 generic functions, added invim/vim#17313.closes:vim/vim#17722vim/vim@72473ceCo-authored-by: Doug Kearns <dougkearns@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
A generic function definition:
A generic function invocation:
The following are supported:
The following are not yet supported: