diff --git a/src/Riok.Mapperly/Descriptors/Enumerables/CollectionInfoBuilder.cs b/src/Riok.Mapperly/Descriptors/Enumerables/CollectionInfoBuilder.cs index ddd8c695b4..14b2dcffcf 100644 --- a/src/Riok.Mapperly/Descriptors/Enumerables/CollectionInfoBuilder.cs +++ b/src/Riok.Mapperly/Descriptors/Enumerables/CollectionInfoBuilder.cs @@ -176,13 +176,10 @@ or CollectionType.ReadOnlyMemory if (typeInfo is not CollectionType.None) return "Count"; - var intType = types.Get(); var member = symbolAccessor .GetAllAccessibleMappableMembers(t) .FirstOrDefault( - x => - x.Name is nameof(ICollection.Count) or nameof(Array.Length) - && SymbolEqualityComparer.IncludeNullability.Equals(intType, x.Type) + x => x.Type.SpecialType == SpecialType.System_Int32 && x.Name is nameof(ICollection.Count) or nameof(Array.Length) ); return member?.Name; }