From: "esad (Esad Hajdarevic) via ruby-core" Date: 2025-12-25T22:46:33+00:00 Subject: [ruby-core:124361] [Ruby Bug#21805] Wrong "key not found" in NoMatchingPatternKeyError when destructuring Data 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 `#: key not found: :x (NoMatchingPatternKeyError)` Clearly the message is misleading, as it is key :z that is missing. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/