From: Brendan Hansen Date: Mon, 14 Dec 2020 20:14:00 +0000 (-0600) Subject: fixed bug with polymorphic functions with 'use' statements X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=55591dbc6cbe7a7f9b488f7a81535d2c9c28d628;p=onyx.git fixed bug with polymorphic functions with 'use' statements --- diff --git a/onyx b/onyx index ae7f54b4..8502fe9b 100755 Binary files a/onyx and b/onyx differ diff --git a/src/onyxclone.c b/src/onyxclone.c index d1b7ffb7..e7ebfe2d 100644 --- a/src/onyxclone.c +++ b/src/onyxclone.c @@ -16,6 +16,7 @@ static inline b32 should_clone(AstNode* node) { case Ast_Kind_Enum_Value: case Ast_Kind_Overloaded_Function: case Ast_Kind_Polymorphic_Proc: + case Ast_Kind_Use_Package: return 0; default: return 1; @@ -83,6 +84,7 @@ static inline i32 ast_kind_to_size(AstNode* node) { case Ast_Kind_For: return sizeof(AstFor); case Ast_Kind_While: return sizeof(AstIfWhile); case Ast_Kind_Jump: return sizeof(AstJump); + case Ast_Kind_Use: return sizeof(AstUse); case Ast_Kind_Defer: return sizeof(AstDefer); case Ast_Kind_Switch: return sizeof(AstSwitch); case Ast_Kind_Switch_Case: return sizeof(AstSwitchCase); @@ -348,6 +350,11 @@ AstNode* ast_clone(bh_allocator a, void* n) { break; } + + case Ast_Kind_Use: { + ((AstUse *) nn)->expr = (AstTyped *) ast_clone(a, ((AstUse *) node)->expr); + break; + } } return nn;