Clear the temporary StoreContext before calling rb_warn() instead of after it. rb_warn() can raise, e.g. if Warning.warn is overridden, and the StoreContext would then free the X509_STORE_CTX it only borrows. https://github.com/ruby/ope...yuki300 (y h)
`_1` already gets the "possibly useless use of a variable in void context" warning, but `it` didn't because it has its own node type. parse.y warns for both. https://github.com/ruby/prism/commit/c860652854yuki300 (y h)
parse.y flattens `(foo)` and a plain `begin ... end` into the surrounding statements, so something like `(foo); bar` or `begin; foo; end; bar` warns about `foo`. Prism didn't look inside them at all. Parentheses only count when there's ...yuki300 (y h)
Applied in changeset commit:git|c260d575a1c84fa57adb0184133482757ff7fea8. ---------- [Bug #22314] Check `**rest` in patterns for duplicates and alternations `p_kwrest` was the only binding rule in patterns that skipped `error_duplicate...yuki300 (y h)
`p_kwrest` was the only binding rule in patterns that skipped `error_duplicate_pattern_variable`, so parse.y accepted `{ a: x, **x }` and `1 | { a: 1, **rest }` at parse time while Prism rejects both. Route it through the same check as `...yuki300 (y h)
Applied in changeset commit:git|0c404b09a00a4bccfd738e165159ba336c873d29. ---------- [Bug #22310] Check only the left operand for captures in alternative patterns `capture_in_pattern` is set by any binding in the whole `in` clause, so ...yuki300 (y h)
`capture_in_pattern` is set by any binding in the whole `in` clause, so `in [ x, :a | :b ]` was rejected while `in [ :a | :b, x ]` was accepted. Keep the flag as a pre-check and walk the left operand for an actual binding before raising,...yuki300 (y h)
When a variable is captured anywhere in a pattern, the operands of each alternation are visited to report captures inside them. That visitor treated every local variable target as a capture, including underscore-prefixed names and target...yuki300 (y h)
A follow-up on "every form I tried gives the same answer": while writing more tests I found a few forms where it's Prism that gets it wrong, the other way around. With a sibling capture present, Prism also rejects `in [x, 1 | _a]`, `in [...yuki300 (y h)