Skip to content

Conversation

@steveharter
Copy link
Contributor

Addresses #58320

Expected to port to 6.0.

@ghost
Copy link

ghost commented Aug 30, 2021

Tagging subscribers to this area: @eiriktsarpalis, @layomia
See info in area-owners.md if you want to be subscribed.

Issue Details

Addresses #58320

Expected to port to 6.0.

Author: steveharter
Assignees: steveharter
Labels:

area-System.Text.Json

Milestone: 6.0.0


string getterNamedArg = memberMetadata.CanUseGetter
string getterNamedArg = memberMetadata.CanUseGetter &&
memberMetadata.DefaultIgnoreCondition != JsonIgnoreCondition.Always
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, how does the presence of ObsoleteAttribute influence the value of memberMetadata.DefaultIgnoreCondition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the issue this generated code is shown:

    getter: static (obj) => ((global::MyLibrary.Models.ClassA)obj).Foo,
    setter: static (obj, value) => ((global::MyLibrary.Models.ClassA)obj).Foo = value!,

Since the property Foo is used but obsolete it generates a compiler warning.

@steveharter steveharter merged commit 1dd8a59 into dotnet:main Sep 2, 2021
@steveharter steveharter deleted the IgnoredPropsSrcGen branch September 2, 2021 16:52
@steveharter
Copy link
Contributor Author

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2021

@ghost ghost locked as resolved and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants