From c6d016f308208b13cd14144d0ec0440b4f48f296 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 6 Feb 2023 21:54:51 -0600 Subject: [PATCH] bugfix with iter.enumerate --- .gitignore | 1 + compiler/src/types.c | 5 +++++ core/container/iter.onyx | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) 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; -- 2.25.1