let call (f: string -> int) x = f x
let x = call _.Length ""
Expected behavior
Compiles.
Actual behavior
0>Program.fs(10,1): Error FS0010 : Incomplete structured construct at or before this point in expression
0>Program.fs(10,14): Error FS3571 : _. shorthand syntax for lambda functions can only be used with atomic expressions. That means expressions with no whitespace unless enclosed in parentheses.
Known workarounds
Enclose shorthand lambda in parentheses:
let x = call (_.Length) ""