# Super return changed in 1.8.6

**URL:** <https://www.ruby-forum.com/t/super-return-changed-in-1-8-6/108438>\
**Category:** Ruby\
**Created:** [July 3, 2007, 4:03pm UTC](https://www.ruby-forum.com/t/super-return-changed-in-1-8-6/108438 "2007-07-03T16:03:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [July 3, 2007, 4:03pm UTC](https://www.ruby-forum.com/t/super-return-changed-in-1-8-6/108438/1 "2007-07-03T16:03:32Z")

</div>

Hello,

The following snippet:

#!/usr/bin/ruby -w  
require ‘date’  
class MyDate \< Date  
def self.today  
super  
end  
end  
puts MyDate.today.class

## end

prints out ‘MyDate’ with ruby 1.8.4 and 1.8.5, but ‘Date’ with 1.8.6

Is this a bug in 1.8.6, or the correction of a long lived bug in  
versions before ?

Cheers,

Han H.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [July 3, 2007, 5:32pm UTC](https://www.ruby-forum.com/t/super-return-changed-in-1-8-6/108438/2 "2007-07-03T17:32:50Z")

</div>

On 7/3/07, Han H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> end  
> puts MyDate.today.class
> 
> ## end
> 
> prints out ‘MyDate’ with ruby 1.8.4 and 1.8.5, but ‘Date’ with 1.8.6
> 
> Is this a bug in 1.8.6, or the correction of a long lived bug in  
> versions before ?

It looks like perhaps the date library has changed in 1.8.6

[http://svn.ruby-lang.org/repos/ruby/tags/v1\_8\_6/NEWS](http://svn.ruby-lang.org/repos/ruby/tags/v1_8_6/NEWS)

" \* date

- Updated based on date2 4.0.3. "

I’ve not investigated further.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [July 4, 2007, 4:50pm UTC](https://www.ruby-forum.com/t/super-return-changed-in-1-8-6/108438/3 "2007-07-04T16:50:22Z")

</div>

On 7/3/07, Gregory B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

Indeed.  
My question was whether this should be considered a bug: #today is  
kind of a specialized version of #new, so I would expect the  
implementation to be #new like, and return a MyDate.

Cheers,

Han H.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/super-return-changed-in-1-8-6/108438/4 "2007-09-25T23:09:18Z")

</div>

On 7/4/07, Han H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Indeed.  
> My question was whether this should be considered a bug: #today is  
> kind of a specialized version of #new, so I would expect the  
> implementation to be #new like, and return a MyDate.

That sounds to me like someone used Date.new instead of self.new in  
class method somewhere. 🙂

And yeah, I’d look at it as a bug too. As a workaround, you can  
probably do a manual conversion…
