| ... | ... | @@ -2864,18 +2864,18 @@ const err = (error {FileNotFound}).FileNotFound; |
| 2864 | 2864 | assert to make sure the error value is in fact in the destination error set. |
| 2865 | 2865 | </p> |
| 2866 | 2866 | <p> |
| 2867 | | The global error set should generally be avoided when possible, because it prevents |
| 2868 | | the compiler from knowing what errors are possible at compile-time. Knowing |
| 2869 | | the error set at compile-time is better for generated documentationt and for |
| 2870 | | helpful error messages such as forgetting a possible error value in a {#link|switch#}. |
| 2867 | The global error set should generally be avoided because it prevents the |
| 2868 | compiler from knowing what errors are possible at compile-time. Knowing |
| 2869 | the error set at compile-time is better for generated documentation and |
| 2870 | helpful error messages, such as forgetting a possible error value in a {#link|switch#}. |
| 2871 | 2871 | </p> |
| 2872 | 2872 | {#header_close#} |
| 2873 | 2873 | {#header_close#} |
| 2874 | 2874 | {#header_open|Error Union Type#} |
| 2875 | 2875 | <p> |
| 2876 | | Most of the time you will not find yourself using an error set type. Instead, |
| 2877 | | likely you will be using the error union type. This is when you take an error set |
| 2878 | | and a normal type, and create an error union with the <code>!</code> binary operator. |
| 2876 | An error set type and normal type can be combined with the <code>!<code> |
| 2877 | binary operator to form an error union type. You are likely to use an |
| 2878 | error union type more often than an error set type by itself. |
| 2879 | 2879 | </p> |
| 2880 | 2880 | <p> |
| 2881 | 2881 | Here is a function to parse a string into a 64-bit integer: |
| ... | ... | @@ -6033,4 +6033,3 @@ hljs.registerLanguage("zig", function(t) { |
| 6033 | 6033 | </script> |
| 6034 | 6034 | </body> |
| 6035 | 6035 | </html> |
| 6036 | | |