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

Fantomas deletes attributes from getters #3114

Closed
1 of 4 tasks
nneeoo opened this issue Sep 4, 2024 · 1 comment · Fixed by #3115
Closed
1 of 4 tasks

Fantomas deletes attributes from getters #3114

nneeoo opened this issue Sep 4, 2024 · 1 comment · Fixed by #3115

Comments

@nneeoo
Copy link

nneeoo commented Sep 4, 2024

Issue created from fantomas-online

Code

[<Erase>]
type Object3D() =
    let mutable _position: Vector3 = null

    member this.position
        with [<Emit("$0.position")>] set v = _position <- v 
        and [<Emit("$0.position = $1")>] get () = _position
    

[<Erase>]
type Object4D() =
    let mutable _position: Vector3 = null

    member this.position
        with [<Emit("$0.position")>] get () = _position 
        and [<Emit("$0.position = $1")>] set v = _position <- v 
    

Result

[<Erase>]
type Object3D() =
    let mutable _position: Vector3 = null

    [<Emit("$0.position = $1")>]
    member this.position
        with set v = _position <- v
        and get () = _position


[<Erase>]
type Object4D() =
    let mutable _position: Vector3 = null

    [<Emit("$0.position")>]
    member this.position
        with get () = _position
        and set v = _position <- v

Problem description

Fantomas removes attributes from getter if attributes was set for getter and setter.

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.
  • I would like a release if this problem is solved.

Options

Fantomas main branch at 2024-08-19T07:30:39Z - a4788cb

Default Fantomas configuration

@nneeoo nneeoo changed the title Fantomas deletes attributes from gette Fantomas deletes attributes from getters Sep 4, 2024
@nojaf
Copy link
Contributor

nojaf commented Sep 5, 2024

Thanks for reporting this via the online tool!
I believe I have a fix for this in #3115

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