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

Setter property with [<Erase>] should be erased #3948

Open
MangelMaxime opened this issue Oct 29, 2024 · 1 comment
Open

Setter property with [<Erase>] should be erased #3948

MangelMaxime opened this issue Oct 29, 2024 · 1 comment

Comments

@MangelMaxime
Copy link
Member

Description

While working on #3929, it seems like some cases have not been covered.

This code

[<Erase>]
type internal LanguageInjectionAttribute() =
    inherit Attribute()
    
    [<Erase>]
    member val Prefix = "" with get, set

does not generate the getter but does generate the setter function:

export function LanguageInjectionAttribute__set_Prefix_Z721C83C5(__, v) {
    __["Prefix@"] = v;
}

Repro code

Please provide the F# code to reproduce the problem or a link to the REPL.
Ideally, it should be possible to easily turn this code into a unit test.

Expected and actual results

Please provide the expected and actual results.

Related information

  • Fable version: dotnet fable --version
  • Operating system
@Karfroth
Copy link

Karfroth commented Nov 9, 2024

I was checking this problem a bit and probably this isn't a Fable problem but FSharp compiler issue.

When I ran the attached code in the example, FSharp compilation result did not add attribute to set_prefix while it does for get_prefix

Tested with dotnet 8.0.403 on the latest main branch.

image image

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

No branches or pull requests

2 participants