Repository navigation
Fix the Array.tryPick documentation example - #20794
Merged
Merged
Conversation
Remove the invalid integer comparison from the trypick-2 predicate.
Preserve its None result and the adjacent trypick-1 example unchanged.
Validation: extracted each actual XML example from src\FSharp.Core\array.fsi,
parsed it with System.Xml.XmlDocument, and piped its code plus a result
assertion into FSI using the sprint's Invoke-TryPickDocExample helper.
SDK: 10.0.113
FSI: C:\Program Files\dotnet\sdk\10.0.113\FSharp\fsi.dll
Exact invocation:
$script | dotnet $fsi --nologo --readline- 2>&1 | Out-String
RED before editing:
Invoke-TryPickDocExample 'trypick-2' 'None'
FSI exit 1; the strict expected-failure assertion passed:
stdin(4,49): error FS0001: This expression was expected to have type
'bool'
but here has type
'int'
GREEN after editing, rereading the actual source for each invocation:
Invoke-TryPickDocExample 'trypick-2' 'None'
FSI exit 0: trypick-2: None
Invoke-TryPickDocExample 'trypick-1' 'Some "2"'
FSI exit 0: trypick-1: Some "2"
Both example XML elements parsed successfully; git diff --check passed.
Original CRLF line endings preserved. Documentation-only validation;
no full build, new test infrastructure, or release-note change needed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
✅ Release-note check exemptedThe NO_RELEASE_NOTES label or localization-bot authorship exempts this pull request. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 20b10bf6-6a7c-483a-8d09-d521e7ddd73d
abonie
approved these changes
Oct 19, 2026
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.
Fixes #20780
Description
Correct the
Array.tryPickexample so it compiles and evaluates toNoneas documented.Checklist
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: