hashlink icon indicating copy to clipboard operation
hashlink copied to clipboard

allow casting between hl.Abstracts

Open fourst4r opened this issue 1 year ago • 2 comments

Not sure if should check abs_name here or not. I mainly wanted this to be able to do a hl_dyn_call with an abstract as argument.

fourst4r avatar Apr 23 '24 07:04 fourst4r

There should definitely be a check for abs_name before we allow this. Usually the to == from would already handle this

ncannasse avatar Apr 23 '24 10:04 ncannasse

to == form do the job if the type comes from haxe side. When callback using hl_dyn_call, if we pass &hlt_abstract it's not the same type as the haxe side; if we construct an hlt_abstract, the abs_name's char* pointer is not the same as what module.c generate. It's difficult to get hl.Type for hl.Abstract at haxe side either, I tried just cast and I have Error: Extern type not supported : hl.Abstract<hl.Abstract.Const> on compile.

yuxiaomao avatar Apr 24 '24 12:04 yuxiaomao