ctch.hoisted_temp.Emit (ec);
else
ctch.li.Emit (ec);
+
+ if (!ctch.IsGeneral && ctch.type.Kind == MemberKind.TypeParameter)
+ ec.Emit (OpCodes.Box, ctch.type);
}
var expr_start = ec.DefineLabel ();
--- /dev/null
+using System;
+using System.IO;
+using System.Collections.Generic;
+
+class C
+{
+ static int Test<T> () where T : Exception
+ {
+ try {
+ throw null;
+ } catch (T t) if (t.Message != null) {
+ return 0;
+ }
+ }
+
+ static int Main()
+ {
+ try {
+ Test<ApplicationException> ();
+ return 1;
+ } catch {
+ }
+
+ if (Test<NullReferenceException> () != 0)
+ return 2;
+
+ return 0;
+ }
+}
\ No newline at end of file
</method>\r
</type>\r
</test>\r
+ <test name="test-ex-filter-06.cs">\r
+ <type name="C">\r
+ <method name="Int32 Test[T]()" attrs="145">\r
+ <size>61</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>49</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-externalias-01.cs">\r
<type name="Test">\r
<method name="Int32 Main()" attrs="150">\r