Skip to content

Commit

Permalink
Workaround for Tapioca DSL with RuntimeGeneric
Browse files Browse the repository at this point in the history
Since this `self.entity` needs RuntimeGeneric and it's evaluated by
`tapioca dsl` this is triggering an incompatible error with how
RuntimeGeneric works.

This PR addresses it by early returning in this method when Tapioca is
evaluating.

Not very elegant but it makes the trick
  • Loading branch information
gtrias committed Sep 26, 2024
1 parent 6bbde82 commit 5fa36dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/public/repositories/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ module Base

sig { returns(T.untyped) }
def self.entity
return nil if defined?(Tapioca)

T.unsafe(const_get(:Entity)).inner_type[:fixed]
end

Expand Down

0 comments on commit 5fa36dd

Please sign in to comment.