From: Brendan Hansen Date: Sun, 20 Sep 2020 03:06:26 +0000 (-0500) Subject: bugfix with struct literals as struct member default values X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=1a40b2d31b3a5e6526945b012b86c624f7d63779;p=onyx.git bugfix with struct literals as struct member default values --- diff --git a/onyx b/onyx index 06eef3f0..416b2df4 100755 Binary files a/onyx and b/onyx differ diff --git a/src/onyxsymres.c b/src/onyxsymres.c index 573470dd..1077fa2d 100644 --- a/src/onyxsymres.c +++ b/src/onyxsymres.c @@ -262,9 +262,9 @@ static void symres_unaryop(AstUnaryOp** unaryop) { static void symres_struct_literal(AstStructLiteral* sl) { if (sl->stnode != NULL) symres_expression(&sl->stnode); - if (sl->stnode == NULL || sl->stnode->kind == Ast_Kind_Error) return; + if (sl->stnode == NULL || sl->stnode->kind == Ast_Kind_Error || sl->stnode->kind == Ast_Kind_Symbol) return; - sl->type_node = (AstType *) sl->stnode; + sl->type_node = symres_type((AstType *) sl->stnode); sl->type = type_build_from_ast(semstate.allocator, sl->type_node); if (!type_is_structlike_strict(sl->type)) {