Daniel Berger wrote:
> Ruby 1.8.6 p110
> Solaris 10
> 
> Anyone else seeing this?
> 
> irb(main):001:0> RUBY_VERSION
> => "1.8.6"
> irb(main):002:0> RUBY_PATCHLEVEL
> => 110
> irb(main):003:0> [1,2,3].fill('a', 0, -2)
> ArgumentError: argument too big
> 
> Dan
> 

Negative lengths are never meaningful to fill(), so I suggest that they 
always be illegal.  The patch below gives a better error message.  The 
added line is taken directly from the code used by the []= method which 
does not allow negative lengths either.  Note that this is an IndexError 
not an ArgumentError...

	David
Index: array.c
===================================================================
--- array.c     (revision 13782)
+++ array.c     (working copy)
@@ -2127,6 +2127,7 @@
             if (beg < 0) beg = 0;
         }
         len = NIL_P(arg2) ? RARRAY_LEN(ary) - beg : NUM2LONG(arg2);
+       if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
         break;
      }
      rb_ary_modify(ary);