-
Notifications
You must be signed in to change notification settings - Fork 21
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
Make the single-line use of [<Literal>] consistent #409
Comments
Please resurrect this, I want this so bad 😢 |
Thanks for the ping. I'd like to relitigate this, since the closure was based on lack of vote count, which I don't really see as a valid reason to decline something. @dsyme thoughts? |
Edited the original submission for legibility/inline image expansion. |
This is already possible (or am I misunderstanding the suggestion?). let [<Literal>] Foo = "foo" |
@FunctionalFirst Correct, but it's a bit unexpected that it has to come after the Which is unexpected. |
Note there is similar problem currently with attributes on types: here I'm switching a I'm getting this before fixing it which is a bit misleading (attribute is valid on that language element): If it ends up being similar change for both and could be fixed, it would make the language a bit more lenient on those particular syntactic bits. edit: well, this makes me think, maybe it should work with a single preferred way (attribute next to the identifier I guess), and give a warning otherwise, instead of confusing / wrong error messages, this would be a more conservative approach. |
You mean #733? |
@Happypig375 correct! Also interesting, this comment from @dsyme regarding such changes in parser: #514 (comment) |
My understanding is this has been addressed as part of FS-1108, currently in preview https://github.com/fsharp/fslang-design/blob/main/preview/FS-1108-undentation-frenzy.md |
Ops, I'm late to the party. Again! On the same subject! Sorry if somebody is tired of me repeating this.
That's what I have been recommending on several occasions in various places, because it avoids code creep. By placing an attribute inside the language construct to which it applies, rather than somewhere outside (e.g. before on the same line), you considerably lessen the risk of the language construct and the attribute drifting away from each other, with all the bad consequences that can have. |
Make the single-line use of [] consistent [7090326]
Submitted by Don Syme on 2/13/2015 12:00:00 AM
6 votes on UserVoice prior to migration
See dotnet/fsharp#229
Some declaration constructs allow attributes on the same line as the keyword for the declaration, e.g.
However this doesn't work for "let" bindings, e.g.
Right now the consistent way to do things is always to use multiple lines, e.g.
The suggestion is to make this consistent by allowing single-line use everywhere, if that is technically possible.
Response
by fslang-admin on 2/5/2016 12:00:00 AM
Original UserVoice Submission
Archived Uservoice Comments
The text was updated successfully, but these errors were encountered: