Skip to content

Commit

Permalink
allow casting between hl.Abstracts
Browse files Browse the repository at this point in the history
  • Loading branch information
fourst4r committed Apr 24, 2024
1 parent e65f116 commit cc7f084
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/std/cast.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ HL_PRIM void *hl_dyn_castp( void *data, hl_type *t, hl_type *to ) {
case TK2(HARRAY,HDYN):
// NO(HSTRUCT,HDYN)
return *(void**)data;
case TK2(HABSTRACT,HABSTRACT):
if ( ucmp(t->abs_name, to->abs_name) != 0 )
break;
return *(void**)data;
}
if( to->kind == HDYN )
return hl_make_dyn(data,t);
Expand Down

0 comments on commit cc7f084

Please sign in to comment.