Take advantage of multi-span errors#3273
Merged
garyb merged 2 commits intopurescript:masterfrom Mar 11, 2018
Merged
Conversation
This fixes `CycleInModule ` not having many positions, and adds all positions for `DuplicateModule` using the usual form rather than special handling
684417b to
7e3d3ff
Compare
Member
Author
|
This was broken yesterday, but I've fixed it now (missed a case where a NEL was needed). |
kritzcreek
reviewed
Mar 11, 2018
| toModule (CyclicSCC ms) = | ||
| throwError | ||
| . errorMessage' (getModuleSourceSpan (head ms)) | ||
| . errorMessage'' (NEL.fromList (fmap getModuleSourceSpan ms)) |
Member
There was a problem hiding this comment.
Could we avoid the partial NEL.fromList and just pattern match the head out of ms?
Member
Author
There was a problem hiding this comment.
I mean, we can... I just figured since we can easily see ms is not empty from the pattern already being covered that it probably wasn't necessary?
Member
There was a problem hiding this comment.
I mean we'd just move the partiality into the top level pattern match as that wouldn't match the empty list anymore, but I think fromList is one of those unexpectedly partial functions like maximum...
kritzcreek
approved these changes
Mar 11, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes
CycleInModulenot having many positions, and adds all positions forDuplicateModuleusing the usual form rather than special handling.