mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
add missing "referenced here" notes for lazy values
This commit is contained in:
parent
8460d5617c
commit
0d6a6c76ea
@ -1918,7 +1918,7 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) {
|
||||
if (enum_type->data.enumeration.resolve_status != ResolveStatusInvalid) {
|
||||
enum_type->data.enumeration.resolve_status = ResolveStatusInvalid;
|
||||
g->trace_err = add_node_error(g, decl_node,
|
||||
buf_sprintf("circular dependency: whether enum '%s' has non-zero size",
|
||||
buf_sprintf("dependency loop: whether enum '%s' has non-zero size",
|
||||
buf_ptr(&enum_type->name)));
|
||||
}
|
||||
return ErrorSemanticAnalyzeFail;
|
||||
@ -2095,7 +2095,7 @@ static Error resolve_struct_zero_bits(CodeGen *g, ZigType *struct_type) {
|
||||
if (struct_type->data.structure.resolve_status != ResolveStatusInvalid) {
|
||||
struct_type->data.structure.resolve_status = ResolveStatusInvalid;
|
||||
g->trace_err = add_node_error(g, decl_node,
|
||||
buf_sprintf("circular dependency: whether struct '%s' has non-zero size",
|
||||
buf_sprintf("dependency loop: whether struct '%s' has non-zero size",
|
||||
buf_ptr(&struct_type->name)));
|
||||
}
|
||||
return ErrorSemanticAnalyzeFail;
|
||||
@ -2282,7 +2282,7 @@ static Error resolve_union_zero_bits(CodeGen *g, ZigType *union_type) {
|
||||
if (union_type->data.unionation.resolve_status != ResolveStatusInvalid) {
|
||||
union_type->data.unionation.resolve_status = ResolveStatusInvalid;
|
||||
g->trace_err = add_node_error(g, decl_node,
|
||||
buf_sprintf("circular dependency: whether union '%s' has non-zero size",
|
||||
buf_sprintf("dependency loop: whether union '%s' has non-zero size",
|
||||
buf_ptr(&union_type->name)));
|
||||
}
|
||||
return ErrorSemanticAnalyzeFail;
|
||||
|
||||
@ -10813,8 +10813,13 @@ ConstExprValue *ir_eval_const_value(CodeGen *codegen, Scope *scope, AstNode *nod
|
||||
ConstExprValue *result = ir_exec_const_result(codegen, analyzed_executable);
|
||||
|
||||
if (!allow_lazy) {
|
||||
if ((err = ir_resolve_lazy(codegen, node, result)))
|
||||
if ((err = ir_resolve_lazy(codegen, node, result))) {
|
||||
if (codegen->trace_err != nullptr) {
|
||||
codegen->trace_err = add_error_note(codegen, codegen->trace_err, source_node,
|
||||
buf_create_from_str("referenced here"));
|
||||
}
|
||||
return &codegen->invalid_instruction->value;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user