Beef
Beef copied to clipboard
Issue casting delegate to another with same signature
using System;
class Program
{
public static void Main()
{
Event<delegate void(int)> ev = .();
//Event<delegate void(int id)> ev = .(); // replacing the line above with this works around the bug
void handler(int id){}
delegate void(int id) handlerDelegate = scope => handler;
ev.Add(handlerDelegate);
ev.Remove(handlerDelegate);
}
}
The test case above reproduces the issue. It seems like a bug that casting delegate void(int id) to delegate void(int) triggers a runtime error.