-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Environment Information
jruby 9.4.2.0 (3.1.0) 2023-03-08 90d2913 Java HotSpot(TM) 64-Bit Server VM 25.333-b02 on 1.8.0_333-b02 +jit [x86_64-darwin]
Expected Behavior
given the following example:
proc = -> { puts "bang" }
a = [proc]
a.delete_if { |p| a.delete(p); true }
puts a.sizeI'd expect the output to be "0", as in CRuby, because you can delete an element only once.
Actual Behavior
running the snippet with jruby outputs "-1", which in other scenarios cascades into a NegativeArrayException:
puts a
org.jruby.runtime.builtin.IRubyObject.array(IRubyObject.java:59): Java::JavaLang::NegativeArraySizeException
from org.jruby.RubyArray.toJavaArray(RubyArray.java:515)
from org.jruby.specialized.RubyArrayOneObject.toJavaArray(RubyArrayOneObject.java:250)
from org.jruby.RubyArray.toJavaArrayMaybeUnsafe(RubyArray.java:546)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels