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

Using a compiler directive copies the previous(?) line in fsi files #1186

Closed
3 tasks
vsinha opened this issue Oct 7, 2020 · 3 comments
Closed
3 tasks

Using a compiler directive copies the previous(?) line in fsi files #1186

vsinha opened this issue Oct 7, 2020 · 3 comments
Labels
bug (soundness) good first issue Long hanging fruit: easy issue to get your feet wet!

Comments

@vsinha
Copy link

vsinha commented Oct 7, 2020

Issue created from fantomas-online

Code

module Foo

type t
val x : int

#if DEBUG
val y : int
#endif

Result

module Foo

type t

val x: int

#if DEBUG
val y: int
#endif


val x: int

Problem description

The val x line is there twice!

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 Master at 10/02/2020 17:06:53 - 31305c2

Default Fantomas configuration

@knocte
Copy link
Contributor

knocte commented Sep 28, 2021

Is the testcase even F# code that can compile?

I guess you meant to write this instead:

module Foo =

    type t =
        val x : int

#if DEBUG
        val y : int
#endif

(Which compiles and doesn't yield any fantomas bug.)

@nojaf nojaf added the good first issue Long hanging fruit: easy issue to get your feet wet! label Jul 8, 2022
@nojaf
Copy link
Contributor

nojaf commented Jul 8, 2022

This no longer appears to be a problem.
A regression test could close this issue.

@knocte
Copy link
Contributor

knocte commented Jul 9, 2022

Is the testcase even F# code that can compile?

Didn't realize this was about fsi files, disregard my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (soundness) good first issue Long hanging fruit: easy issue to get your feet wet!
Projects
None yet
Development

No branches or pull requests

3 participants