From 03f7b62c103420737ae5811eb94cee39306a5703 Mon Sep 17 00:00:00 2001 From: disarray2077 <86157825+disarray2077@users.noreply.github.com> Date: Thu, 6 Oct 2022 12:04:49 -0300 Subject: [PATCH] Fix ConvertTo with TypedPrimitive parameter --- BeefLibs/corlib/src/Reflection/Convert.bf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BeefLibs/corlib/src/Reflection/Convert.bf b/BeefLibs/corlib/src/Reflection/Convert.bf index e8a2032c..4e9d6b16 100644 --- a/BeefLibs/corlib/src/Reflection/Convert.bf +++ b/BeefLibs/corlib/src/Reflection/Convert.bf @@ -106,7 +106,7 @@ namespace System.Reflection default: } - if (IntCanFit(intVal, type)) + if (IntCanFit(intVal, type.IsTypedPrimitive ? type.UnderlyingType : type)) { return Variant.Create(type, &intVal); } @@ -158,7 +158,7 @@ namespace System.Reflection default: } - if (IntCanFit(intVal, type)) + if (IntCanFit(intVal, type.IsTypedPrimitive ? type.UnderlyingType : type)) { return Variant.Create(type, &intVal); }