Skip to content

Commit ecc56a5

Browse files
xperiandriclaude
andcommitted
refactor: name the resource of each text in ErrorStrings and drop the one that has none
Every constant of the module copies one string resource of FSharp.Core (FSCore.resx) or of the .NET libraries, and the comment of each constant now names the resource: the key in FSCore.resx, or the key in System.Private.CoreLib. All texts but one were found in the resource tables of the assemblies (FSharp.Core 10.1, System.Private.CoreLib 10.0, System.Collections.Immutable 10.0) by comparing the strings. `ListsHaveDifferentLengths` ("The lists have different lengths.") is in none of them: it was the text of the modules written before ADR 0001, and no code uses it any more, so it is removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 48c2b10 commit ecc56a5

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

‎src/FSharp.Collections.Immutable/Helper/ErrorStrings.fs‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,68 @@
44
/// <remarks>
55
/// The modules throw what the FSharp.Core function that they mirror throws (ADR 0001, D6). FSharp.Core keeps its resources
66
/// internal, so the texts are copied. The texts of the .NET libraries are for the functions that report a BCL exception
7-
/// under the name of their own parameter.
7+
/// under the name of their own parameter. Each constant is the text of one resource and its comment names the resource,
8+
/// so a text that no resource of FSharp.Core or of the .NET libraries holds does not belong here.
89
/// </remarks>
910
module internal FSharp.Collections.Immutable.ErrorStrings
1011

12+
/// FSCore.resx, arraysHadDifferentLengths.
1113
[<Literal>]
1214
let ArraysHadDifferentLengths = "The arrays have different lengths."
1315

16+
/// FSCore.resx, indexOutOfBounds.
1417
[<Literal>]
1518
let IndexOutOfBounds = "The index was outside the range of elements in the list."
1619

20+
/// FSCore.resx, arrayWasEmpty.
1721
[<Literal>]
1822
let InputArrayEmpty = "The input array was empty."
1923

24+
/// FSCore.resx, inputListWasEmpty.
2025
[<Literal>]
2126
let InputListWasEmpty = "The input list was empty."
2227

28+
/// FSCore.resx, inputMustBeNonNegative.
2329
[<Literal>]
2430
let InputMustBeNonNegative = "The input must be non-negative."
2531

32+
/// FSCore.resx, inputMustBePositive.
2633
[<Literal>]
2734
let InputMustBePositive = "The input must be positive."
2835

36+
/// FSCore.resx, inputSequenceEmpty.
2937
[<Literal>]
3038
let InputSequenceEmpty = "The input sequence was empty."
3139

40+
/// FSCore.resx, inputSequenceTooLong.
3241
[<Literal>]
3342
let InputSequenceTooLong = "The input sequence contains more than one element."
3443

44+
/// FSCore.resx, keyNotFound.
3545
[<Literal>]
3646
let KeyNotFound = "The item, key, or index was not found in the collection."
3747

48+
/// FSCore.resx, keyNotFoundAlt.
3849
[<Literal>]
3950
let KeyNotFoundAlt = "An index satisfying the predicate was not found in the collection."
4051

52+
/// FSCore.resx, listsHadDifferentLengths.
4153
[<Literal>]
4254
let ListsHadDifferentLengths = "The lists had different lengths."
4355

44-
/// The message of the modules written before ADR 0001.
45-
[<Literal>]
46-
let ListsHaveDifferentLengths = "The lists have different lengths."
47-
48-
/// The message of the .NET libraries for a negative argument, as `Array.BinarySearch` reports it.
56+
/// System.Private.CoreLib, ArgumentOutOfRange_NeedNonNegNum: the message of the .NET libraries for a negative argument, as
57+
/// `Array.BinarySearch` reports it.
4958
[<Literal>]
5059
let NeedNonNegativeNumber = "Non-negative number required."
5160

61+
/// FSCore.resx, notAPermutation.
5262
[<Literal>]
5363
let NotAPermutation = "The function did not compute a permutation."
5464

65+
/// FSCore.resx, notEnoughElements.
5566
[<Literal>]
5667
let NotEnoughElements = "The input sequence has an insufficient number of elements."
5768

69+
/// FSCore.resx, outOfRange.
5870
[<Literal>]
5971
let OutOfRange = "The index is outside the legal range."

0 commit comments

Comments
 (0)