From: "afurm (Andrii Furmanets) via ruby-core" Date: 2025-12-27T11:46:52+00:00 Subject: [ruby-core:124372] [Ruby Bug#21805] Wrong "key not found" in NoMatchingPatternKeyError when destructuring Data Issue #21805 has been updated by afurm (Andrii Furmanets). Thanks. The https://github.com/ruby/ruby/pull/15748 will fix the issue. ---------------------------------------- Bug #21805: Wrong "key not found" in NoMatchingPatternKeyError when destructuring Data https://bugs.ruby-lang.org/issues/21805#change-115885 * 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/