2 using System
.Threading
;
3 using System
.Runtime
.CompilerServices
;
4 using System
.Diagnostics
;
6 namespace GetStackTrace
12 [MethodImplAttribute (MethodImplOptions
.NoInlining
)]
14 return new StackTrace ().GetFrame (0).GetMethod ().DeclaringType
.IsGenericTypeDefinition
? 1 : 0;
24 static int Main (string[] args
)
26 Thread t
= new Thread (new ParameterizedThreadStart (Test
<string>));
30 if (test_0_nongeneric_subclass () != 0)
35 /* Test for gshared methods declared in a generic subclass of a nongeneric class */
36 [MethodImplAttribute (MethodImplOptions
.NoInlining
)]
37 public static int test_0_nongeneric_subclass () {
38 return new D ().foo ();
41 static void Test
<TT
> (object test
)
43 Console
.WriteLine (typeof (Gen
<TT
>).ToString ());
44 Console
.WriteLine (System
.Environment
.StackTrace
);