25 Dec
2025
25 Dec
'25
10:46 p.m.
Issue #21805 has been reported by esad (Esad Hajdarevic). ---------------------------------------- Bug #21805: Wrong "key not found" in NoMatchingPatternKeyError when destructuring Data https://bugs.ruby-lang.org/issues/21805 * Author: esad (Esad Hajdarevic) * Status: Open * ruby -v: ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [arm64-darwin24] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Consider ``` Foo = Data.define(:x) Foo.new(1) => {x:, z:} ``` It raises `#<data Foo x=1>: key not found: :x (NoMatchingPatternKeyError)` Clearly the message is misleading, as it is key :z that is missing. -- https://bugs.ruby-lang.org/