using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
class Stuff<T>
{}
public class Foo
{
public static void Throw<TException, UException>()
where TException : UException, new()
where UException : TException
{
try
{
throw new TException();
}
catch(System.Object ex)
{
Equals(null, null);
}
catch(UException tex)
{
}
}
}
class Program
{
static void Main()
{
Foo.Throw<Exception, Exception>();
}
}
Simply copy-paste the following code in code editor:
class Foo { static void Throw<TException, UException>() where TException : UException where UException : TException { try { } catch(UException ex) { } } }VS2005 will crash.