small bugfix with field access with no type
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 30 Dec 2020 22:51:33 +0000 (16:51 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 30 Dec 2020 22:51:33 +0000 (16:51 -0600)
docs/bugs
onyx
src/onyxchecker.c

index d3c3580b8d0e5a382a972dae63b2a8e28e963c1a..583d9344f70a71a090e214fd41f3db2694524728 100644 (file)
--- a/docs/bugs
+++ b/docs/bugs
@@ -38,7 +38,7 @@ List of known bugs:
     Since `continue`ing or `break`ing would skip the deferred statement, causing
     an infinite loop.
 
-[ ] The following code causes an infinite loop somewhere.
+[X] The following code causes an infinite loop somewhere.
     ``` 
     get_neighbor_count :: proc (grid: ^map.Map(Vec2, Cell), pos: Vec2) -> u32 {
         count := 0;
diff --git a/onyx b/onyx
index b10a3c9594f4d3a79b18b0edf515f0eaffc87387..e220a548606f6e3314dcdef4f0f708e305ec3591 100755 (executable)
Binary files a/onyx and b/onyx differ
index 40be178029beabce8939658508d345ba231a4982..6ceda8e1c231652089241dbd326c5708d27359db 100644 (file)
@@ -1128,7 +1128,10 @@ b32 check_array_access(AstArrayAccess* aa) {
 b32 check_field_access(AstFieldAccess** pfield) {
     AstFieldAccess* field = *pfield;
     if (check_expression(&field->expr)) return 1;
-    if (field->expr->type == NULL) return 1;
+    if (field->expr->type == NULL) {
+        onyx_report_error(field->token->pos, "Unable able to deduce type of expression for accessing field.");
+        return 1;
+    }
 
     if (!type_is_structlike(field->expr->type)) {
         onyx_report_error(field->token->pos,