[#41778] [Bug #3515] FreeBSD wrongly raises ECONNRESET on close(2) — Yui NARUSE <redmine@...>

Bug #3515: FreeBSD wrongly raises ECONNRESET on close(2)

12 messages 2010/07/02

[ruby-dev:41840] Re: respond_to?(<protected method name>) returns true

From: "Akinori MUSHA" <knu@...>
Date: 2010-07-07 02:39:19 UTC
List: ruby-dev #41840
At Wed, 7 Jul 2010 02:31:28 +0900,
Marc-Andre Lafortune wrote:
> Looking more closely at the change, it is not what I expected.
>
>   class C
>     protected
>     def is_protected; end
>   end
>
>   C.new.respond_to?(:is_protected, true) # => false, I expected true
>
> I feel that either `C.new.respond_to?(:is_protected, true)` should
> return true, or else there should be another way to ask if a method
> respond_to a protected method, say like
> `C.new.respond_to?(:is_protected, :any)`

True.  That was missing from my test cases.  Thanks for point it out.

> Here's a patch for the first option.

I'll commit it later today with some test cases.

--
Akinori MUSHA / http://akinori.org/

In This Thread

Prev Next