]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.0523: Vim9: cannot downcast an object v9.1.0523
authorLemonBoy <thatlemon@gmail.com>
Thu, 4 Jul 2024 15:03:17 +0000 (17:03 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 4 Jul 2024 15:03:17 +0000 (17:03 +0200)
commit50d485432c61cae4fea776d26bb051c270f79881
tree4072adb68d5d917a12008c48db48dc66e8d5915f
parent05ff4e42fb5aeaf7f7ef7965e44ddfa2d4d2baf3
patch 9.1.0523: Vim9: cannot downcast an object

Problem:  Vim9: cannot downcast an object (Ernie Rael)
Solution: Fix class downcasting issue (LemonBoy).

When casting an object from one class to another the target type may be
a subclass (downcast) or superclass (upcast) of the source one.
Upcasts require a runtime type check to be emitted.

Add a disassembly test.

fixes: #13244
closes: #15079

Signed-off-by: LemonBoy <thatlemon@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/structs.h
src/testdir/test_vim9_class.vim
src/testdir/test_vim9_disassemble.vim
src/version.c
src/vim9compile.c
src/vim9expr.c
src/vim9type.c