Repro steps
let bug =
[
1
(*comment*) 2
]
Expected behavior
This should create a list of two elements: [1; 2]
Actual behavior
Compiler interprets the inline comment as an attempted function application: "This value is not a function and cannot be applied."
Known workarounds
Add semicolon to end of line:
let bugFix =
[
1;
(*comment*) 2
]
Related information
Good catch. This shouldn't be the behavior.
It's not due to the comment. Comments are erased during lex-filter stage (aka indentation or offside rule checking) where 1 and 2 must have the same indentation and they are not, so it works according to the spec.
I see. You're right that I get the same behavior without the comment, so I guess this is working as intended.
That's why we need to improve that error message badly... Even more than https://github.com/dotnet/fsharp/pull/6820 does
Yes, in case the problem occurs on a linebreak, it should explain that it can be due to a problem with indentation alignment 鉁煣犫湪