}
}
+class Foo<T1, T2> {
+
+ public void Throw () {
+ throw new Exception ();
+ }
+
+ public void Throw<T3> () {
+ throw new Exception ();
+ }
+}
+
+class Bar<T> : Foo<object, T> {
+}
+
public class main {
public static void callCallStaticCrash<T> () {
Gen<T> gt = new Gen<T> ();
for (int i = 0; i < st.FrameCount; ++i) {
StackFrame sf = st.GetFrame (i);
MethodBase m = sf.GetMethod ();
+ if (m == null)
+ continue;
Type t = m.DeclaringType;
if (m.IsGenericMethod) {
Type[] margs = m.GetGenericArguments ();
if (!test (exc, typeof (Gen<string>)))
return 1;
}
+
+ // Exception thrown in inherited method with different generic context
+ // (#509406)
+ try {
+ new Bar <string> ().Throw ();
+ } catch (Exception ex) {
+ Console.WriteLine (new StackTrace (ex));
+ }
+
+ try {
+ new Bar <string> ().Throw<Bar<string>> ();
+ } catch (Exception ex) {
+ Console.WriteLine (new StackTrace (ex));
+ }
+
return 0;
}
}