Bug 198445
| Summary: | [WHLSL] Variant + placement new => have a bad time | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Saam Barati <saam> |
| Component: | WebGPU | Assignee: | Saam Barati <saam> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | fpizlo, jonlee, justin_fan, mmaxfield, rmorisset |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 199726 | ||
| Bug Blocks: | |||
Saam Barati
Think about for loop, it has Variant<VariableDeclarationsStatement, Expression>
However, we have passes that replace VariableDeclarationsStatement with Statement. So that breaks the type safety of ForLoop. It seems like the only sensible thing is either forbid replacing certain AST nodes, or only use the more general Expression/Statement.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Robin Morisset
Actually there is another option here: just follow the spec that says that
for (X ; e1 ; e2) s
is actually syntactic sugar for
{
X;
for(; e1 ; e2) s
}
This should be very easy to do in the parser, would simplify all code that touches for loops (since there is no more initializer to deal with), and the parser can either put the VariableDeclarationsStatement directly into the block, or if it is an expression wrap it in EffectfulExpressionStatement.
Robin Morisset
Was fixed in 199726.
*** This bug has been marked as a duplicate of bug 199726 ***