Sunday, March 12, 2023

[vim9script] Default value for object argument?

How do you define a default value for a function argument whose type is
a class? I have tried this:

vim9script

class X
endclass

def F(x: X = null_object)
enddef

F()

But this results in:

E1013: Argument 1: type mismatch, expected object<X> but got object<Unknown>

Maybe this is not supported yet?

Thanks,
Life.



--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/tukcuc%24j79%242%40ciao.gmane.io.

No comments:

Post a Comment