[#1611] set_trace_func/Array#fetch error — "Nathaniel Talbott" <nathaniel@...>

I've reduced the error I reported in ruby-talk:84013 to the following code:

17 messages 2003/10/11

Re: set_trace_func/Array#fetch error

From: "Nathaniel Talbott" <nathaniel@...>
Date: 2003-10-11 17:03:46 UTC
List: ruby-core #1615
daz [mailto:dooby@d10.karoo.co.uk] wrote:

> > I've reduced the error I reported in ruby-talk:84013 to the following 
> > code:
> >
> >   set_trace_func(proc{})
> >
> >   def m
> >     [].fetch(2) {return nil}
> 
>       [].fetch(2) {nil}  # <--------- see Array#fetch w/ block

Sure, that would get rid of the error, but the point is that

  [].fetch(2){return nil}

shouldn't produce any error at all (and doesn't if set_trace_func isn't
called). It was actually code in optparse.rb that was triggering the error,
and that code uses "return nil" on purpose.


> Lookout forehead ... ;-)

Ummm... I'm not ready to slap it quite yet :-)


Nathaniel

<:((><


In This Thread