G
Guest
Hello. When I run the program below, I get the exception
System.InvalidProgramException: Common Language Runtime detected an invalid
program. (Visual Studio 2005 version 8.0.50727.51)
I can work around it (by having the delegate point to a helper function).
Basically the purpose of this post is to let someone at Microsoft know about
this bug.
(The generated IL looks OK to me; my guess is that there's a problem in the
verifier.)
namespace Test {
public class Program {
public static void Main() {
Func("hello");
}
private delegate void FuncDelegate<T>(T item);
private static void Func<T>(T item) {
FuncDelegate<T> temp=new FuncDelegate<T>(Func);
}
}
}
System.InvalidProgramException: Common Language Runtime detected an invalid
program. (Visual Studio 2005 version 8.0.50727.51)
I can work around it (by having the delegate point to a helper function).
Basically the purpose of this post is to let someone at Microsoft know about
this bug.
(The generated IL looks OK to me; my guess is that there's a problem in the
verifier.)
namespace Test {
public class Program {
public static void Main() {
Func("hello");
}
private delegate void FuncDelegate<T>(T item);
private static void Func<T>(T item) {
FuncDelegate<T> temp=new FuncDelegate<T>(Func);
}
}
}