Skip to content

Obsolete attribute is ignored in constructor property assignment #11868

@NinoFloris

Description

@NinoFloris

Given code like

    System.Text.Json.JsonSerializerOptions(
                    JsonSerializerDefaults.Web,
                    IgnoreNullValues = true)

IgnoreNullValues is obsolete but does not trigger a warning.

Writing System.Text.Json.JsonSerializerOptions().IgnoreNullValues does properly warn.

Metadata

Metadata

Assignees

Labels

Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.good first issuehelp wanted

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions