bugfix with iter.enumerate
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 7 Feb 2023 03:54:51 +0000 (21:54 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 7 Feb 2023 03:54:51 +0000 (21:54 -0600)
.gitignore
compiler/src/types.c
core/container/iter.onyx

index 59c997ccab422f43c1ef3643bd9f35d10cc74d4e..6020b7f2f058c7aceb6b2aca9af76f9a30973120 100644 (file)
@@ -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
index 296bcaec4bb8652eba0a44a2d89a7111e176b622..c1dfe372859424893b89980b7a3c51d80006712b 100644 (file)
@@ -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;
         }
 
index 06cac02f9b2e0104e1872168f409d04b3d05e40c..944fc2cb12996b51b83c3522896eec8ca03e9a75 100644 (file)
@@ -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;