small bugfix with '-1' not converting to float
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 4 Mar 2021 18:33:31 +0000 (12:33 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 4 Mar 2021 18:33:31 +0000 (12:33 -0600)
bin/onyx
docs/bugs
src/onyxchecker.c

index b99437eacdb67c9c89010591d12ece7772c69e18..aff2fa02bf42134c2df8f76a4f1fec5a2904f98b 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index a0fa4ac2e63a66881a95fc95f1cc1ff367c2500d..18955716230cbee12547f0c2489c57efe9fbb409 100644 (file)
--- 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:
 
index 1f5c7b0678d34020b1d0b1fb4bee1ecbb5804ccb..3b3b23c6a9a8583e4c32d07e78de73aa61717c26 100644 (file)
@@ -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;
     }