mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
langref: define the inferred error set syntax more explicitly
This edit allows the reader to understand the syntax this section is talking about more quickly – they don’t have to read the whole code block and understand which part of it demonstrates the feature being described. Affects https://ziglang.org/documentation/master/#Inferred-Error-Sets
This commit is contained in:
parent
db181b173f
commit
b3ae69d80b
@ -4955,7 +4955,7 @@ test "merge error sets" {
|
||||
{#header_open|Inferred Error Sets#}
|
||||
<p>
|
||||
Because many functions in Zig return a possible error, Zig supports inferring the error set.
|
||||
To infer the error set for a function, use this syntax:
|
||||
To infer the error set for a function, prepend the {#syntax#}!{#endsyntax#} operator to the function’s return type, like {#syntax#}!T{#endsyntax#}:
|
||||
</p>
|
||||
{#code_begin|test|inferred_error_sets#}
|
||||
// With an inferred error set
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user