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

Obsolete attribute error is not taken into account in prop setters that can be included in methods which are not constructors #16952

Closed
edgarfgp opened this issue Mar 26, 2024 · 1 comment
Assignees
Labels
Area-Compiler-Checking Type checking, attributes and all aspects of logic checking Bug help wanted Needs-Triage
Milestone

Comments

@edgarfgp
Copy link
Contributor

edgarfgp commented Mar 26, 2024

Repro steps

Provide the steps required to reproduce the problem:

Relevant comment: #11868 (comment)

open System

type JsonSerializerOptions() =
    [<Obsolete("This is bad")>]
    member val DefaultOptions = false with get, set
    member val UseCustomOptions = false with get, set
    member this.With() = this
    
let options = JsonSerializerOptions()
let options2 =
    options
        .With(DefaultOptions = true)
        .With(UseCustomOptions = false)

Expected behavior

(Warning 44, Line 14, Col 77, Line 14, Col 91, "This construct is deprecated. This is bad")

Actual behavior

No warning /error

@edgarfgp
Copy link
Contributor Author

edgarfgp commented Apr 2, 2024

Cosed by #16900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compiler-Checking Type checking, attributes and all aspects of logic checking Bug help wanted Needs-Triage
Projects
Archived in project
Development

No branches or pull requests

1 participant