diff --git a/sources/TileDB.CSharp/FragmentInfo.cs b/sources/TileDB.CSharp/FragmentInfo.cs index 57a8fb3c..aba0faf0 100644 --- a/sources/TileDB.CSharp/FragmentInfo.cs +++ b/sources/TileDB.CSharp/FragmentInfo.cs @@ -411,13 +411,13 @@ public ulong GetMinimumBoundedRectangleCount(uint fragmentIndex) DataType dataType = GetDimensionType(fragmentIndex, dimensionIndex); if (RuntimeHelpers.IsReferenceOrContainsReferences()) { - if (typeof(T) == typeof(string)) + if (typeof(T) == typeof(string) && EnumUtil.IsStringType(dataType)) { (string startStr, string endStr) = GetStringMinimumBoundedRectangle(fragmentIndex, minimumBoundedRectangleIndex, dimensionIndex, dataType); return ((T)(object)startStr, (T)(object)endStr); } - ThrowHelpers.ThrowTypeNotSupported(); + ThrowHelpers.ThrowTypeMismatch(dataType); return default; } ValidateDomainType(dataType); @@ -450,13 +450,13 @@ public ulong GetMinimumBoundedRectangleCount(uint fragmentIndex) DataType dataType = GetDimensionType(fragmentIndex, dimensionName); if (RuntimeHelpers.IsReferenceOrContainsReferences()) { - if (typeof(T) == typeof(string)) + if (typeof(T) == typeof(string) && EnumUtil.IsStringType(dataType)) { (string startStr, string endStr) = GetStringMinimumBoundedRectangle(fragmentIndex, minimumBoundedRectangleIndex, dimensionName, dataType); return ((T)(object)startStr, (T)(object)endStr); } - ThrowHelpers.ThrowTypeNotSupported(); + ThrowHelpers.ThrowTypeMismatch(dataType); return default; } ValidateDomainType(dataType); @@ -536,12 +536,12 @@ public ulong GetMinimumBoundedRectangleCount(uint fragmentIndex) DataType dataType = GetDimensionType(fragmentIndex, dimensionIndex); if (RuntimeHelpers.IsReferenceOrContainsReferences()) { - if (typeof(T) == typeof(string)) + if (typeof(T) == typeof(string) && EnumUtil.IsStringType(dataType)) { (string startStr, string endStr) = GetStringNonEmptyDomain(fragmentIndex, dimensionIndex, dataType); return ((T)(object)startStr, (T)(object)endStr); } - ThrowHelpers.ThrowTypeNotSupported(); + ThrowHelpers.ThrowTypeMismatch(dataType); return default; } ValidateDomainType(dataType); @@ -574,12 +574,12 @@ public ulong GetMinimumBoundedRectangleCount(uint fragmentIndex) DataType dataType = GetDimensionType(fragmentIndex, dimensionName); if (RuntimeHelpers.IsReferenceOrContainsReferences()) { - if (typeof(T) == typeof(string)) + if (typeof(T) == typeof(string) && EnumUtil.IsStringType(dataType)) { (string startStr, string endStr) = GetStringNonEmptyDomain(fragmentIndex, dimensionName, dataType); return ((T)(object)startStr, (T)(object)endStr); } - ThrowHelpers.ThrowTypeNotSupported(); + ThrowHelpers.ThrowTypeMismatch(dataType); return default; } ValidateDomainType(dataType);