RESOLVED DUPLICATE of bug 199726 198445
[WHLSL] Variant + placement new => have a bad time
https://bugs.webkit.org/show_bug.cgi?id=198445
Summary [WHLSL] Variant + placement new => have a bad time
Saam Barati
Reported 2019-05-31 17:34:58 PDT
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
Robin Morisset
Comment 1 2019-07-10 18:50:45 PDT
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
Comment 2 2019-07-16 14:00:39 PDT
Was fixed in 199726. *** This bug has been marked as a duplicate of bug 199726 ***
Note You need to log in before you can comment on or make changes to this bug.