You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I'm passing a block around but for some reason, the initially called method never gets a return value. I'm not sure if / what I am doing wrong. I tried different things:
class SomeClass
# some methods omitted
def self.wait_for(&block)
self.new.wait_for &block
end
def wait_for
create_spinner_fiber
value = yield
@finished = true
value
end
end
I also tried:
class SomeClass
def self.wait_for(&block)
self.new.wait_for { block.call }
end
def wait_for
create_spinner_fiber
value = yield
@finished = true
value
end
end
Hey, I'm passing a block around but for some reason, the initially called method never gets a return value. I'm not sure if / what I am doing wrong. I tried different things:
I also tried:
Calling
SomeClass.wait_for { 1 }
always returnsnil
, whileSomeClass.new.wait_for { 1 }
returns1
Crystal 0.22.0 [3c71228] (2017-04-20) LLVM 3.5.0
The text was updated successfully, but these errors were encountered: