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

Soundness regression in 4.5.0-beta-001. Nested lambdas are stripped #1782

Closed
2 of 3 tasks
seanamos opened this issue Jun 21, 2021 · 1 comment · Fixed by #1783
Closed
2 of 3 tasks

Soundness regression in 4.5.0-beta-001. Nested lambdas are stripped #1782

seanamos opened this issue Jun 21, 2021 · 1 comment · Fixed by #1783

Comments

@seanamos
Copy link

Issue created from fantomas-online

Code

let x =
    fun _ ->
        fun _ -> "hello"

Result

let x = fun _ -> "hello"

Problem description

I noticed this with the latest shipped version of Ionide which includes 4.5.0-beta-001.
When a lambda is nested as in the above example, one of the lambdas will be removed by fantomas.
This obviously breaks the source code.

Extra information

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

Options

Fantomas Master at 06/12/2021 10:31:17 - 8f71594

Default Fantomas configuration

@nojaf
Copy link
Contributor

nojaf commented Jun 21, 2021

Hello Sean, thank you for reporting this issue.
I believe the problem lies in the change in the |Lambda|_| active pattern:
See

| SynExpr.Match (matchSeqPoint = NoDebugPointAtInvisibleBinding; clauses = [ Clause (_, expr, _) ])

It appears the processing of the parsedData is wrong somehow.

nojaf added a commit to nojaf/fantomas that referenced this issue Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants