glfw: dont use @errSetCast #160

Merged
leecannon merged 1 commit from dont_use_err_set_cast into main 2022-02-09 02:58:52 +00:00
leecannon commented 2022-02-08 02:15:59 +00:00 (Migrated from github.com)

In safe build modes @errSetCast emits runtime checks to validate the error is in the destination errorset.

As switches do errorset narrowing automatically @errSetCast is unnecessary and validation of the error being in the errorset occurs at compile time.

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
In safe build modes `@errSetCast` emits *runtime* checks to validate the error is in the destination errorset. As switches do errorset narrowing automatically `@errSetCast` is unnecessary and validation of the error being in the errorset occurs at compile time. - [X] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
emidoots (Migrated from github.com) approved these changes 2022-02-09 02:58:48 +00:00
emidoots (Migrated from github.com) left a comment

Love this, thanks so much! Now I want a Zig linter for this type of thing :)

Love this, thanks so much! Now I want a Zig linter for this type of thing :)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!160
No description provided.