fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Code attribute with literal constant demands parenthesis

Open BentTranberg opened this issue 7 years ago • 1 comments

A code attribute using a declared named literal constant demands a parenthesis in order to compile.

image

I actually have two issues with this.

  1. Why does it need parenthesis for the literal constant, when it does not for the literal string?

  2. The error messages do not explain what the real problem is, and it's really hard to understand considering the literal string thing works. I asked on Slack and was told by Phillip Carter how to fix this - with a parenthesis, as shown right above the failing line.

I suggest 1) fix the syntax or 2) improve error message(s).

Repro steps

Just paste in that piece of code, and try to compile.

Related information

.NET Core Console Application in VS 15.7.4.

Severity: Not a serious problem, just annoying.

BentTranberg avatar Jul 09 '18 08:07 BentTranberg

And this is from the real life situation I have. You can see there are even more bewildering messages. (edit: Ahem .. at least one more. The point is, it's not very consistent compared to the above post.)

image

BentTranberg avatar Jul 09 '18 08:07 BentTranberg