Generator.new can't handle blocks, and its yield method works incorrectly
-------------------------------------------------------------------------

                 Key: JRUBY-1643
                 URL: http://jira.codehaus.org/browse/JRUBY-1643
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: Ubuntu Linux 7.10, JRuby 1.1b1
            Reporter: Vladimir Sizikov


Simple example right from ruby-docs:

g = Generator.new { |g|
  for i in 'A'..'C'
      g.yield i
  end
  g.yield 'Z'
}

It works under MRI, but fails under JRuby:
Exception in thread "Thread-0" :1: yield called out of block (LocalJumpError)
        ...internal jruby stack elided...

Even more simple example fails: 
g = Generator.new { |ig| ig.yield 888 }

But yield is actually invoked in the block.

Also, calling yield out of block is actually doesn't trigger the error, so it 
seems the behavior is exactly an opposite to what is needed.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
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