Mercurial > vim
comparison src/testdir/test_vim9_typealias.vim @ 33913:a259471e74fe v9.0.2156
patch 9.0.2156: Vim9: can use typealias in assignment
Commit: https://github.com/vim/vim/commit/9ed53752df1020a6881ac68d1bde2852c9a680aa
Author: Ernie Rael <errael@raelity.com>
Date: Mon Dec 11 17:40:46 2023 +0100
patch 9.0.2156: Vim9: can use typealias in assignment
Problem: Vim9: can use typealias in an assignment
Solution: Generate errors when class/typealias involved in the rhs of an
assignment
closes: #13637
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Generate errors when class/typealias involved in assignment.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 11 Dec 2023 17:45:06 +0100 |
parents | 9a932ba43f6e |
children | ccdb948c7273 |
comparison
equal
deleted
inserted
replaced
33912:bc834a974df8 | 33913:a259471e74fe |
---|---|
210 def Foo() | 210 def Foo() |
211 var x = A | 211 var x = A |
212 enddef | 212 enddef |
213 Foo() | 213 Foo() |
214 END | 214 END |
215 v9.CheckSourceFailure(lines, 'E1403: Type alias "A" cannot be used as a value', 1) | 215 v9.CheckSourceFailure(lines, 'E1406: Cannot use a Typealias as a variable or value', 1) |
216 | 216 |
217 # Using type alias in an expression (script level) | 217 # Using type alias in an expression (script level) |
218 lines =<< trim END | 218 lines =<< trim END |
219 vim9script | 219 vim9script |
220 type MyType = list<number> | 220 type MyType = list<number> |