8000 Make error assertions that match duplicate errors explicit. by jvilk-stripe · Pull Request #1246 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make error assertions that match duplicate errors explicit. #1246

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 6 commits into from
Jul 11, 2019

Conversation

jvilk-stripe
Copy link
Collaborator

Make error assertions that match duplicate errors explicit.

Introduces a new assertion, error-with-dupes, which has the same semantics as error except that it can match multiple diagnostics.

Note: It is not an error to have an error-with-dupes assertion that does not match duplicate errors. Some errors only duplicate in LSP mode, some only on CLI mode, and some only on the fast path. :(

Motivation

Previously, test_corpus ignored duplicate error messages.

While working on another pull request, I realized that the IDE would report duplicate errors in certain scenarios. I included a fix:
#1202 (comment)

However, without this change, I had no way to add a test corresponding to the fix. It's also likely that, with this change, I would have spotted and fixed that bug earlier.

Test plan

See included automated tests.

@jvilk-stripe jvilk-stripe requested a review from a team July 10, 2019 00:06
@ghost ghost requested review from elliottt and removed request for a team July 10, 2019 00:06
@jvilk-stripe
Copy link
Collaborator Author

I'm open to bikeshedding on the assertion name, too.

@jvilk-stripe
Copy link
Collaborator Author

Looks like I missed some LSP tests; running tests again locally and will fix..

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 to me. error-with-dupes makes sense, no need to bike-shed :)

@jvilk-stripe jvilk-stripe force-pushed the jvilk-make-duplicate-errors-explicit branch from 9032741 to 4b1f3e9 Compare July 10, 2019 17:10
@jvilk-stripe jvilk-stripe force-pushed the jvilk-make-duplicate-errors-explicit branch from 9787211 to d518f87 Compare July 10, 2019 23:56
@jvilk-stripe jvilk-stripe merged commit c744a49 into master Jul 11, 2019
@jvilk-stripe jvilk-stripe deleted the jvilk-make-duplicate-errors-explicit branch July 11, 2019 00:31
pje pushed a commit to pje/sorbet that referenced this pull request Jul 15, 2019
)

* Make error assertions that match duplicate errors explicit.

* Ensure that fast path does not produce duplicate errors after a sig update.
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