Header menu logo ionide-analyzers

IgnoreFunctionAnalyzer

Problem

See dotnet/fsharp#15880, it can be confusing when a function is ignored when the user expects it to be evaluated.

let f g () = g + 1
let a = f 1
// `a` was not evaluated and is ignored as function
// instead of the result being ignored.  
ignore a

Fix

Ensure the function is being executed:

ignore (a())
val f: g: int -> unit -> int
val g: int
val a: (unit -> int)
val ignore: value: 'T -> unit

Type something to start searching.