[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
Issue #12134 has been updated by Martin D端rst.
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74301] [Ruby trunk Bug#12174] Interpolation ignores `to_s` (and `inspect`) when `to_s` is defined to `nil`.
From:
sawadatsuyoshi@...
Date:
2016-03-14 17:36:02 UTC
List:
ruby-core #74301
Issue #12174 has been reported by Tsuyoshi Sawada.
----------------------------------------
Bug #12174: Interpolation ignores `to_s` (and `inspect`) when `to_s` is defined to `nil`.
https://bugs.ruby-lang.org/issues/12174
* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v:
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
When `to_s` is defined to return `nil`, interpolation prints the original inspection.
~~~RUBY
class A
def to_s; end
end
puts "#{A.new}" # => #<A:0x007f4edf19d720>
~~~
It even ignores an overwritten `inspect` definition.
~~~RUBY
class A
def to_s; end
def inspect; "foo" end
end
puts "#{A.new}" # => #<A:0x007f8176c09050>
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>