Skip to content

Fix ConcurrentDictionary test by rooting members accessed via reflection - #81957

Merged
stephentoub merged 1 commit into
dotnet:mainfrom
stephentoub:fixcdnativetest
Feb 10, 2023
Merged

Fix ConcurrentDictionary test by rooting members accessed via reflection#81957
stephentoub merged 1 commit into
dotnet:mainfrom
stephentoub:fixcdnativetest

Conversation

@stephentoub

Copy link
Copy Markdown
Member

Fixes #81945

@ghost ghost assigned stephentoub Feb 10, 2023
@ghost

ghost commented Feb 10, 2023

Copy link
Copy Markdown

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

Issue Details

Fixes #81945

Author: stephentoub
Assignees: -
Labels:

area-System.Collections

Milestone: -

@stephentoub

Copy link
Copy Markdown
Member Author

/azp list

@azure-pipelines

Copy link
Copy Markdown
CI/CD Pipelines for this repository:

@stephentoub

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@eiriktsarpalis

Copy link
Copy Markdown
Member

If CI is happy LGTM

@MichalStrehovsky

Copy link
Copy Markdown
Member

FWIW, this test would not require the RD.XML if the test replaced cd.GetType().GetField("_tables", BindingFlags.Instance | BindingFlags.NonPublic) and similar with typeof(ConcurrentDictionary<string, string>).GetField("_tables", BindingFlags.Instance | BindingFlags.NonPublic) (if they're equivalent - they might in this case?).

The reflection analysis only analyzes foo.GetType() if foo is sealed.

typeof(X).GetField("literal") works all the time.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

3 participants