1 // Compiler options: -r:../class/lib/net_4_x/Mono.Cecil.dll
4 using System
.Threading
.Tasks
;
6 using System
.Reflection
;
7 using System
.Runtime
.CompilerServices
;
22 async void I
<C
>.Foo (C c
)
27 public static int Main ()
29 var m
= typeof (X
).GetMethod ("N.I<N.C>.Foo", BindingFlags
.NonPublic
| BindingFlags
.Instance
);
30 var attr
= m
.GetCustomAttribute
<AsyncStateMachineAttribute
> ();
34 var assembly
= AssemblyDefinition
.ReadAssembly (typeof (X
).Assembly
.Location
);
35 foreach (var t
in assembly
.MainModule
.Types
) {
42 static void PrintType (TypeDefinition td
, int indent
)
44 if (td
.IsNested
&& !string.IsNullOrEmpty (td
.Namespace
))
45 throw new ApplicationException ("BROKEN NESTED TYPE:");
46 Console
.WriteLine ("{2} Namespace: {0} Name: {1}", td
.Namespace
, td
.Name
, new string (' ', indent
* 4));
47 foreach (var tn
in td
.NestedTypes
)
48 PrintType (tn
, indent
+ 1);