From 82b415711f7fa01905b607b1dc275434a7837b9b Mon Sep 17 00:00:00 2001 From: Copilot Date: Fri, 16 Oct 2026 13:21:45 +0200 Subject: [PATCH 1/3] Fix Array.tryPick documentation example (#20780) 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> --- src/FSharp.Core/array.fsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FSharp.Core/array.fsi b/src/FSharp.Core/array.fsi index 0f10ff5c147..0f8c36dc232 100644 --- a/src/FSharp.Core/array.fsi +++ b/src/FSharp.Core/array.fsi @@ -469,7 +469,7 @@ module Array = /// /// let input = [| 1; 2; 3 |] /// - /// input |> Array.tryPick (fun n -> if n > 3 = 0 then Some (string n) else None) + /// input |> Array.tryPick (fun n -> if n > 3 then Some (string n) else None) /// /// Evaluates to None. /// From d1050b3144cc1447dade792be4e2c85bdefe36da Mon Sep 17 00:00:00 2001 From: Copilot Date: Fri, 16 Oct 2026 14:28:48 +0200 Subject: [PATCH 2/3] Add release notes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/release-notes/.FSharp.Core/11.0.200.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release-notes/.FSharp.Core/11.0.200.md b/docs/release-notes/.FSharp.Core/11.0.200.md index 3948a0f42b4..e57a1f3c98c 100644 --- a/docs/release-notes/.FSharp.Core/11.0.200.md +++ b/docs/release-notes/.FSharp.Core/11.0.200.md @@ -2,4 +2,6 @@ ### Fixed +* Correct the `Array.tryPick` documentation example so it compiles and evaluates to `None`. ([Issue #20780](https://github.com/dotnet/fsharp/issues/20780), [PR #20794](https://github.com/dotnet/fsharp/pull/20794)) + ### Changed From d51dcb95c68da5636be914aa6cfa458f22c719b9 Mon Sep 17 00:00:00 2001 From: Copilot Date: Fri, 16 Oct 2026 19:43:28 +0200 Subject: [PATCH 3/3] Keep Array.tryPick fix documentation-only Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 20b10bf6-6a7c-483a-8d09-d521e7ddd73d --- docs/release-notes/.FSharp.Core/11.0.200.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/release-notes/.FSharp.Core/11.0.200.md b/docs/release-notes/.FSharp.Core/11.0.200.md index e57a1f3c98c..3948a0f42b4 100644 --- a/docs/release-notes/.FSharp.Core/11.0.200.md +++ b/docs/release-notes/.FSharp.Core/11.0.200.md @@ -2,6 +2,4 @@ ### Fixed -* Correct the `Array.tryPick` documentation example so it compiles and evaluates to `None`. ([Issue #20780](https://github.com/dotnet/fsharp/issues/20780), [PR #20794](https://github.com/dotnet/fsharp/pull/20794)) - ### Changed