Skip to content
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

Incorrect new array indexing formatting #1985

Closed
1 of 3 tasks
pbiggar opened this issue Nov 29, 2021 · 3 comments
Closed
1 of 3 tasks

Incorrect new array indexing formatting #1985

pbiggar opened this issue Nov 29, 2021 · 3 comments

Comments

@pbiggar
Copy link
Contributor

pbiggar commented Nov 29, 2021

Issue created from fantomas-online

Code

let segment = System.Uri(ctx.Request.Path.Value).Segments[1]

Result

let segment = System.Uri(ctx.Request.Path.Value).Segments [ 1 ]

Problem description

After formatting, there is a compiler error: "error FS3217: This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'"

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas 4.6 branch at 11/24/2021 18:43:36 - 9eb1365

Default Fantomas configuration

@nojaf
Copy link
Contributor

nojaf commented Nov 30, 2021

Thanks for this, good spot.
IndexWithoutDotExpr should be higher in the genExpr pattern match I believe.
Will check maybe later this week for this.

@nojaf
Copy link
Contributor

nojaf commented Jan 14, 2022

Fix available in 4.6

@nojaf nojaf closed this as completed Jan 14, 2022
@pbiggar
Copy link
Contributor Author

pbiggar commented Jan 16, 2022

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants