mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Fix .NET adapter to not throw when fails to create a PSMethod due to ByRef-like type (#7788)
This commit is contained in:
1 parent
f90fa8afc1
commit
285e471034
2 files changed
+22
-10
No files matched your search
@@ -2691,18 +2691,18 @@ namespace System.Management.Automation
|
||||
return typeof(Func<PSNonBindableType>);
|
||||
}
|
||||
|
||||
var methodTypes = new Type[parameterInfos.Length + 1];
|
||||
for (int i = 0; i < parameterInfos.Length; i++)
|
||||
{
|
||||
var parameterInfo = parameterInfos[i];
|
||||
Type parameterType = parameterInfo.ParameterType;
|
||||
methodTypes[i] = GetPSMethodProjectedType(parameterType, parameterInfo.IsOut);
|
||||
}
|
||||
|
||||
methodTypes[parameterInfos.Length] = GetPSMethodProjectedType(methodInfo.ReturnType);
|
||||
|
||||
try
|
||||
{
|
||||
var methodTypes = new Type[parameterInfos.Length + 1];
|
||||
for (int i = 0; i < parameterInfos.Length; i++)
|
||||
{
|
||||
var parameterInfo = parameterInfos[i];
|
||||
Type parameterType = parameterInfo.ParameterType;
|
||||
methodTypes[i] = GetPSMethodProjectedType(parameterType, parameterInfo.IsOut);
|
||||
}
|
||||
|
||||
methodTypes[parameterInfos.Length] = GetPSMethodProjectedType(methodInfo.ReturnType);
|
||||
|
||||
return DelegateHelpers.MakeDelegate(methodTypes);
|
||||
}
|
||||
catch (TypeLoadException)
|
||||
|
||||
Reference in new issue
Block a user