Skip to content
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

Fix bugs in NoPartialFunctions rule #653

Merged

Conversation

webwarrior-ws
Copy link
Contributor

Fix bugs in NoPartialFunctions rule:

  • false negative when instance member is called on arbitrary expression, not just dotted identifier.
  • false positive when Value instance method is called on value that is not Option, but another Option value exists in scope.

Added tests for these cases.

Added failing test for NoPartialFunctions for case when `Value`
member is called on result of `List.tryHead`.
Fixed NoPartialFunctions rule for case when instance member is
called on arbitrary expression, not just dotted identifier.
Added regression test for NoPartialFunctions for case when
`Value` instance method is called on non value that is not
Option, but another Option value exists in scope.
Fix case when `Value` instance method is called on value
that is not Option, but another Option value exists in scope.
@webwarrior-ws webwarrior-ws force-pushed the partial-functions-value-squashed branch from 9b2b20a to b55f5b6 Compare January 10, 2024 11:42
Use lookup in partialInstanceMemberIdentifiers list instead of
pattern matching in getFunctionValTypeName function. This means
less places to modify when adding new instance member
replacement strategy.
@webwarrior-ws webwarrior-ws force-pushed the partial-functions-value-squashed branch from 01b2627 to eaac788 Compare January 10, 2024 11:53
@knocte knocte merged commit fcf9213 into fsprojects:master Jan 11, 2024
5 checks passed
knocte added a commit to knocte/FSharpLint that referenced this pull request Jan 13, 2024
…value-squashed"

This reverts commit fcf9213 temporarily,
because it caused a regression in the rule that we caught when trying to
rebase PR fsprojects#668 (it crashes FSharpLint when trying to use FSharpLint on
itself).
knocte added a commit that referenced this pull request Jan 15, 2024
…lue-squashed""

This reverts commit b69b24b because
now that we have release 0.24.0 (stable version) we can reintroduce
this PR again which causes a regression which we will fix in the
next upcoming prereleases.
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.

None yet

2 participants