mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Revert "Compiler bug when using unsafe_as"
This reverts commit cb89589155
.
This commit is contained in:
parent
cb89589155
commit
7149ef7df5
1 changed files with 1 additions and 1 deletions
|
@ -550,7 +550,7 @@ module Spectator
|
||||||
# Check if nil was returned by the stub and if its okay to return it.
|
# Check if nil was returned by the stub and if its okay to return it.
|
||||||
if %value.nil? && %type.nilable?
|
if %value.nil? && %type.nilable?
|
||||||
# Value was nil and nil is allowed to be returned.
|
# Value was nil and nil is allowed to be returned.
|
||||||
%cast.unsafe_as({{type}})
|
%type.cast(%cast)
|
||||||
elsif %cast.nil?
|
elsif %cast.nil?
|
||||||
# The stubbed value was something else entirely and cannot be cast to the return type.
|
# The stubbed value was something else entirely and cannot be cast to the return type.
|
||||||
raise TypeCastError.new("#{_spectator_stubbed_name} received message #{ {{call}} } and is attempting to return a `#{%value.class}`, but returned type must be `#{%type}`.")
|
raise TypeCastError.new("#{_spectator_stubbed_name} received message #{ {{call}} } and is attempting to return a `#{%value.class}`, but returned type must be `#{%type}`.")
|
||||||
|
|
Loading…
Reference in a new issue