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:
Michael Miller 2020-09-27 10:14:30 -06:00
parent a39223ff21
commit 0970f02465
No known key found for this signature in database
GPG Key ID: FB9F12F7C646A4AD
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ module Spectator::Mocks
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
value = call(args, &original)
value = call(args) { |*ya| yield *ya }
if value.is_a?(RT)
value.as(RT)
else