-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wgsl-in] Implement phony assignment #1866
Conversation
What if the spec changed to keep up with how rust handle phony assignment? |
let unnamed_110 = (2 != 1); | ||
let unnamed_111 = (2u != 1u); | ||
let unnamed_112 = (2.0 != 1.0); | ||
let unnamed_113 = (vec2<i32>(2) != vec2<i32>(1)); |
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.
I think we know how many times a particular expression is used. So we could just generate _ = xxx
if it's not used, and the name isn't specified
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.
I'm now thinking a new kind of statement for phony assignment might be better (i.e. Phony(Handle<Expression>)
) since using named_expressions with _ feels like a hack. What do you think?
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.
It's not supposed to be a named expression at all. It's just an expression that is emitted at a particular point.
I don't think this warrants an IR change, we shouldn't be introducing a new statement type.
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.
Opened #1869 to address this.
@stshine the first time I used search and replace to replace |
@teoxoy Oh that's something TIL |
fixes #1842