Code Monkey home page Code Monkey logo

Comments (5)

connorshea avatar connorshea commented on June 29, 2024 1

This is now fixed in the upstream sorbet-typed signatures, just need to update sorbet-rails to use them.

from sorbet-rails.

hdoan741 avatar hdoan741 commented on June 29, 2024 1

Thank you @connorshea for the fix! Sorbet-rails does not bundle sorbet-typed in the API (it's included for internal development only). So anyone can update their sorbet-typed with srb rbi sorbet-typed and they would get the new signature!

from sorbet-rails.

connorshea avatar connorshea commented on June 29, 2024

Based on my testing I'm pretty sure the fix is just to change those signatures to this?:

  sig { params(block: T.nilable(T.proc.params(arg0: Elem).returns(T::Boolean))).returns(T::Boolean) }
  def any?(&block); end

  sig { params(block: T.nilable(T.proc.params(arg0: Elem).returns(T::Boolean))).returns(T::Boolean) }
  def many?(&block); end

  sig { params(block: T.nilable(T.proc.params(arg0: Elem).returns(T::Boolean))).returns(T::Boolean) }
  def none?(&block); end

  sig { params(block: T.nilable(T.proc.params(arg0: Elem).returns(T::Boolean))).returns(T::Boolean) }
  def one?(&block); end

from sorbet-rails.

hdoan741 avatar hdoan741 commented on June 29, 2024

Arguably, there are methods affected like select that we may want to change in sorbet-rails though. LMK if you run into issue with select and we can discuss how we should fix it.

from sorbet-rails.

danhuynhdev avatar danhuynhdev commented on June 29, 2024

I've ran into the issue with select after upgrading sorbet-rails. Updated the rbi manually like this for now but would love for it to be fixed here.

  sig { params(args: T.untyped, block: T.untyped).returns(ReportCategory::ActiveRecord_Relation) }
  def select(*args, &block); end

from sorbet-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.