From 0849c48f7100884aede5795d92b8c17541634646 Mon Sep 17 00:00:00 2001 From: Alecio Furanze Date: Fri, 31 May 2024 02:40:39 +0200 Subject: [PATCH] Update PrimitiveExtension.cs --- src/src/extension/PrimitiveExtension.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/src/extension/PrimitiveExtension.cs b/src/src/extension/PrimitiveExtension.cs index c6acf2c..b008360 100644 --- a/src/src/extension/PrimitiveExtension.cs +++ b/src/src/extension/PrimitiveExtension.cs @@ -210,6 +210,10 @@ internal static (object Value, bool IsError) FromPrimitive(Type type, Primitive { value = primitive.Get.List(type); } + else if (type.IsValueType && !type.IsEnum && !type.IsPrimitive) + { + value = primitive.Get.Struct(type); + } else if (type.IsArray) { value = primitive.Get.Array(type); @@ -218,10 +222,6 @@ internal static (object Value, bool IsError) FromPrimitive(Type type, Primitive { value = primitive.Get.Class(type); } - else if (type.IsValueType && !type.IsEnum && !type.IsPrimitive) - { - value = primitive.Get.Struct(type); - } if (primitive.IsValid) return (value, value == null);