-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot specify Literal attribute in signature file #7897
Comments
Please also note the corrupted line separators, previously reported in #4516. |
I've known about this for a while but I never created an issue, which I should have. Thank you a lot for making the issue. This is actually very annoying because there are a lot of places where |
After looking at the parser, the issue might be related to light status. Funny enough, if I turn light syntax "off", it will work: module Thingo
#light "off"
[<Literal>]
val hello : string = "world"
val x : int |
The generation is incorrect, that's a bug as well. The signature should be: [<Literal>]
val id : string = "some string` |
If you then use the generator-apporach, you'd end up with two places where the literal is defined and assigned a value. That looks like a problem waiting to happen, or will the compiler know & check that the constants are equal? |
It's part of the design and compiler will know about it; if the values are different, the compiler will error. From FSharpSpec 4.1 - 11.2.1 Signature Conformance for Functions and Values
|
Fixed in #7901, thanks! |
Related StackOverflow topic:
https://stackoverflow.com/questions/48212721/unable-to-use-the-literal-attribute-in-an-f-signature-file-fsi
The text was updated successfully, but these errors were encountered: