mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Stub's type might not match return type (subclass or union)
This commit is contained in:
parent
d891422b3a
commit
9b94245bd8
1 changed files with 5 additions and 1 deletions
|
@ -23,7 +23,11 @@ module Spectator
|
|||
{% if !method.abstract? %}
|
||||
%stub.as(::Spectator::ValueStub(typeof(previous_def))).value
|
||||
{% elsif method.return_type %}
|
||||
%stub.as(::Spectator::ValueStub({{method.return_type}})).value
|
||||
if %cast = %stub.as?(::Spectator::ValueStub({{method.return_type}}))
|
||||
%cast.value
|
||||
else
|
||||
%stub.value.as({{method.return_type}})
|
||||
end
|
||||
{% else %}
|
||||
%stub.value
|
||||
{% end %}
|
||||
|
|
Loading…
Reference in a new issue