forked from ziglang/zig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stage1: allow (?T == ?T) and combinations
* unwrap operand(s) to { BinOpTypeCmpEq, BinOpTypeCmpNotEq }: - when not comparing with null - when either lhs or rhs or both are optional * repeat until neither operand was unwrapped
- Loading branch information
Showing
3 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
baf161e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right here:
I think this is a mistake. You are unwrapping without checking if a value actually exists. It's necessary to generate some control flow around this for null checking, which after talking to andrew would be best accomplished by creating a new type of IrInstGen just for comparing optionals. I'm not sure why this passes, but it is definitely incorrect. I think the error you were getting with
ir_analyze_optional_value_payload_value
was actually telling you the right thing.baf161e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for catching this! I had a verbose-ir dump of desired behaviour showing need for runtime branch before but somehow lost it.