Bug #6340
closedRedefine Net::HTTPResponse#to_ary to avoid implicit conversion errors
Description
I've hit a nasty and subtle bug in code using the deprecated Net::HTTPResponse to_ary conversion: https://github.com/joshfrench/rakismet/pull/17
Up to Ruby 1.9.2 the method generated a warning, but in 1.9.3 it's removed completely.
The problem is, array conversion still happened implicitly and without warnings, but the second variable (which should have been assigned with the response's body) did not get assigned at all.
I suggest redefining the method with an explicit exception to make this mistake less subtle.
Files
Updated by naruse (Yui NARUSE) over 13 years ago
- Status changed from Open to Rejected
It is not array conversion, but multiple assignment.
If this is suggested before 1.9.3, I maybe merged it.
But I won't merge this to 1.9.3 because this is not a bug fix.
And I won't merge this to 2.0 because it's already removed.
So I reject this.