From: ruby-core@... Date: 2019-06-12T13:41:00+00:00 Subject: [ruby-core:93074] [Ruby trunk Bug#15917] Pattern matching for Struct Issue #15917 has been reported by marcandre (Marc-Andre Lafortune). ---------------------------------------- Bug #15917: Pattern matching for Struct https://bugs.ruby-lang.org/issues/15917 * Author: marcandre (Marc-Andre Lafortune) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- `Struct`s respond to `deconstruct`, not to `deconstruct_keys`. Shouldn't we also implement it? ``` A = Struct.new(:foo, :bar) case A.new(1, 2) in foo: 1, **rest p "match" else p "no match" end # => "no match", should be "match" ``` -- https://bugs.ruby-lang.org/ Unsubscribe: