Skip to content

Conversation

@cston
Copy link
Contributor

@cston cston commented Aug 5, 2022

@ghost ghost added the area-System.Text.Json label Aug 5, 2022
@ghost ghost assigned cston Aug 5, 2022
@ghost
Copy link

ghost commented Aug 5, 2022

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

Issue Details

See dotnet/roslyn#62886.

Author: cston
Assignees: -
Labels:

area-System.Text.Json

Milestone: -

@cston cston force-pushed the more-ref-fields branch from 35336d2 to 41c373f Compare August 5, 2022 16:03
@stephentoub
Copy link
Member

stephentoub commented Aug 5, 2022

Are all of these changes necessary in order to successfully compile? If yes, this seems like a fairly significant breaking change, no? Or are these changes only necessary because of related places we're already using scoped?

@cston
Copy link
Contributor Author

cston commented Aug 5, 2022

Are all of these changes necessary in order to successfully compile?

Yes, these are changes needed to compile successfully. These are typically methods that have a ref parameter and another ref parameter of a ref struct type.

internal override bool CanHaveMetadata => false;

protected override void Add(in TElement value, ref ReadStack state)
protected override void Add(in TElement value, scoped ref ReadStack state)
Copy link
Member

Choose a reason for hiding this comment

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

Why is scoped required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Other than the comments questioning why certain categories of changes are needed, LGTM.

where TCollection : ConcurrentQueue<TElement>
{
protected override void Add(in TElement value, ref ReadStack state)
protected override void Add(in TElement value, scoped ref ReadStack state)
Copy link
Member

Choose a reason for hiding this comment

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

Why is scoped required here?

where TKey : notnull
{
protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state)
protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state)
Copy link
Member

Choose a reason for hiding this comment

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

Why is scoped needed here?

private readonly bool _isDeserializable = typeof(TCollection).IsAssignableFrom(typeof(List<object?>));

protected override void Add(in object? value, ref ReadStack state)
protected override void Add(in object? value, scoped ref ReadStack state)
Copy link
Member

Choose a reason for hiding this comment

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

Why is scoped needed here?

private readonly bool _isDeserializable = typeof(TCollection).IsAssignableFrom(typeof(List<TElement>));

protected override void Add(in TElement value, ref ReadStack state)
protected override void Add(in TElement value, scoped ref ReadStack state)
Copy link
Member

Choose a reason for hiding this comment

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

Why is scoped needed here?

where TCollection : ConcurrentStack<TElement>
{
protected override void Add(in TElement value, ref ReadStack state)
protected override void Add(in TElement value, scoped ref ReadStack state)
Copy link
Member

Choose a reason for hiding this comment

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

Why is scoped needed here?

@cston cston marked this pull request as ready for review August 11, 2022 18:17
@cston cston removed the blocked Issue/PR is blocked on something - see comments label Aug 11, 2022
@AaronRobinsonMSFT
Copy link
Member

I don't see any failures in the arm64 test. Looks like an infrastructure issue.

[15:05:31.5263400] 2022-08-12 15:05:31.506 System.Runtime.Tests[16226:178107346] Tests run: 49815 Passed: 49582 Inconclusive: 0 Failed: 0 Ignored: 137 Skipped: 96

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 339a6bc into dotnet:main Aug 13, 2022
@cston cston deleted the more-ref-fields branch August 13, 2022 03:10
@ghost ghost locked as resolved and limited conversation to collaborators Sep 12, 2022
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.

4 participants