From: Brendan Hansen Date: Tue, 7 Feb 2023 03:54:51 +0000 (-0600) Subject: bugfix with iter.enumerate X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=c6d016f308208b13cd14144d0ec0440b4f48f296;p=onyx.git bugfix with iter.enumerate --- diff --git a/.gitignore b/.gitignore index 59c997cc..6020b7f2 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ tmp/ dist/ **/node_modules/ onyx-lsp.ini +shared/lib/linux_x86_64/lib/libovmwasm.so \ No newline at end of file diff --git a/compiler/src/types.c b/compiler/src/types.c index 296bcaec..c1dfe372 100644 --- a/compiler/src/types.c +++ b/compiler/src/types.c @@ -605,6 +605,11 @@ static Type* type_build_from_ast_inner(bh_allocator alloc, AstType* type_node, b return type_of->resolved_type; } + // Why does this have to be here? + if (type_of->expr->type != NULL) { + return type_of->expr->type; + } + return NULL; } diff --git a/core/container/iter.onyx b/core/container/iter.onyx index 06cac02f..944fc2cb 100644 --- a/core/container/iter.onyx +++ b/core/container/iter.onyx @@ -378,7 +378,7 @@ enumerate :: (it: Iterator($T), start_index: i32 = 0) -> Iterator(Enumeration_Va value, cont := next(ec.iterator); if cont { defer ec.current_index += 1; - return Enumeration_Value(typeof value).{ current_index, value }, true; + return Enumeration_Value(typeof value).{ ec.current_index, value }, true; } return .{}, false;