After updating packages to .net7 in roslyn code generation project, has error RS1024 Use 'SymbolEqualityComparer' when comparing symbols for IEqualityComparer implementation of GetHashCode()
public int GetHashCode([DisallowNull] TypeSymbolMetaType? obj) => System.HashCode.Combine(obj.TypeSymbol);
How to fix HashCode.Combine using SymbolEqualityComparer
TypeSymbolMetaType? Can you show more of your code?public int GetHashCode([DisallowNull] TypeSymbolMetaType? obj) => SymbolEqualityComparer.Default.GetHashCode(obj.TypeSymbol);, as per docs with some rationale explained here.