Skip to content

[release/6.0] Treat 'abstract' properties the same as 'virtual' for src-gen - #59771

Merged
danmoseley merged 2 commits into
release/6.0from
backport/pr-59707-to-release/6.0
Sep 30, 2021
Merged

[release/6.0] Treat 'abstract' properties the same as 'virtual' for src-gen#59771
danmoseley merged 2 commits into
release/6.0from
backport/pr-59707-to-release/6.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Sep 29, 2021

Copy link
Copy Markdown
Contributor

Backport of #59707 to release/6.0

/cc @steveharter

Customer Impact

Fixes an issue where an abstract property with a [JsonIgnore] attribute can cause the source generator to fail and not generate the code. If the base class is not owned by the customer, there is no work-around without this PR.

Testing

A new test was added that covers the failure case as well as other permuations.

Risk

Low; the change is specific to source-gen (does not affect the normal JSON serializer) and is a one-line change specific to initializing the metadata for a method.

@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-text-json
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #59707 to release/6.0

/cc @steveharter

Customer Impact

Testing

Risk

Author:github-actions[bot]
Assignees:-
Labels:

area-System.Text.Json

Milestone:-

@stevehartersteveharter self-assigned this Sep 29, 2021
@stevehartersteveharter added this to the 6.0.0 milestone Sep 29, 2021
@stevehartersteveharter added the Servicing-consider Issue for next servicing release review label Sep 29, 2021
@danmoseley

Copy link
Copy Markdown
Contributor

Very low risk change scoped to SG and fixing an issue reported by customer. Please send mail if you haven't already.

if (methodSymbol.IsAbstract)
{
attributes |= MethodAttributes.Abstract;
attributes |= MethodAttributes.Abstract | MethodAttributes.Virtual;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@stevehartersteveharter added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 29, 2021
@steveharter

Copy link
Copy Markdown
Contributor

Servicing approved via mail.

@danmoseley
danmoseley merged commit 8e2b607 into release/6.0Sep 30, 2021
@danmoseley
danmoseley deleted the backport/pr-59707-to-release/6.0 branch September 30, 2021 00:50
@ghostghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Text.JsonServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@danmoseley@steveharter@ericstj