Skip to content

Commit 79e9aad

Browse files
committed
CLSCompliantAttribute的方法(比如public static String String.Concat(params object[] args))调用System.Reflection.Emit.DynamicMethodTokenGenerator.GetToken会报错:InvalidOperationException: Operation is not valid due to the current state of the object.过滤掉
1 parent 6f340b0 commit 79e9aad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

unity/Assets/core/upm/Runtime/Src/PInvoke/TypeRegister.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ public int Register(Type type)
219219
{
220220
if (methodInfo.IsGenericMethodDefinition) continue;
221221
if (methodInfo.GetParameters().Any(pi => parameterTypeNotAcceptable(pi.ParameterType)) || returnTypeNotAcceptable(methodInfo.ReturnType)) continue;
222+
if (methodInfo.IsDefined(typeof(CLSCompliantAttribute), false)) continue;
222223

223224
string methodName = methodInfo.Name;
224225

0 commit comments

Comments
 (0)