Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jez
Copy link
Collaborator

@jez jez commented Mar 31, 2022

Motivation

The args.callLocs() contains the block argument, if one exists. Any time we
use this in an error message, it'll chunder across the whole screen, turning
large swaths of it red, obscuring other errors.

Even if there isn't a block, usually there's something more specific that we can
give.

This change searches for a bunch of places where callLocs is used and stops
using it.

Test plan

Each commit is arguably an independent change, but given that they're so closely
related in spirit I've made only one PR.

You can review by commit to see the changes to tests next to the relevant change
to calls.cc

@jez jez requested a review from a team as a code owner March 31, 2022 07:12
@jez jez requested review from elliottt and removed request for a team March 31, 2022 07:12
jez added 6 commits March 31, 2022 00:16
This is important because otherwise if there happens to be a block,
Sorbet will chunder a huge red line over the whole method call including
the block arg if present, which sometimes just makes half the file turn
red.
Copy link
Collaborator

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I like the more precise error locations 👍

@jez jez merged commit f0c00b5 into master Mar 31, 2022
@jez jez deleted the jez-calllocs branch March 31, 2022 17:11
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.

3 participants