mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
stage2: fix case where public variables did not work
This commit is contained in:
parent
b3f5d4dc4c
commit
0d92bd474f
@ -3040,12 +3040,9 @@ fn astgenAndSemaVarDecl(
|
||||
};
|
||||
defer gen_scope.instructions.deinit(mod.gpa);
|
||||
|
||||
const init_result_loc: AstGen.ResultLoc = if (var_decl.ast.type_node != 0)
|
||||
.{
|
||||
.ty = try AstGen.expr(&gen_scope, &gen_scope.base, .{ .ty = .type_type }, var_decl.ast.type_node),
|
||||
}
|
||||
else
|
||||
.none;
|
||||
const init_result_loc: AstGen.ResultLoc = if (var_decl.ast.type_node != 0) .{
|
||||
.ty = try AstGen.expr(&gen_scope, &gen_scope.base, .{ .ty = .type_type }, var_decl.ast.type_node),
|
||||
} else .none;
|
||||
|
||||
const init_inst = try AstGen.comptimeExpr(
|
||||
&gen_scope,
|
||||
@ -3604,6 +3601,7 @@ fn semaContainerVar(
|
||||
mod.comp.work_queue.writeItemAssumeCapacity(.{ .analyze_decl = new_decl });
|
||||
}
|
||||
}
|
||||
new_decl.is_pub = var_decl.visib_token != null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user