diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-10-08 13:41:13 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-10-08 13:41:13 -0400 |
| commit | 784a493dc7114b6e6807c2a37d03dbadecee81e6 (patch) | |
| tree | b2a9709664aed3f9a2d53aa4c233a3887aa93984 /src/ir.cpp | |
| parent | 03a6b33a73612500038635633d4c8326c2b5cf5f (diff) | |
| download | zig-784a493dc7114b6e6807c2a37d03dbadecee81e6.tar.gz zig-784a493dc7114b6e6807c2a37d03dbadecee81e6.zip | |
generated docs: functions with inferred error sets display nicely
infrastructure in place for displaying error sets
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 2bfde74da0..7e2b39fe1b 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9692,7 +9692,7 @@ static ConstCastOnly types_match_const_cast_only(IrAnalyze *ira, ZigType *wanted ZigType *container_set = wanted_type; // if the container set is inferred, then this will always work. - if (container_set->data.error_set.infer_fn != nullptr) { + if (container_set->data.error_set.infer_fn != nullptr && container_set->data.error_set.incomplete) { return result; } // if the container set is the global one, it will always work. @@ -16157,7 +16157,7 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c UndefOk); if (inferred_err_set_type != nullptr) { - inferred_err_set_type->data.error_set.infer_fn = nullptr; + inferred_err_set_type->data.error_set.incomplete = false; if (result->type->id == ZigTypeIdErrorUnion) { ErrorTableEntry *err = result->data.x_err_union.error_set->data.x_err_set; if (err != nullptr) { @@ -23617,7 +23617,7 @@ static IrInstruction *ir_analyze_instruction_test_err(IrAnalyze *ira, IrInstruct if (!type_is_global_error_set(err_set_type) && err_set_type->data.error_set.err_count == 0) { - assert(err_set_type->data.error_set.infer_fn == nullptr); + assert(!err_set_type->data.error_set.incomplete); return ir_const_bool(ira, &instruction->base, false); } } |
