In 1.9 mode, for should yield only as many values as there are arguments
------------------------------------------------------------------------

                 Key: JRUBY-6126
                 URL: https://jira.codehaus.org/browse/JRUBY-6126
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.7
         Environment: export JRUBY_OPTS=--1.9
            Reporter: Martin Harriman
            Assignee: Thomas E Enebo


In MRI 1.9.2:
{noformat}

      class OFor
        def each
          [[1,2,3], [4,5,6]].each do |a|
            yield(a[0],a[1],a[2])
          end
        end
      end
      o = OFor.new
      qs = []
      for q in o
        qs << q
      end
{noformat}

This snippet comes from rubyspec/language/for_spec.rb; in MRI 1.9.2, qs gets 
[1, 4].

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to