Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use scopes to resolve array naming issue. #55451

Merged
merged 2 commits into from
Jul 13, 2021

Conversation

StephenMolloy
Copy link
Member

Use scopes to resolve array naming issue.

When generating IL code for serializing arrays, we use a
type-based but namespace agnostic naming scheme for
variables in the IL emitted. This can cause naming collisions
for arrays with similar type names that only differ in
namespace. An easy fix is to serialize each array in it's own
scope, so variable names won't conflict with other serialized
members.

Fixes #46196

@StephenMolloy StephenMolloy merged commit 1749deb into dotnet:main Jul 13, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 12, 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.

XmlSerializer constructor fails if type has array properties with same class name but different namespaces
3 participants