Skip to content

Fix XmlReader field name collision in DeserializationBenchmark#3473

Merged
cknaap merged 2 commits into
feature/3471-sourcenode-to-poconodefrom
copilot/sub-pr-3472
Mar 24, 2026
Merged

Fix XmlReader field name collision in DeserializationBenchmark#3473
cknaap merged 2 commits into
feature/3471-sourcenode-to-poconodefrom
copilot/sub-pr-3472

Conversation

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

internal XmlReader XmlReader field name collides with System.Xml.XmlReader type, causing XmlReader = XmlReader.Create(...) to fail compilation (compiler binds RHS XmlReader to the field, not the type).

Description

  • Removed the XmlReader class field from DeserializationBenchmarks
  • Replaced with a local using var _xmlReader = XmlReader.Create(...) inside XmlDictionaryDeserializer(), resolving the ambiguity and ensuring proper disposal per benchmark iteration
// Before (compile error)
internal XmlReader XmlReader;
XmlReader = XmlReader.Create(new StringReader(XmlData)); // RHS resolves to field, not type

// After
using var _xmlReader = XmlReader.Create(new StringReader(XmlData)); // unambiguous, disposed correctly

Related issues

Testing

Verified the Benchmarks project builds with 0 warnings and 0 errors.

FirelyTeam Checklist

  • Update the title of the PR to be succinct and less than 50 characters
  • Mark the PR with the label breaking change when this PR introduces breaking changes

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] [WIP] Address feedback on ISourceNode.ToPoco() implementation PR Fix XmlReader field name collision in DeserializationBenchmark Mar 24, 2026
Copilot AI requested a review from cknaap March 24, 2026 16:41
@cknaap cknaap marked this pull request as ready for review March 24, 2026 16:48
@cknaap cknaap merged commit 32bfcb7 into feature/3471-sourcenode-to-poconode Mar 24, 2026
0 of 2 checks passed
@cknaap cknaap deleted the copilot/sub-pr-3472 branch March 24, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants