Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Generate sigs for scope, has_many, etc. #60

Open
hdoan741 opened this issue Jun 30, 2019 · 1 comment
Open

Generate sigs for scope, has_many, etc. #60

hdoan741 opened this issue Jun 30, 2019 · 1 comment

Comments

@hdoan741
Copy link
Contributor

It is not possible to generate the sigs right now because T.proc support is limited right now.
For example:
It doesn't work with generic sorbet/sorbet#1139
It doesn't work with variable inputs sorbet/sorbet#1142
T.proc.bind doesn't work with T.nilable sorbet/sorbet#498
T.proc.bind doesn't work with lambda sorbet/sorbet#1143

Once support is improved, we can generate scope it like this

  sig { 
    params(
      name: Symbol, 
      body: T.proc.bind(District::Relation).returns(T.untyped), 
      block: T.nilable(T.proc.void),
    ).void
  }
  def scope(name, body, &block); end
@dogweather
Copy link

dogweather commented May 20, 2020

Is this why I get, e.g.,

Method `has_many` does not exist on `T.class_of(...)`(7003)

?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants