Skip to content

[release/7.0] Fixes a null ref which happens when an XML comment cref contains generic instantiation#3020

Merged
vitek-karas merged 2 commits intodotnet:release/7.0from
vitek-karas:FixNullRefCRef7
Sep 2, 2022
Merged

[release/7.0] Fixes a null ref which happens when an XML comment cref contains generic instantiation#3020
vitek-karas merged 2 commits intodotnet:release/7.0from
vitek-karas:FixNullRefCRef7

Conversation

@vitek-karas
Copy link
Member

In the cref some of the symbols (for example the type argument) are missing containing symbols, which leads to null refs.

In any case, we should not perform any analysis on symbols inside crefs, only on real code.

So this modifies the analyzer to ignore any symbol inside a cref.

Adds a test to validate this.

Backport of #3015 to 70

…ric instantiation (dotnet#3015)

* Fixes a null ref which happens when an XML comment cref contains generic instantiation

In the cref some of the symbols (for example the type argument) are missing containing symbols, which leads to null refs.

In any case, we should not perform any analysis on symbols inside crefs, only on real code.

So this modifies the analyzer to ignore any symbol inside a cref.

Adds a test to validate this.

* Simplify the test
@sbomer sbomer requested a review from jeffschwMSFT September 1, 2022 21:01
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants