From: viraptor@... Date: 2018-10-25T22:43:32+00:00 Subject: [ruby-core:89561] [Ruby trunk Bug#15255] Change in protected handling 2.3 -> 2.4, 2.5 Issue #15255 has been reported by viraptor (Stan Pitucha). ---------------------------------------- Bug #15255: Change in protected handling 2.3 -> 2.4,2.5 https://bugs.ruby-lang.org/issues/15255 * Author: viraptor (Stan Pitucha) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- It looks like when moving to 2.4 and higher, the access to protected method has changed. In the following case: ~~~ ruby class Foo def bar(objects) objects.map(&:baz) end protected def baz self.inspect end end a = Foo.new; b = Foo.new a.bar([b]) ~~~ The `protected method '...' called` will be raised. I haven't seen any explicit mention of this in the release notes. It can be rewritten to successfully run as: ~~~ ruby objects.map { |x| x.baz } ~~~ But it was an unexpected change. (so potentially a bug?) -- https://bugs.ruby-lang.org/ Unsubscribe: