Skip to content

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

@edgarfgp

Description

@edgarfgp

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions