Skip to content

Conversation

@bernd5
Copy link
Contributor

@bernd5 bernd5 commented Jun 23, 2025

Fixes #79098

Because of #nullable we see difference in the nullable annotation of type parameters...
For this check they should be ignored

@bernd5 bernd5 requested a review from a team as a code owner June 23, 2025 20:13
@dotnet-policy-service dotnet-policy-service bot added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Jun 23, 2025
@bernd5 bernd5 marked this pull request as draft June 23, 2025 20:21
@bernd5 bernd5 closed this Jun 23, 2025
@bernd5 bernd5 reopened this Jun 23, 2025
@bernd5 bernd5 marked this pull request as ready for review June 23, 2025 20:56
Use AllIgnoreOptions as suggested

// As mentioned above, we relax this restriction. The types must all be the same.

bool typesAreSame = TypeSymbol.Equals(signature.LeftType, signature.RightType, TypeCompareKind.ConsiderEverything2) && TypeSymbol.Equals(signature.LeftType, signature.ReturnType, TypeCompareKind.ConsiderEverything2);
Copy link
Member

Choose a reason for hiding this comment

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

Should those checks be relaxed as well?

@jcouv jcouv self-assigned this Sep 25, 2025
@AlekseyTs
Copy link
Contributor

@bernd5 Please adjust the title to accurately reflect the scope of the change. We wouldn't want to "ignore nullable annotations for reference types / type parameters" in every possible situation.

@AlekseyTs
Copy link
Contributor

Also, please resolve merge conflicts

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

Labels

Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#nullable enable causes unexpected compilation errors

3 participants