From #31965 (comment):
this idiom avoids footgun of typo in inferred error set functions
Instances found using the regex ^\s*error\.(\w+) => return error\.1円\b. Each instance was handled manually (not mass search-and-replace).
The switch prongs in the the src/codegen files could be condensed/combined into other switch prongs (some even replaced with try), but I figured there was a reason error.CodegenFail was singled out so I left it singled out for those files (but still replaced with => |e| return e).
From https://codeberg.org/ziglang/zig/pulls/31965#issuecomment-13388538:
> this idiom avoids footgun of typo in inferred error set functions
Instances found using the regex `^\s*error\.(\w+) => return error\.1円\b`. Each instance was handled manually (not mass search-and-replace).
The switch prongs in the the src/codegen files could be condensed/combined into other switch prongs (some even replaced with `try`), but I figured there was a reason `error.CodegenFail` was singled out so I left it singled out for those files (but still replaced with `=> |e| return e`).