JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6124

Yielding no values to a block gives ArrayIndexOutOfBoundsException

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Yielding no values to a block with |(a, b)| throws Java::JavaLang::ArrayIndexOutOfBoundsException.

      This is tested in rubyspec/language/block_spec:

      Assume there's a method z:

      def z
        yield
      end
      

      and it is called:

        @y.z {|(a, b)| [a, b]}
      

      where @y is an instance with the z method. In MRI, this returns [nil, nil]. In jruby, it throws a Java exception.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Appears to be working fine now. Marking as fixed in pre2.

        Show
        Charles Oliver Nutter added a comment - Appears to be working fine now. Marking as fixed in pre2.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Martin Harriman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: