Просмотр исходного кода

Merge pull request #1732 from disarray2077/patch-5

Fix ConvertTo with TypedPrimitive parameter
Brian Fiete 2 лет назад
Родитель
Сommit
d37c515644
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      BeefLibs/corlib/src/Reflection/Convert.bf

+ 2 - 2
BeefLibs/corlib/src/Reflection/Convert.bf

@@ -106,7 +106,7 @@ namespace System.Reflection
 					default:
 					default:
 					}
 					}
 
 
-					if (IntCanFit(intVal, type))
+					if (IntCanFit(intVal, type.IsTypedPrimitive ? type.UnderlyingType : type))
 					{
 					{
 						return Variant.Create(type, &intVal);
 						return Variant.Create(type, &intVal);
 					}
 					}
@@ -158,7 +158,7 @@ namespace System.Reflection
 					default:
 					default:
 					}
 					}
 
 
-					if (IntCanFit(intVal, type))
+					if (IntCanFit(intVal, type.IsTypedPrimitive ? type.UnderlyingType : type))
 					{
 					{
 						return Variant.Create(type, &intVal);
 						return Variant.Create(type, &intVal);
 					}
 					}