From: Brendan Hansen Date: Wed, 30 Dec 2020 22:51:33 +0000 (-0600) Subject: small bugfix with field access with no type X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=75cda27d626e9069dfbfe908ed8f2d5b22ed43d3;p=onyx.git small bugfix with field access with no type --- diff --git a/docs/bugs b/docs/bugs index d3c3580b..583d9344 100644 --- 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 b10a3c95..e220a548 100755 Binary files a/onyx and b/onyx differ diff --git a/src/onyxchecker.c b/src/onyxchecker.c index 40be1780..6ceda8e1 100644 --- a/src/onyxchecker.c +++ b/src/onyxchecker.c @@ -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,