Commit d078d08e4f

Veikka Tuominen <git@vexu.eu>
2022-12-05 17:14:37
Sema: export function instead of the constant referencing it
Closes #13706
1 parent 92f1a29
Changed files (1)
src/Sema.zig
@@ -5405,6 +5405,13 @@ fn zirExport(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void
         },
         else => |e| return e,
     };
+    {
+        try sema.mod.ensureDeclAnalyzed(decl_index);
+        const exported_decl = sema.mod.declPtr(decl_index);
+        if (exported_decl.val.castTag(.function)) |some| {
+            return sema.analyzeExport(block, src, options, some.data.owner_decl);
+        }
+    }
     try sema.analyzeExport(block, src, options, decl_index);
 }