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

with get removal in FSI invalid #945

Closed
1 of 3 tasks
Smaug123 opened this issue Jul 2, 2020 · 3 comments · Fixed by #963
Closed
1 of 3 tasks

with get removal in FSI invalid #945

Smaug123 opened this issue Jul 2, 2020 · 3 comments · Fixed by #963

Comments

@Smaug123
Copy link
Contributor

Smaug123 commented Jul 2, 2020

Issue created from fantomas-online

Code

namespace B
type Foo =
    | Bar of int
    member Item : unit -> int with get

Result

namespace B

type Foo =
    | Bar of int

    member Item : unit -> int

Problem description

The implementation was

member this.Item
    with get () = 3

This implementation became invalid when the signature file's with get was removed.

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 06/30/2020 07:24:01 - dcc70c3

Name Value
IndentSpaceNum 4
PageWidth 120
SemicolonAtEndOfLine false
SpaceBeforeParameter true
SpaceBeforeLowercaseInvocation true
SpaceBeforeUppercaseInvocation true
SpaceBeforeClassConstructor true
SpaceBeforeMember true
SpaceBeforeColon true
SpaceAfterComma true
SpaceBeforeSemicolon true
SpaceAfterSemicolon true
IndentOnTryWith false
SpaceAroundDelimiter true
MaxIfThenElseShortWidth 40
MaxInfixOperatorExpression 50
MaxRecordWidth 40
MaxArrayOrListWidth 40
MaxValueBindingWidth 40
MaxFunctionBindingWidth 40
MultilineBlockBracketsOnSameColumn true
NewlineBetweenTypeDefinitionAndMembers true
KeepIfThenInSameLine true
MaxElmishWidth 40
SingleArgumentWebMode false
StrictMode false
@knocte
Copy link
Contributor

knocte commented Jul 3, 2020

what happens if you use fantomas on the implementation?

@Smaug123
Copy link
Contributor Author

Smaug123 commented Jul 3, 2020

To an extent it doesn't matter: Fantomas works file-by-file, and if I edit an fsi without correspondingly editing and formatting the fs, it may break. However, the answer is that Fantomas leaves the with get in the implementation, breaking the code.

@knocte
Copy link
Contributor

knocte commented Jul 3, 2020

You're right, but I'm really curious of how this issue overlaps with one I reported a while ago which in the end we dimmed as not an issue: #733

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

Successfully merging a pull request may close this issue.

2 participants