Skip to content

Conversation

@steveharter
Copy link
Contributor

Addresses #57349

Expected to be ported to 6.0.

@ghost
Copy link

ghost commented Aug 31, 2021

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

Issue Details

Addresses #57349

Expected to be ported to 6.0.

Author: steveharter
Assignees: steveharter
Labels:

area-System.Text.Json

Milestone: 6.0.0

return attributes;
}

// Copied from: https://github.com/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/CompilationExtensions.cs
Copy link
Member

Choose a reason for hiding this comment

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

would it make sense to segregate all the borrowed code into its own file ?

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW I believe the logging generator needs to use these methods as well, so we should move to a common location. cc @maryamariyan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. The second commit does this.

Comment on lines +490 to +498
byte[] referencedImage;
using (MemoryStream ms = new MemoryStream())
{
var emitResult = referencedCompilation.Emit(ms);
if (!emitResult.Success)
{
throw new InvalidOperationException();
}
referencedImage = ms.ToArray();
Copy link
Member

Choose a reason for hiding this comment

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

Very minor nit: this could have been a helper method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks; left as-is. Note there are other tests that have the same pattern.

@steveharter
Copy link
Contributor Author

Would prefer review from @sharwell before merging.

Copy link
Contributor

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

Assuming this was copied in and the new test fails prior to the code change, this LGTM

@steveharter steveharter merged commit 83f6621 into dotnet:main Sep 7, 2021
@steveharter steveharter deleted the RemoveGetTypeByMetadataName branch September 7, 2021 19:59
@steveharter
Copy link
Contributor Author

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2021

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1210809901

@ghost ghost locked as resolved and limited conversation to collaborators Oct 7, 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.

5 participants