vim icon indicating copy to clipboard operation
vim copied to clipboard

Fix class downcasting

Open LemonBoy opened this issue 1 year ago • 4 comments

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.

Fixes #13244

LemonBoy avatar Jun 22 '24 16:06 LemonBoy

Thanks. @yegappan are you fine with this?

chrisbra avatar Jun 23 '24 14:06 chrisbra

Downloaded and played with it. Tried a few things, no problems. Didn't really look at the implementation.

the target type may be a subclass (downcast) or superclass (upcast) of the source one

About nomenclature; there's a typo in the title (I think). Shouldn't the title be about downcasting; casting to a subclass is what failed.

errael avatar Jun 23 '24 18:06 errael

About nomenclature; there's a typo in the title (I think). Shouldn't the title be about downcasting; casting to a subclass is what failed.

Indeed, please remember to fix the typo in the commit message before merging.

LemonBoy avatar Jun 24 '24 09:06 LemonBoy

Thanks. @yegappan are you fine with this?

The change looks good to me. It will be good to add a disassemble test for this.

yegappan avatar Jun 24 '24 14:06 yegappan

thanks!

chrisbra avatar Jul 04 '24 15:07 chrisbra