Yegappan wrote:
> When a function accepts an argument of class type, the argument
> type check is not working properly. Example:
>
> ---------------------------------------------------
> vim9script
>
> class One
> endclass
>
> class Two
> endclass
>
> def Show(a: One)
> echomsg a->string()
> enddef
>
> var b = Two.new()
> Show(b)
> ------------------------------------------------------
>
> In this example, the function Show() accepts an argument of type "One".
> But when the function is called with an argument of type "Two", there is
> no error.
This isn't implemented yet. Currently it only checks that it is a class
type, it should also check that it is the same class. Or, in the case
of an interface, a class that implements the interface. I should get to
this one of the coming days.
--
ARTHUR: Be quiet! I order you to shut up.
OLD WOMAN: Order, eh -- who does he think he is?
ARTHUR: I am your king!
OLD WOMAN: Well, I didn't vote for you.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230107190247.382A11C044B%40moolenaar.net.