Mercurial > vim
comparison src/vim9execute.c @ 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 | d418c82f02a4 |
children | bdd408288d95 |
comparison
equal
deleted
inserted
replaced
33912:bc834a974df8 | 33913:a259471e74fe |
---|---|
3811 | 3811 |
3812 // store local variable | 3812 // store local variable |
3813 case ISN_STORE: | 3813 case ISN_STORE: |
3814 --ectx->ec_stack.ga_len; | 3814 --ectx->ec_stack.ga_len; |
3815 tv = STACK_TV_VAR(iptr->isn_arg.number); | 3815 tv = STACK_TV_VAR(iptr->isn_arg.number); |
3816 if (STACK_TV_BOT(0)->v_type == VAR_TYPEALIAS) | 3816 if (check_typval_is_value(STACK_TV_BOT(0)) == FAIL) |
3817 { | 3817 { |
3818 semsg(_(e_using_typealias_as_value), | |
3819 STACK_TV_BOT(0)->vval.v_typealias->ta_name); | |
3820 clear_tv(STACK_TV_BOT(0)); | 3818 clear_tv(STACK_TV_BOT(0)); |
3821 goto on_error; | 3819 goto on_error; |
3822 } | 3820 } |
3823 clear_tv(tv); | 3821 clear_tv(tv); |
3824 *tv = *STACK_TV_BOT(0); | 3822 *tv = *STACK_TV_BOT(0); |