Skip to content

Use GetBestTypeByMetadataName in 'use System.HashCode' fixer#59547

Merged
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi:hashCodeAccessiblew
Feb 15, 2022
Merged

Use GetBestTypeByMetadataName in 'use System.HashCode' fixer#59547
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi:hashCodeAccessiblew

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

Fixes #45995

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 14, 2022 21:13
@ghost ghost added the Area-IDE label Feb 14, 2022
var objectGetHashCodeMethod = objectType?.GetMembers(nameof(GetHashCode)).FirstOrDefault() as IMethodSymbol;
var equalityComparerType = compilation.GetTypeByMetadataName(typeof(EqualityComparer<>).FullName!);
var systemHashCodeType = compilation.GetTypeByMetadataName("System.HashCode");
var equalityComparerType = compilation.GetBestTypeByMetadataName(typeof(EqualityComparer<>).FullName!);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typeof(EqualityComparer<>).FullName! :(

@CyrusNajmabadi CyrusNajmabadi merged commit 752d799 into dotnet:main Feb 15, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the hashCodeAccessiblew branch February 15, 2022 02:14
@ghost ghost added this to the Next milestone Feb 15, 2022
@RikkiGibson RikkiGibson modified the milestones: Next, 17.2.P2 Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Generate GetHashCode()" is using System.HashCode when it's not available

3 participants