Project

General

Profile

Actions

Bug #18890

closed

parse.y: pattern label is newline-sensitive if it is dynamic

Added by qnighy (Masaki Hara) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
[ruby-core:109113]

Description

The two patterns in the code below behave differently:

def f(obj)
  case obj
  in foo:
    0
    true
  in "bar":
    0
    true
  else
    false
  end
end

p f({ foo: 42 }) # => true
p f({ bar: 42 }) # => false

which does not seem an intended behavior.

Actions

Also available in: Atom PDF

Like0
Like0Like0