Project

General

Profile

Actions

Bug #21029

open

Prism behavior for `defined? (;x)` differs

Added by qnighy (Masaki Hara) 4 days ago. Updated 1 day ago.

Status:
Open
Assignee:
Target version:
-
ruby -v:
ruby 3.5.0dev (2025-01-11T03:21:57Z master 1b3037081e) +PRISM [x86_64-linux]
[ruby-core:120618]

Description

Prism has a different behavior for (;expr) when used in defined? predicate:

% ./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.

Updated by kddnewton (Kevin Newton) 4 days ago

  • Assignee set to prism

Updated by kddnewton (Kevin Newton) 1 day ago

I think we should change parse.y to match this behavior. I will ask around.

Actions

Also available in: Atom PDF

Like1
Like0Like0