Skip to content

Commit 93ce7b8

Browse files
committed
Fix regressions identified by failing tests
1 parent 980dcae commit 93ce7b8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ImmutableObjectGraph.Generation/CodeGen.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,15 @@ private static bool HasEqualityOperators(ITypeSymbol symbol)
219219
{
220220
Requires.NotNull(symbol, nameof(symbol));
221221

222-
// Reference types inherit their equality operators from System.Object.
223222
if (symbol.IsReferenceType)
224223
{
224+
// Reference types inherit their equality operators from System.Object.
225+
return true;
226+
}
227+
228+
if (symbol.SpecialType != SpecialType.None)
229+
{
230+
// C# knows how to run equality checks for special (built-in) types like int.
225231
return true;
226232
}
227233

0 commit comments

Comments
 (0)