
Issue #21029 has been updated by matz (Yukihiro Matsumoto). I think compound expressions (expressions (including empty) concatenated by semicolons) should be “expression” as `parse.y`. It makes `defined?` simpler. I know the current `defined?` behavior recursively check for defined-ness (e.g., method parameters), I don't think we need that complexity here. Matz. ---------------------------------------- Bug #21029: Prism behavior for `defined? (;x)` differs https://bugs.ruby-lang.org/issues/21029#change-111865 * Author: qnighy (Masaki Hara) * Status: Assigned * Assignee: prism * ruby -v: ruby 3.5.0dev (2025-01-11T03:21:57Z master 1b3037081e) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Prism has a different behavior for `(;expr)` when used in `defined?` predicate: ```console % ./miniruby --parser=prism -e "p defined? (;x)" nil % ./miniruby --parser=parse.y -e "p defined? (;x)" "expression" ``` Although not a significant difference, aligning either of them with the other would be better. -- https://bugs.ruby-lang.org/