From: ruby-core@... Date: 2019-05-27T16:19:36+00:00 Subject: [ruby-core:92864] [Ruby trunk Feature#15881] Optimize deconstruct in pattern matching Issue #15881 has been reported by marcandre (Marc-Andre Lafortune). ---------------------------------------- Feature #15881: Optimize deconstruct in pattern matching https://bugs.ruby-lang.org/issues/15881 * Author: marcandre (Marc-Andre Lafortune) * Status: Open * Priority: Normal * Assignee: * Target version: 2.7 ---------------------------------------- ```ruby class A def deconstruct puts 'deconstruct called' [1] end end case A.new in [2] 2 in [1] 1 else end # => 1, prints "deconstruct called" ``` Shouldn't `deconstruct called` print only once, whenever the first deconstruction needed occurs? -- https://bugs.ruby-lang.org/ Unsubscribe: