amirrajan / rubymotion-applied

RubyMotion documentation provided by the community. Submit a pull request to the docs for a free one year indie subscription.
Apache License 2.0
49 stars 10 forks source link

`Enumerator.new do` crashes #71

Open hboon opened 6 years ago

hboon commented 6 years ago

This crashes:

fib = Enumerator.new do |y| # <--- this is line 9
  a = b = 1
  loop do
    y << a
    a, b = b, a + b
  end
end

p fib.take(10) # => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]

With:

app/app_delegate.rb:9:in `application:didFinishLaunchingWithOptions:': wrong number of argument (0 for 1) (ArgumentError)

*** Terminating app due to uncaught exception 'ArgumentError', reason: 'app/app_delegate.rb:9:in `application:didFinishLaunchingWithOptions:': wrong number of argument (0 for 1) (ArgumentError)