-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Fantomas shouldn't remove parens when using the dynamic operator (?) #369
Comments
Apparently there was another issue involving the dynamic operator #39, so hopefully this is doable 👍 Please let me know if you need other examples.
|
Thanks for reporting this. AST shows a sign of the dynamic operator so I believe this should be doable. App
(NonAtomic,false,
App
(NonAtomic,true,Ident op_Dynamic,Ident x,
tmp.fsx (1,19--1,21) IsSynthetic=false),
App
(NonAtomic,false,
App
(NonAtomic,true,Ident op_Addition,Ident k,
tmp.fsx (1,22--1,25) IsSynthetic=false),
Const (Int32 1,tmp.fsx (1,26--1,27) IsSynthetic=false), |
We probably should always do |
Hi @alfonsogarciacaro, we have an early access nuget feed since a couple of days. Would you mind testing it out and check if your problem is solved? It be great if someone else tries the nightly feed, just to be sure it works for other people (beside @jindraivanek and myself) as well. Then I would feel confident to announce it. |
Thanks for sending the instructions to install the nightly, I was a bit busy today, but I'll check as soon as possible 👍 |
I've tried the nightly from MyGet and can confirm the issue is fixed, thanks a lot! 👏 👏 |
I just applied Fantomas to a project with great results, thanks a lot for your work!
I found however a tricky issue that took me a while to find out. I had a piece of code like this:
After applying Fantomas, it became:
Note that parens are removed from
x?k
andy?k
. This is changing the meaning because in the first version the generated code isx[k]
while in the second isx.k
. Ideally Fantomas should distinguish when the dynamic operator is being applied and keep parens in that case.The text was updated successfully, but these errors were encountered: