vim
vim copied to clipboard
`typealias` usage errors need better error messages
Steps to reproduce
These indicated error messages give incomplete or inaccurate error messages.
vim9script
type T = list<string>
def F()
abs(T)
enddef
F()
Outputs the error
E1407: Cannot use a Typealias as a variable or value
And
vim9script
class C
endclass
type T = C
def F()
abs(T)
enddef
F()
outputs the error
E1405: Class "C" cannot be used as a value
Expected behaviour
The name of the :type
should be in the message.
See check_type_is_value()
in vim9type.c
. There some discussion of what a fix would look like at https://github.com/vim/vim/pull/13688#discussion_r1428316748
Version of Vim
9.0.2167 with #13688
Environment
ubuntu
Logs and stack traces
No response
May be related to #13433