Skip to content

Commit 7a5eaa9

Browse files
committed
Explicitly declare the type
1 parent 9cddc6e commit 7a5eaa9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/TypeSearch/TypeCandiateProvider/Unity_2023_2_OrNewer_TypeCandiateProvider.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,14 @@ private IEnumerable<Type> GetTypesWithGeneric (Type baseType)
4747

4848
result = new List<Type>();
4949

50-
//
51-
var isGenericBaseType = baseType.IsGenericType;
52-
var genericTypeDefinition = isGenericBaseType ? baseType.GetGenericTypeDefinition() : baseType;
53-
var targetTypeArguments = isGenericBaseType ? baseType.GetGenericArguments() : Type.EmptyTypes;
50+
bool isGenericBaseType = baseType.IsGenericType;
51+
Type genericTypeDefinition = isGenericBaseType ? baseType.GetGenericTypeDefinition() : baseType;
52+
Type[] targetTypeArguments = isGenericBaseType ? baseType.GetGenericArguments() : Type.EmptyTypes;
5453
IEnumerable<Type> types = TypeCache.GetTypesDerivedFrom(genericTypeDefinition);
5554
foreach (Type type in types)
5655
{
5756
// If the type is Generic, create a MakeGenericType from the Arguments of the baseType.
58-
var targetType = type.IsGenericType ? type.MakeGenericType(targetTypeArguments) : type;
57+
Type targetType = type.IsGenericType ? type.MakeGenericType(targetTypeArguments) : type;
5958

6059
if (!intrinsicTypePolicy.IsAllowed(targetType, targetType != type))
6160
{

0 commit comments

Comments
 (0)