How can F # report syntax and semantic errors at the same time?

Here is the F # code with syntax and semantic errors:

let a b = b b
let x = (if)

EDIT: F # for Vim reports an infinite type error and a syntax error, but fsceither fsistops only with a sytnax error.

enter image description here

How does F # for Vim report syntax and semantic error at the same time, while the F # compiler stops only with syntax error messages?

+4
source share
1 answer

The F # compiler (which is used by the Vim plugin under the cover) has an error recovery mechanism - this means that when it finds an expression that it cannot parse, it tries to fill it with something that will make it a valid F # expression.

let a = (if), , - let a = (if _ then _ else _) _ " ".

F #, IDE ( ), ..

"" , , , - , , , .

+5

All Articles