Skip to content

Commit 8f880b7

Browse files
voroninpPavel Voronin
andauthored
Mention Seq.truncate in error message for Seq.take (#10622)
Co-authored-by: Pavel Voronin <[email protected]>
1 parent 4f11099 commit 8f880b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fsharp/FSharp.Core/seq.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,8 @@ namespace Microsoft.FSharp.Collections
686686
seq { use e = source.GetEnumerator()
687687
for x in count .. - 1 .. 1 do
688688
if not (e.MoveNext()) then
689-
invalidOpFmt "{0}: tried to take {1} {2} past the end of the seq"
690-
[|SR.GetString SR.notEnoughElements; x; (if x = 1 then "element" else "elements")|]
689+
invalidOpFmt "{0}: tried to take {1} {2} past the end of the seq. Use Seq.truncate to get {3} or less elements"
690+
[|SR.GetString SR.notEnoughElements; x; (if x = 1 then "element" else "elements"); count|]
691691
yield e.Current }
692692

693693
[<CompiledName("IsEmpty")>]

0 commit comments

Comments
 (0)