small bug fixes with polymorphic struct errors
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 9 Jan 2021 16:02:04 +0000 (10:02 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 9 Jan 2021 16:02:04 +0000 (10:02 -0600)
bin/onyx
onyx.exe
src/onyxbuiltins.c
src/onyxutils.c

index 34b974ebf3f9c36f1545db46fbea8df3cbcca365..fa0aaae9b2e543003afd87b22715999dd7aec7b1 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index 6b23601bad28abc2d88e023e3802d9bd191c5a78..5f9676c7f1794f9a4bce20b3d124c71b1026861a 100644 (file)
Binary files a/onyx.exe and b/onyx.exe differ
index 2eb3edc84c4b7a2efdbda3eaac7738a3f58261f6..e0960975f44ed788032763b5deac4a228901cf13 100644 (file)
@@ -40,7 +40,7 @@ AstGlobal builtin_stack_top   = { Ast_Kind_Global, Ast_Flag_Const | Ast_Flag_Glo
 
 // :TypeExprHack
 static OnyxToken type_expr_token = { Token_Type_Symbol, 9, "type_expr", { 0 } };
-AstNode type_expr_symbol         = { Ast_Kind_Basic_Type, 0, &type_expr_token, NULL };
+AstNode type_expr_symbol         = { Ast_Kind_Error, 0, &type_expr_token, NULL };
 
 AstType  *builtin_string_type;
 AstType  *builtin_range_type;
index 3912ffae5b8455c631fe375575ff939a0d7f3d6c..38e18d0bd1b38c540cc94834ec1baaa9966380b6 100644 (file)
@@ -896,6 +896,8 @@ AstStructType* polymorphic_struct_lookup(AstPolyStructType* ps_type, bh_arr(AstP
 
     i32 i = 0;
     bh_arr_each(AstPolySolution, sln, slns) {
+        sln->poly_sym = (AstNode *) &ps_type->poly_params[i];
+        
         PolySolutionKind expected_kind = PSK_Undefined;
         if ((AstNode *) ps_type->poly_params[i].type_node == &type_expr_symbol) {
             expected_kind = PSK_Type;
@@ -932,7 +934,6 @@ AstStructType* polymorphic_struct_lookup(AstPolyStructType* ps_type, bh_arr(AstP
             }
         }
 
-        sln->poly_sym = (AstNode *) &ps_type->poly_params[i];
         i++;
     }