diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-05-09 09:12:31 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-05-09 09:15:02 +0200 |
commit | 1b53172901ebe5be3ddf1baee22d964c8d41e899 (patch) | |
tree | cd90f3a7de35dc976b5870aa24b7cf4f53ddb450 /src/testdir/test_vim9_script.vim | |
parent | d5c8c0920e1eee9ff7a9fa5168d8e85c01670630 (diff) |
patch 9.1.0400: Vim9: confusing error message for unknown typev9.1.0400
Problem: Vim9: confusing error message for unknown type
(Doug Kearns)
Solution: For an unknown type, display only the type name in the error
message (Yegappan Lakshmanan)
fixes: #13153
closes: #14736
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 3ac106eaaf..2c3c47f0a9 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -5002,7 +5002,7 @@ def Test_invalid_type_in_for() enddef defcompile END - v9.CheckSourceFailure(lines, 'E1010: Type not recognized: x in range(10)', 1) + v9.CheckSourceFailure(lines, 'E1010: Type not recognized: x', 1) enddef " Test for using a line break between the variable name and the type in a for @@ -5083,6 +5083,21 @@ def Test_null_values() v9.CheckSourceDefAndScriptSuccess(lines) enddef +" Test for using an unknown type in a typecast +def Test_unknown_type_in_typecast() + var lines =<< trim END + vim9script + var a = <MyType>b + END + v9.CheckSourceFailure(lines, 'E1010: Type not recognized: MyType', 2) + + lines =<< trim END + vim9script + var Fn = <funcx(number, number): number>b + END + v9.CheckSourceFailure(lines, 'E1010: Type not recognized: funcx(number, number): number', 2) +enddef + " Keep this last, it messes up highlighting. def Test_substitute_cmd() new |