| ... | @@ -4955,7 +4955,7 @@ test "merge error sets" { | ... | @@ -4955,7 +4955,7 @@ test "merge error sets" { |
| 4955 | {#header_open|Inferred Error Sets#} | 4955 | {#header_open|Inferred Error Sets#} |
| 4956 | <p> | 4956 | <p> |
| 4957 | Because many functions in Zig return a possible error, Zig supports inferring the error set. | 4957 | Because many functions in Zig return a possible error, Zig supports inferring the error set. |
| 4958 | To infer the error set for a function, use this syntax: | 4958 | To infer the error set for a function, prepend the {#syntax#}!{#endsyntax#} operator to the function’s return type, like {#syntax#}!T{#endsyntax#}: |
| 4959 | </p> | 4959 | </p> |
| 4960 | {#code_begin|test|inferred_error_sets#} | 4960 | {#code_begin|test|inferred_error_sets#} |
| 4961 | // With an inferred error set | 4961 | // With an inferred error set |