diff --git a/src/std/cast.c b/src/std/cast.c index 211d0626a..614f4f6fd 100644 --- a/src/std/cast.c +++ b/src/std/cast.c @@ -213,9 +213,12 @@ HL_PRIM void *hl_dyn_castp( void *data, hl_type *t, hl_type *to ) { case TK2(HFUN,HDYN): case TK2(HNULL,HDYN): case TK2(HARRAY,HDYN): - case TK2(HABSTRACT,HABSTRACT): // 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);