mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Yield instead of forwarding block
Forwarding the block like this captures it, which prevents yield from being used. Addresses https://gitlab.com/arctic-fox/spectator/-/issues/54
This commit is contained in:
parent
a39223ff21
commit
0970f02465
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ module Spectator::Mocks
|
||||||
abstract def call(args : GenericArguments(T, NT), &original : -> RT) forall T, NT, RT
|
abstract def call(args : GenericArguments(T, NT), &original : -> RT) forall T, NT, RT
|
||||||
|
|
||||||
def call!(args : GenericArguments(T, NT), &original : -> RT) : RT forall T, NT, RT
|
def call!(args : GenericArguments(T, NT), &original : -> RT) : RT forall T, NT, RT
|
||||||
value = call(args, &original)
|
value = call(args) { |*ya| yield *ya }
|
||||||
if value.is_a?(RT)
|
if value.is_a?(RT)
|
||||||
value.as(RT)
|
value.as(RT)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue