From: Brendan Hansen Date: Thu, 4 Mar 2021 18:33:31 +0000 (-0600) Subject: small bugfix with '-1' not converting to float X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=11eabb0ed5f62730c134ffd302146c6f42a6772c;p=onyx.git small bugfix with '-1' not converting to float --- diff --git a/bin/onyx b/bin/onyx index b99437ea..aff2fa02 100755 Binary files a/bin/onyx and b/bin/onyx differ diff --git a/docs/bugs b/docs/bugs index a0fa4ac2..18955716 100644 --- a/docs/bugs +++ b/docs/bugs @@ -29,7 +29,7 @@ List of known bugs: } List of things to change: -[ ] Currently, there is no way to use the initialized members of a structure without using a struct literal. +[X] Currently, there is no way to use the initialized members of a structure without using a struct literal. There should be a initialize intrinsic procedure that takes a pointer to anything and initializes it. For example: diff --git a/src/onyxchecker.c b/src/onyxchecker.c index 1f5c7b06..3b3b23c6 100644 --- a/src/onyxchecker.c +++ b/src/onyxchecker.c @@ -991,7 +991,10 @@ CheckStatus check_unaryop(AstUnaryOp** punop) { AstUnaryOp* unaryop = *punop; CHECK(expression, &unaryop->expr); - resolve_expression_type(unaryop->expr); + + if (unaryop->operation != Unary_Op_Negate) { + resolve_expression_type(unaryop->expr); + } if (unaryop->operation == Unary_Op_Cast) { char* err; @@ -999,7 +1002,6 @@ CheckStatus check_unaryop(AstUnaryOp** punop) { onyx_report_error(unaryop->token->pos, "Cast Error: %s", err); return Check_Error; } - } else { unaryop->type = unaryop->expr->type; }