# Warning: discarding old \<methodName\>?

**URL:** <https://rubytalk.org/t/warning-discarding-old-methodname/3536>\
**Category:** ruby-talk\
**Created:** [11 December 2002 17:24 UTC](https://rubytalk.org/t/warning-discarding-old-methodname/3536 "2002-12-11T17:24:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lind\_Juergen](https://avatars.discourse-cdn.com/v4/letter/l/67e7ee/32.png) [@Lind\_Juergen](https://rubytalk.org/u/Lind_Juergen)\
**Post date:** [11 December 2002 17:24 UTC](https://rubytalk.org/t/warning-discarding-old-methodname/3536/1 "2002-12-11T17:24:22Z")

</div>

Hmm sounds quite like I thought but I donot see the point.

May it come indirectly through require statements like:

- module M requires a.rb and b.rb
- both, a and b require c.rb

I’ll have to examine tomorrow, for today it’s enough 😉

I use stable 1.6.7 on win32

Best wishes  
Juergen Lind

> **···**
>
> -----Original Message-----  
> From: [dblack@candle.superlink.net](mailto:dblack@candle.superlink.net) [[mailto:dblack@candle.superlink.net](mailto:dblack@candle.superlink.net)]  
> Sent: Wednesday, December 11, 2002 6:14 PM  
> To: [ruby-talk@ruby-lang.org](mailto:ruby-talk@ruby-lang.org)  
> Subject: Re: warning: discarding old ?
> 
> Hi –
> 
> On Thu, 12 Dec 2002, Lind, Juergen wrote:
> 
> > Hi folks,
> > 
> > why does this warning come up?  
> > What might be wrong with my code?
> 
> The warning (“discarding old ”) comes up when you discard an  
> old method 🙂
> 
> It basically means that you’ve overridden a method without saving  
> a path to the old version of the method.
> 
> For example:
> 
> class String  
> def split; end  
> end
> 
> However, if you do this:
> 
> class String  
> alias :oldsplit :split  
> def split; end  
> end
> 
> the old method is still available (as oldsplit), so it has not  
> been discarded and there’s no warning.
> 
> David
> 
> –  
> David Alan Black  
> home: [dblack@candle.superlink.net](mailto:dblack@candle.superlink.net)  
> work: blackdav@shu.edu  
> Web: [http://pirate.shu.edu/~blackdav](http://pirate.shu.edu/~blackdav)
