Project

General

Profile

Actions

Bug #18890

closed

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

Added by qnighy (Masaki Hara) over 2 years ago. Updated over 2 years 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 #2

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset git|eaeb130b11fefe91aaf61f294ea32af76dada74f.


[Bug #18890] newline should be insignificant after pattern label

Actions

Also available in: Atom PDF

Like0
Like0Like0