You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;
using System.Reflection.Emit;
internal class Program
{
public static int Main()
{
var methodBuilder = new DynamicMethod("test", typeof(void), new Type[0], typeof(Program).Module);
Delegate.CreateDelegate(typeof(Action), methodBuilder);
return 0;
}
}
Current Behavior
Crash!!!
Expected Behavior
.NET gives:
Unhandled Exception: System.ArgumentException: MethodInfo must be a RuntimeMethodInfo.
Parameter name: method
at System.Delegate.CreateDelegate(Type type, MethodInfo method, Boolean throwOnBindFailure)
at Program.Main()
On which platforms did you notice this
[ ] macOS
[ ] Linux
[ ] Windows
Version Used:
Mono JIT compiler version 5.11.0 (Visual Studio built mono)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: normal
Notification: Thread + polling
Architecture: x86
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
Stacktrace
mono.dll!mono_method_signature(_MonoMethod * m) Line 2165 C
> mono.dll!ves_icall_System_Delegate_CreateDelegate_internal(_MonoReflectionType * type, MonoObject * target, _MonoReflectionMethod * info, unsigned char throwOnBindFailure) Line 5686 C
The text was updated successfully, but these errors were encountered:
Steps to Reproduce
Current Behavior
Crash!!!
Expected Behavior
.NET gives:
On which platforms did you notice this
[ ] macOS
[ ] Linux
[ ] Windows
Version Used:
Stacktrace
The text was updated successfully, but these errors were encountered: