view src/typemap @ 33466:3de472480e91 v9.0.1986

patch 9.0.1986: Vim9: accepting type-annotations Commit: https://github.com/vim/vim/commit/b5a0719cb7abf51b0540df527cb9738a3ccf0d37 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Oct 5 20:14:43 2023 +0200 patch 9.0.1986: Vim9: accepting type-annotations Problem: Vim9: accepting type-annotations Solution: Reject type annotations outside of declarations. closes: #13267 closes: #13283 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author Christian Brabandt <cb@256bit.org>
date Thu, 05 Oct 2023 20:30:08 +0200
parents dec4338a7da2
children
line wrap: on
line source

TYPEMAP
VIWIN	T_VIOBJNOMUNGE
VIBUF	T_VIOBJNOMUNGE

INPUT
T_VIOBJNOMUNGE
	if (sv_isa($arg, \"${ntype}\")) {
	    IV tmp = SvIV((SV*)SvRV($arg));
	    $var = INT2PTR($type, tmp);
	    if (!tmp)
		croak(\"$ntype no longer exists\");
	}
	else
	    croak(\"$var is not of type ${ntype}\")