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

Keyword 'override' gets changed to 'member' #2221

Closed
2 of 3 tasks
knocte opened this issue May 4, 2022 · 3 comments · Fixed by #2261
Closed
2 of 3 tasks

Keyword 'override' gets changed to 'member' #2221

knocte opened this issue May 4, 2022 · 3 comments · Fixed by #2261

Comments

@knocte
Copy link
Contributor

knocte commented May 4, 2022

Issue created from fantomas-online

Code

type StreamHelper() =
    inherit Stream()

    override x.ReadAsync (dst, offset, count, tok) = 
        ()
    override x.WriteAsync (dst, offset, count, tok) = 
        ()
    override x.Flush () = ()
    override x.Seek(offset:int64, origin:SeekOrigin) =
        ()
    override x.SetLength(value:int64) =
        ()
    override x.Read(dst, offset, count) = 
        ()           
    override x.Write(src, offset, count) = 
        ()
    override x.ReadByte() =
        ()
    override x.WriteByte item =
        ()
    override x.CanRead 
        with get() =
            true
    override x.CanSeek
        with get() =
            false
    override x.CanWrite
        with get() =
            true
    override x.Length
        with get() =
            1
    override x.Position
        with get() =
            1
        and set value =
            1
    override x.Dispose disposing =
        ()

Result

type StreamHelper() =
    inherit Stream()

    override x.ReadAsync(dst, offset, count, tok) = ()
    override x.WriteAsync(dst, offset, count, tok) = ()
    override x.Flush() = ()
    override x.Seek(offset: int64, origin: SeekOrigin) = ()
    override x.SetLength(value: int64) = ()
    override x.Read(dst, offset, count) = ()
    override x.Write(src, offset, count) = ()
    override x.ReadByte() = ()
    override x.WriteByte item = ()
    member x.CanRead = true
    member x.CanSeek = false
    member x.CanWrite = true
    member x.Length = 1

    override x.Position
        with get () = 1
        and set value = 1

    override x.Dispose disposing = ()

Problem description

Please describe here the Fantomas problem you encountered.
Check out our Contribution Guidelines.

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 branch at 2022-05-04T06:20:06Z - 0e036ac

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

@nojaf
Copy link
Contributor

nojaf commented May 4, 2022

Hello, thank you for bringing this up.
This will be tackled by dotnet/fsharp#12691.
In that PR we have the original keyword information.

@knocte
Copy link
Contributor Author

knocte commented May 4, 2022

In that PR we have the original keyword information.

That PR is already merged. Will fantomas 4.7.x have a fix for this at some point? Or we gotta wait for 5.0?

@nojaf
Copy link
Contributor

nojaf commented May 4, 2022

This will be a 5.0 change.
There are no plans to upgrade the FCS anymore in the 4.7 series.

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