NoPartialFunctions: fixed bug on object expressions#864
Merged
Conversation
Added a regression test for code that includes object expression.
By removing incorrect type cast.
580bf18 to
4ae8354
Compare
Collaborator
|
@webwarrior-ws just realised, Seq.cast is a partial function! So NoPartialFunctions should have detected this at SelfCheck, please cook a PR that catches Seq.cast and suggests Seq.choose because Seq.tryCast doesn't exist yet. E.g.: Then after that cook a PR for https://github.com/fsprojects/FSharpx.Collections to add Seq.tryCast there, and when that gets merged and released, we can change the recommendation in FSharpLint from Seq.choose to FSharpx.Collections.Seq.tryCast |
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.
By removing incorrect type cast.
Also added a regression test.