miscellaneous bugfixes
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 13 Jun 2023 21:47:53 +0000 (16:47 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 13 Jun 2023 21:47:53 +0000 (16:47 -0500)
compiler/src/astnodes.c
compiler/src/doc.c
compiler/src/symres.c
compiler/src/wasm_output.h

index 12e83ff709d70c126b77f9f72fa0cacfdd367cce..0d22b61e5f1b7df07d7f434eac1f3a5a44b23bd1 100644 (file)
@@ -668,7 +668,11 @@ TypeMatch unify_node_and_type_(AstTyped** pnode, Type* type, b32 permanent) {
             return TYPE_MATCH_YIELD;
         }
 
-        if (permanent) *pnode = (AstTyped *) resolved;
+        if (permanent) {
+            track_resolution_for_symbol_info((AstNode *) node, resolved);
+            *pnode = (AstTyped *) resolved;
+        }
+
         return TYPE_MATCH_SUCCESS;
     }
 
index 1328bbc20ef0162ae87d9284dcc046ba0b7a7820..eff9e379ae90f2a61afad51a65f0a043bec660a2 100644 (file)
@@ -60,7 +60,7 @@ static i32 sort_symbol_resolutions(const SymbolResolution *a, const SymbolResolu
         return a->line > b->line ? 1 : -1;
     }
 
-    return 0;
+    return a->column > b->column ? 1 : -1;
 }
 
 void onyx_docs_emit_symbol_info(const char *dest) {
index 9535ca4f533a83d00e4b4fad41e9ad1c6a63ea67..4f63cb50831b3e7bfc42a239eddfe9b1591f0643 100644 (file)
@@ -195,7 +195,7 @@ static SymresStatus symres_union_type(AstUnionType* u_node) {
 
     fori (i, 0, bh_arr_length(u_node->variants)) {
         AstUnionVariant *variant = u_node->variants[i];
-        // track_declaration_for_symbol_info(member->token->pos, (AstNode *) member);
+        track_declaration_for_symbol_info(variant->token->pos, (AstNode *) variant);
 
         assert(variant->type_node);
         SymresStatus ss = symres_type(&variant->type_node);
index 3d86f5f2c6d224a14c5f8beb6c55d8a9028225df..ba47d0e069f2eb00fc588496a524f7dacf3c7e1b 100644 (file)
@@ -1047,6 +1047,7 @@ static i32 output_ovm_debug_sections(OnyxWasmModule* module, bh_buffer* buff) {
             // Outside of runtime type information, they provide no useful
             // debugging information (I don't think at least...).
             if (type->kind == Type_Kind_PolyStruct ||
+                type->kind == Type_Kind_PolyUnion ||
                 type->kind == Type_Kind_Compound) {
                 output_unsigned_integer(1, &section_buff);
                 output_unsigned_integer(0, &section_buff);