Fix FS0452 for empty string pattern matching in quotations#19532
Fix FS0452 for empty string pattern matching in quotations#19532
Conversation
…or empty string matching Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/213130f0-37c1-4efc-ab4d-e6f9b324a252 Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/213130f0-37c1-4efc-ab4d-e6f9b324a252 Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
...s/FSharp.Compiler.ComponentTests/Conformance/Expressions/ExpressionQuotations/Regressions.fs
Show resolved
Hide resolved
Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/24c1fabb-ab83-45af-ab77-d9ca97cc8d69 Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
|
/backport to backport/pr-19532 |
|
Started backporting to |
|
/backport to pr-19532-rel-insiders |
|
Started backporting to |
|
@abonie backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch --exclude=docs/release-notes/* --exclude=eng/common/* --whitespace=fix changes.patch
Creating an empty commit: Initial plan
Applying: Fix FS0452: Handle non-null test IL pattern in quotation translator for empty string matching
Using index info to reconstruct a base tree...
A tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ExpressionQuotations/Regressions.fs
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ExpressionQuotations/Regressions.fs deleted in HEAD and modified in Fix FS0452: Handle non-null test IL pattern in quotation translator for empty string matching. Version Fix FS0452: Handle non-null test IL pattern in quotation translator for empty string matching of tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ExpressionQuotations/Regressions.fs left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Fix FS0452: Handle non-null test IL pattern in quotation translator for empty string matching
Error: The process '/usr/bin/git' failed with exit code 128 |
The empty string pattern optimization (
.Length = 0instead of.Equals("")) introducedmkNonNullTestwhich emits[AI_ldnull; AI_cgt_un]IL. The quotation translator had no handler for this pattern, falling through to the inline-IL error.Changes
QuotationTranslator.fs: Handle[AI_ldnull; AI_cgt_un]by converting toarg <> nullviamkCallNotEqualsOperator, mirroring how[AI_ceq]is already handled viamkCallEqualsOperatorRegressions.fs: Add regression tests for empty string, mixed string, and non-empty string pattern matching in quotations, plus a runtime shape verification test