Skip to content

Incompatibility in pattern matching between CRuby and mruby with array splatting #6854

Closed

Description

@HirohitoHigashi

I found an incompatibility in the pattern matching feature between CRuby and mruby.

With the following test code:

a = [1, 2]
result = case [*a]
         in [1, 2]
           :match
         else
           :nomatch
         end
p result

CRuby outputs :match, but mruby outputs :nomatch.

I tested this in the following environment:

  • OS: MacOS 26.5
  • CRuby: ruby 3.4.9 (2026-03-11 revision 76cca827ab) +PRISM [x86_64-darwin23]
  • mruby: mruby 4.0.0 (2026/05/22 master)

Activity

  1. added a commit that references this issue on May 23, 2026
    cddaec7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions