Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

反射模版方法报错 #710

Closed
wuxiongbin opened this issue Jun 17, 2022 · 0 comments
Closed

反射模版方法报错 #710

wuxiongbin opened this issue Jun 17, 2022 · 0 comments

Comments

@wuxiongbin
Copy link

namespace TestCases
{
public class HotBehaviour
{
public T csObj { get; protected set; }
}

class XX : HotBehaviour<int>
{

}

public class YY
{
    public void a<T>(int a, T t)
    {

    }
}

class Test06
{
    public static void TestForEach()
    {
        YY yy = new YY();
        var method = typeof(YY).GetMethod("a");
    }
}

}

Test:TestCases.Test06.TestForEach
TestResult:Failed
Log:
未实现该方法或操作。
Local Variables:
YY yy = TestCases.YY, MethodInfo method = null

IL_0016: call System.Reflection.MethodInfo System.Type::GetMethod(System.String)
at TestCases.Test06.TestForEach() (at D:/Sources/ILRuntime/TestCases/Test06.cs:37)

System.NotImplementedException: 未实现该方法或操作。
在 ILRuntime.CLR.TypeSystem.ILGenericParameterType.get_ReflectionType() 位置 D:\Sources\ILRuntime\ILRuntime\CLR\TypeSystem\ILGenericParameterType.cs:行号 178
在 ILRuntime.Reflection.ILRuntimeParameterInfo..ctor(ParameterDefinition definition, IType type, MemberInfo member, AppDomain appdomain) 位置 D:\Sources\ILRuntime\ILRuntime\Reflection\ILRuntimeParameterInfo.cs:行号 28
在 ILRuntime.Reflection.ILRuntimeMethodInfo..ctor(ILMethod m) 位置 D:\Sources\ILRuntime\ILRuntime\Reflection\ILRuntimeMethodInfo.cs:行号 34
在 ILRuntime.CLR.Method.ILMethod.get_ReflectionMethodInfo() 位置 D:\Sources\ILRuntime\ILRuntime\CLR\Method\ILMethod.cs:行号 76
在 ILRuntime.Reflection.ILRuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) 位置 D:\Sources\ILRuntime\ILRuntime\Reflection\ILRuntimeType.cs:行号 562
在 System.Type.GetMethod(String name)
在 ILRuntime.Runtime.Generated.System_Type_Binding.GetMethod_2(ILIntepreter __intp, StackObject* __esp, IList`1 __mStack, CLRMethod __method, Boolean isNewObj) 位置 D:\Sources\ILRuntime\ILRuntimeTestBase\AutoGenerate\System_Type_Binding.cs:行号 135
在 ILRuntime.Runtime.Intepreter.ILIntepreter.Execute(ILMethod method, StackObject* esp, Boolean& unhandledException) 位置 D:\Sources\ILRuntime\ILRuntime\Runtime\Intepreter\ILIntepreter.cs:行号 2053

System.NotImplementedException: 未实现该方法或操作。
在 ILRuntime.CLR.TypeSystem.ILGenericParameterType.get_ReflectionType() 位置 D:\Sources\ILRuntime\ILRuntime\CLR\TypeSystem\ILGenericParameterType.cs:行号 178
在 ILRuntime.Reflection.ILRuntimeParameterInfo..ctor(ParameterDefinition definition, IType type, MemberInfo member, AppDomain appdomain) 位置 D:\Sources\ILRuntime\ILRuntime\Reflection\ILRuntimeParameterInfo.cs:行号 28
在 ILRuntime.Reflection.ILRuntimeMethodInfo..ctor(ILMethod m) 位置 D:\Sources\ILRuntime\ILRuntime\Reflection\ILRuntimeMethodInfo.cs:行号 34
在 ILRuntime.CLR.Method.ILMethod.get_ReflectionMethodInfo() 位置 D:\Sources\ILRuntime\ILRuntime\CLR\Method\ILMethod.cs:行号 76
在 ILRuntime.Reflection.ILRuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) 位置 D:\Sources\ILRuntime\ILRuntime\Reflection\ILRuntimeType.cs:行号 562
在 System.Type.GetMethod(String name)
在 ILRuntime.Runtime.Generated.System_Type_Binding.GetMethod_2(ILIntepreter __intp, StackObject* __esp, IList`1 __mStack, CLRMethod __method, Boolean isNewObj) 位置 D:\Sources\ILRuntime\ILRuntimeTestBase\AutoGenerate\System_Type_Binding.cs:行号 135
在 ILRuntime.Runtime.Intepreter.ILIntepreter.Execute(ILMethod method, StackObject* esp, Boolean& unhandledException) 位置 D:\Sources\ILRuntime\ILRuntime\Runtime\Intepreter\ILIntepreter.cs:行号 2053

=======================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant