diff --git a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs index 94b8220be..be6af812c 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs @@ -333,8 +333,17 @@ namespace Cosmos.IL2CPU { var xParams = aMethod.GetParameters(); var xParamTypes = new Type[xParams.Length]; for (int i = 0; i < xParams.Length; i++) { + Queue(xParamTypes[i], aMethod, "Parameter"); xParamTypes[i] = xParams[i].ParameterType; } + // Queue Types directly related to method + if (!aIsPlug) { + // Don't queue declaring types of plugs + Queue(aMethod.DeclaringType, aMethod, "Declaring Type"); + } + if (aMethod is System.Reflection.MethodInfo) { + Queue(((System.Reflection.MethodInfo)aMethod).ReturnType, aMethod, "Return Type"); + } // We only need to look in ancestors and descendants if the method is virtual if (aMethod.IsVirtual) { @@ -408,18 +417,6 @@ namespace Cosmos.IL2CPU { } } } - - // Queue Types directly related to method - if (!aIsPlug) { - // Don't queue declaring types of plugs - Queue(aMethod.DeclaringType, aMethod, "Declaring Type"); - } - if (aMethod is System.Reflection.MethodInfo) { - Queue(((System.Reflection.MethodInfo)aMethod).ReturnType, aMethod, "Return Type"); - } - foreach (var xType in xParamTypes) { - Queue(xType, aMethod, "Parameter"); - } } }