mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix described_class
Must be a macro, otherwise the return type becomes a union of all nested described_class methods, which can cause weird errors.
This commit is contained in:
parent
a20b7cad80
commit
0363c43dff
1 changed files with 8 additions and 8 deletions
|
@ -86,17 +86,17 @@ module Spectator::DSL
|
||||||
what.is_a?(TypeNode) ||
|
what.is_a?(TypeNode) ||
|
||||||
what.is_a?(Union)) &&
|
what.is_a?(Union)) &&
|
||||||
(described_type = what.resolve?).is_a?(TypeNode) %}
|
(described_type = what.resolve?).is_a?(TypeNode) %}
|
||||||
private def described_class
|
private macro described_class
|
||||||
{{described_type}}
|
{{what}}
|
||||||
end
|
end
|
||||||
|
|
||||||
{% if described_type < Reference || described_type < Value %}
|
subject do
|
||||||
subject { described_class.new }
|
{% if described_type.class? || described_type.struct? %}
|
||||||
|
described_class.new
|
||||||
{% else %}
|
{% else %}
|
||||||
private def subject
|
|
||||||
described_class
|
described_class
|
||||||
end
|
|
||||||
{% end %}
|
{% end %}
|
||||||
|
end
|
||||||
{% else %}
|
{% else %}
|
||||||
private def _spectator_implicit_subject
|
private def _spectator_implicit_subject
|
||||||
{{what}}
|
{{what}}
|
||||||
|
|
Loading…
Reference in a new issue