From 6336509ee4259fcf194b284d14d0bf67aec7095a Mon Sep 17 00:00:00 2001 From: quyentho Date: Sun, 3 May 2026 17:59:25 +0700 Subject: [PATCH 1/2] Fix Array.exists2 XML doc examples to use equal-length arrays Both examples used arrays of different lengths (2 vs 3 elements), which would cause ArgumentException at runtime. The documented 'Evaluates to false/true' results were therefore incorrect. Fixed by using equal-length input arrays that produce the stated results: - inputs2 = [| 1; 3 |] with inputs1 = [| 1; 2 |] evaluates to false (neither 1>1 nor 2>3) - inputs2 = [| 1; 3 |] with inputs1 = [| 1; 4 |] evaluates to true (4>3) --- src/FSharp.Core/array.fsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharp.Core/array.fsi b/src/FSharp.Core/array.fsi index 503e3ee6900..9d5ae1c0742 100644 --- a/src/FSharp.Core/array.fsi +++ b/src/FSharp.Core/array.fsi @@ -840,7 +840,7 @@ module Array = /// /// /// let inputs1 = [| 1; 2 |] - /// let inputs2 = [| 1; 2; 0 |] + /// let inputs2 = [| 1; 3 |] /// /// (inputs1, inputs2) ||> Array.exists2 (fun a b -> a > b) /// @@ -850,7 +850,7 @@ module Array = /// /// /// let inputs1 = [| 1; 4 |] - /// let inputs2 = [| 1; 3; 5 |] + /// let inputs2 = [| 1; 3 |] /// /// (inputs1, inputs2) ||> Array.exists2 (fun a b -> a > b) /// From e0d996868ca7154e36280ddcb9ea7e2837a71471 Mon Sep 17 00:00:00 2001 From: quyentho Date: Sun, 3 May 2026 18:02:55 +0700 Subject: [PATCH 2/2] Add release notes for Array.exists2 doc fix Co-Authored-By: Claude Sonnet 4.6 --- docs/release-notes/.FSharp.Core/11.0.100.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/release-notes/.FSharp.Core/11.0.100.md diff --git a/docs/release-notes/.FSharp.Core/11.0.100.md b/docs/release-notes/.FSharp.Core/11.0.100.md new file mode 100644 index 00000000000..fae6ac213ef --- /dev/null +++ b/docs/release-notes/.FSharp.Core/11.0.100.md @@ -0,0 +1,3 @@ +### Fixed + +* Fix `Array.exists2` documentation examples to use equal-length arrays; the previous examples would throw `ArgumentException` at runtime instead of returning the documented `false`/`true` values. ([PR #19672](https://github.com/dotnet/fsharp/pull/19672))