Skip to content

Commit cc7f084

Browse files
committed
allow casting between hl.Abstracts
1 parent e65f116 commit cc7f084

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/std/cast.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ HL_PRIM void *hl_dyn_castp( void *data, hl_type *t, hl_type *to ) {
215215
case TK2(HARRAY,HDYN):
216216
// NO(HSTRUCT,HDYN)
217217
return *(void**)data;
218+
case TK2(HABSTRACT,HABSTRACT):
219+
if ( ucmp(t->abs_name, to->abs_name) != 0 )
220+
break;
221+
return *(void**)data;
218222
}
219223
if( to->kind == HDYN )
220224
return hl_make_dyn(data,t);

0 commit comments

Comments
 (0)