Skip to content

Pattern matching not working #8283

@stoivo

Description

@stoivo

Environment Information

Provide at least:

  • JRuby version (jruby -v) jruby 9.4.7.0 (3.1.4) 2024-04-29 597ff08ac1 OpenJDK 64-Bit Server VM 25.412-b08 on 1.8.0_412-b08 +jit [aarch64-linux]
  • Operating system and platform (e.g. uname -a) Linux d0135f341f7e 6.4.16-linuxkit #1 SMP PREEMPT Sat Sep 23 13:36:48 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

Expected Behavior

The following script should print it works {:node=>:delim}.

token = {:node=>:delim}

case token
in node: :comma
  if token[:node] != :comma
    raise "token is not comma token #{token.inspect}"
  end
  puts "it works #{token}"
else
  puts "it works #{token}"
end

Actual Behavior

script crashed with error

RuntimeError: token is not comma token {:node=>:delim}
   <main> at lib/lol.rb:6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions