Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ let private partialFunctionIdentifiers =
("Seq.reduce", Function "Seq.fold")
("Seq.reduceBack", Function "Seq.foldBack")
("Seq.pick", Function "Seq.tryPick")
("Seq.cast", Function "Seq.choose tryUnbox")

// List
("List.exactlyOne", Function "List.tryExactlyOne")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ if foo.Head 1 then
Assert.IsTrue this.ErrorsExist
this.AssertErrorWithMessageExists("Consider using 'List.tryHead' instead of partial function/method 'List.Head'.")

[<Test>]
member this.``Error for Seq.cast``() =
this.Parse """
let foo = [ box "Hello"; box 42 ]
let bar = Seq.cast<string> foo
"""

Assert.IsTrue this.ErrorsExist
this.AssertErrorWithMessageExists("Consider using 'Seq.choose tryUnbox' instead of partial function/method 'Seq.cast'.")

[<Test>]
member this.``Regression found when parsing Console/Program_fs``() =
this.Parse """
Expand Down
Loading