patch 9.0.2184: Vim9: inconsistent :type/:class messages
Problem: Vim9: inconsistent :type/:class messages
Solution: Update the Messages (Ernie Rael)
closes: #13706
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim
index f904696..aef09c5 100644
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -3090,18 +3090,18 @@
assert_fails('l = N', 'E1012: Type mismatch; expected list<number> but got number')
assert_fails('b = N', 'E1012: Type mismatch; expected blob but got number')
assert_fails('Fn = N', 'E1012: Type mismatch; expected func(...): unknown but got number')
- assert_fails('A = N', 'E1012: Type mismatch; expected class<A> but got number')
+ assert_fails('A = N', 'E1405: Class "A" cannot be used as a value')
assert_fails('o = N', 'E1012: Type mismatch; expected object<A> but got number')
- assert_fails('T = N', 'E1395: Type alias "T" cannot be modified')
+ assert_fails('T = N', 'E1403: Type alias "T" cannot be used as a value')
# Use a compound operator with different LHS types
assert_fails('d += N', 'E734: Wrong variable type for +=')
assert_fails('l += N', 'E734: Wrong variable type for +=')
assert_fails('b += N', 'E734: Wrong variable type for +=')
assert_fails('Fn += N', 'E734: Wrong variable type for +=')
- assert_fails('A += N', 'E734: Wrong variable type for +=')
+ assert_fails('A += N', 'E1405: Class "A" cannot be used as a value')
assert_fails('o += N', 'E734: Wrong variable type for +=')
- assert_fails('T += N', 'E1395: Type alias "T" cannot be modified')
+ assert_fails('T += N', 'E1403: Type alias "T" cannot be used as a value')
# Assign to a number variable
assert_fails('N = d', 'E1012: Type mismatch; expected number but got dict<number>')
@@ -3144,9 +3144,9 @@
assert_fails('l ..= S', 'E734: Wrong variable type for .=')
assert_fails('b ..= S', 'E734: Wrong variable type for .=')
assert_fails('Fn ..= S', 'E734: Wrong variable type for .=')
- assert_fails('A ..= S', 'E734: Wrong variable type for .=')
+ assert_fails('A ..= S', 'E1405: Class "A" cannot be used as a value')
assert_fails('o ..= S', 'E734: Wrong variable type for .=')
- assert_fails('T ..= S', 'E1395: Type alias "T" cannot be modified')
+ assert_fails('T ..= S', 'E1403: Type alias "T" cannot be used as a value')
END
v9.CheckSourceSuccess(lines)