From: "ufuk (Ufuk Kayserilioglu)" Date: 2021-12-11T20:14:22+00:00 Subject: [ruby-core:106623] [Ruby master Bug#18405] Regression in Struct member setter method parameters Issue #18405 has been reported by ufuk (Ufuk Kayserilioglu). ---------------------------------------- Bug #18405: Regression in Struct member setter method parameters https://bugs.ruby-lang.org/issues/18405 * Author: ufuk (Ufuk Kayserilioglu) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0dev (2021-12-08T10:11:02Z master 3021c3cedc) [x86_64-darwin21] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Since the [PR optimizing Struct accessors](https://github.com/ruby/ruby/pull/5131) was merged, the behaviour of `Method#parameters` on Struct member setter methods has changed. **Before:** ```ruby S = Struct.new(:foo) S.instance_method(:foo=).parameters #=> [[:req, :_]] ``` **After:** ```ruby S = Struct.new(:foo) S.instance_method(:foo=).parameters #=> [[:rest]] ``` This is probably a side-effect of the new optimized accessor implementation that was missed in review. If this change in behaviour was intentional, though, I think it should be fixed, since it is a little strange for a setter method to claim that it takes zero or more parameters. -- https://bugs.ruby-lang.org/ Unsubscribe: