8000 Add `Kernel#tap` method & signature by Morriar · Pull Request #484 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Dismiss alert

Add Kernel#tap method & signature #484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2019
Merged

Add Kernel#tap method & signature #484

merged 2 commits into from
May 13, 2019

Conversation

Morriar
Copy link
Collaborator
@Morriar Morriar commented May 10, 2019

The Kernel module was missing the tap method:

  sig do
    params(
      blk: T.proc.params(x: T.untyped).void
    )
    .returns(T.self_type)
  end
  def tap(&blk); end

I originally wanted to write this:

      blk: T.proc.params(T.self_type).void

But Sorbet forbids it:

core/kernel.rbi:354: Only top-level T.self_type is supported https://sorbet.org/docs/error-reference#5004
     354 |      blk: T.proc.params(x: T.self_type).void
                                      ^^^^^^^^^^^

Any idea on how to avoid the T.untyped here?

@codecov
Copy link
codecov bot commented May 11, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@a9e60db). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff            @@
##             master    #484   +/-   ##
========================================
  Coverage          ?   91.3%           
========================================
  Files             ?     157           
  Lines             ?   26373           
  Branches          ?       0           
========================================
  Hits              ?   24081           
  Misses            ?    2292           
  Partials          ?       0

Morriar added 2 commits May 13, 2019 10:01
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar
Copy link
Collaborator Author
Morriar commented May 13, 2019

Update: fixed merge conflicts

@ptarjan ptarjan merged commit 34a9e1d into sorbet:master May 13, 2019
@Morriar Morriar deleted the at-tap branch May 14, 2019 21:59
elliottt added a commit that referenced this pull request Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0