Open hdoan741 opened 5 years ago
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 https://github.com/sorbet/sorbet/issues/1139 It doesn't work with variable inputs https://github.com/sorbet/sorbet/issues/1142 T.proc.bind doesn't work with T.nilable https://github.com/sorbet/sorbet/issues/498 T.proc.bind doesn't work with lambda https://github.com/sorbet/sorbet/issues/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
Is this why I get, e.g.,
Method `has_many` does not exist on `T.class_of(...)`(7003)
?
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 https://github.com/sorbet/sorbet/issues/1139 It doesn't work with variable inputs https://github.com/sorbet/sorbet/issues/1142 T.proc.bind doesn't work with T.nilable https://github.com/sorbet/sorbet/issues/498 T.proc.bind doesn't work with lambda https://github.com/sorbet/sorbet/issues/1143
Once support is improved, we can generate scope it like this