Skip to content

Other FS000X Compiler Errors

Louis Kueh edited this page Jan 20, 2019 · 3 revisions

FS0003: This value is not a function and cannot be applied

No paranthesis when calling functions. This is because white space is the standard separator for function parameters.

let result = add (1 2)  //wrong
// error FS0003: This value is not a function and cannot be applied
let result = add 1 2    //correct

This can occur when passing too many arguments.

let add1 x = x + 1
let x = add1 2 3
// ==> error FS0003: This value is not a function and cannot be applied

The error message requires an understanding of how currying works in F# and how every function really only has 1 parameter.

FS0010: Unexpected identifier in binding

If the code is not align correctly F# throws an obscure error that there is an unexpected identifier in the binding. The error message does not relate well to the solution, which is to simply align the code.

let f = 
  let x=1     // offside line is at column 3 
   x+1 

FS0010: Incomplete structured construct

When calling a class missing a paranthesis can lead to this error

type Something() =
   let field = ()

let x1 = new Something     // Error FS0010 
let x2 = new Something()   // OK!

This also occurs if

  • there is no paranthesis around an operator (|+) 2
  • missing one side of an infix operator || false
  • sending namespace definition to F Sharp interactive e.g. namespace Customer

FS0020: This expression should have type ‘unit’

Clone this wiki locally