2 // Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // Metadata version: v4.0.30319
8 .assembly extern mscorlib
10 .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
13 .assembly genericmethods
15 .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
16 .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
17 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
19 // --- The following custom attribute is added automatically, do not uncomment -------
20 // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 )
22 .hash algorithm 0x00008004
25 .module genericmethods.exe
26 // MVID: {62CAFB9A-4CDB-4A62-8A4F-DC7648609070}
28 .file alignment 0x00000200
29 .stackreserve 0x00100000
30 .subsystem 0x0003 // WINDOWS_CUI
31 .corflags 0x00000001 // ILONLY
32 // Image base: 0x01790000
35 // =============== CLASS MEMBERS DECLARATION ===================
37 .class interface private abstract auto ansi IFoo
39 .method public hidebysig newslot virtual
40 instance class [mscorlib]System.Type
43 // Code size 37 (0x25)
45 .locals init (class [mscorlib]System.Type V_0)
47 IL_0001: ldstr "At IFoo<T>::Foo<T>: TypeOf(T) = {0}"
49 IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
50 IL_0010: call void [mscorlib]System.Console::WriteLine(string,
54 IL_001b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
60 } // end of method IFoo::Foo
62 } // end of class IFoo
64 .class interface private abstract auto ansi IBar`1<T>
66 .method public hidebysig newslot virtual
67 instance class [mscorlib]System.Type
70 // Code size 37 (0x25)
72 .locals init (class [mscorlib]System.Type V_0)
74 IL_0001: ldstr "At IBar<T>::Foo<P>: TypeOf(P) = {0}"
76 IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
77 IL_0010: call void [mscorlib]System.Console::WriteLine(string,
81 IL_001b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
87 } // end of method IBar`1::Bar1
89 .method public hidebysig newslot virtual
90 instance class [mscorlib]System.Type
93 // Code size 37 (0x25)
95 .locals init (class [mscorlib]System.Type V_0)
97 IL_0001: ldstr "At IBar<T>::Bar2<K>: TypeOf(K) = {0}"
99 IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
100 IL_0010: call void [mscorlib]System.Console::WriteLine(string,
104 IL_001b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
106 IL_0021: br.s IL_0023
110 } // end of method IBar`1::Bar2
112 .method public hidebysig newslot virtual
113 instance void Bar3<P,K>([out] class [mscorlib]System.Type& t,
114 [out] class [mscorlib]System.Type& u) cil managed
116 // Code size 57 (0x39)
119 IL_0001: ldstr "At IBar<T>::Bar3<P, K>: TypeOf(P) = {0}, TypeOf(K)"
122 IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
124 IL_0015: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
125 IL_001a: call void [mscorlib]System.Console::WriteLine(string,
131 IL_0026: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
135 IL_0032: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
138 } // end of method IBar`1::Bar3
140 } // end of class IBar`1
142 .class private auto ansi beforefieldinit FooBar`1<V>
143 extends [mscorlib]System.Object
147 .method public hidebysig specialname rtspecialname
148 instance void .ctor() cil managed
153 IL_0001: call instance void [mscorlib]System.Object::.ctor()
156 } // end of method FooBar`1::.ctor
158 } // end of class FooBar`1
160 .class private auto ansi beforefieldinit Program
161 extends [mscorlib]System.Object
163 .method private hidebysig static int32
164 Main(string[] args) cil managed
167 // Code size 223 (0xdf)
169 .locals init (class FooBar`1<object> V_0,
171 class IBar`1<object> V_2,
172 class [mscorlib]System.Type V_3,
173 class [mscorlib]System.Type V_4,
176 IL_0001: newobj instance void class FooBar`1<object>::.ctor()
182 IL_000b: ldstr "Calling IFoo.Foo<String> on FooBar<Object> - expec"
183 + "ting IFoo::Foo<string>() returning typeof(string)"
184 IL_0010: call void [mscorlib]System.Console::WriteLine(string)
187 IL_0017: callvirt instance class [mscorlib]System.Type IFoo::Foo<string>()
188 IL_001c: ldtoken [mscorlib]System.String
189 IL_0021: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
190 IL_0026: call bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
191 class [mscorlib]System.Type)
192 IL_002b: ldstr "Calling IFoo.Foo<String> on FooBar<Object>"
193 IL_0030: call void Test::Assert(bool,
196 IL_0036: ldstr "Calling IBar.Bar1<String> on FooBar<object> - expe"
197 + "cting bar.Bar1<string>() returning typeof(string)"
198 IL_003b: call void [mscorlib]System.Console::WriteLine(string)
201 IL_0042: callvirt instance class [mscorlib]System.Type class IBar`1<object>::Bar1<string>()
202 IL_0047: ldtoken [mscorlib]System.String
203 IL_004c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
204 IL_0051: call bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
205 class [mscorlib]System.Type)
206 IL_0056: ldstr "Calling IBar.Bar1<String> on FooBar<object>"
207 IL_005b: call void Test::Assert(bool,
210 IL_0061: ldstr "Calling IBar.Bar2<String[]> on FooBar<object> - ex"
211 + "pecting bar.Bar2<string[]>() returning typeof(string[])"
212 IL_0066: call void [mscorlib]System.Console::WriteLine(string)
215 IL_006d: callvirt instance class [mscorlib]System.Type class IBar`1<object>::Bar2<string[]>()
216 IL_0072: ldtoken string[]
217 IL_0077: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
218 IL_007c: call bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
219 class [mscorlib]System.Type)
220 IL_0081: ldstr "Calling IBar.Bar2<String[]> on FooBar<object>"
221 IL_0086: call void Test::Assert(bool,
224 IL_008c: ldstr "Calling IBar.Bar3<String, String[]> - expecting ba"
225 + "r.Bar3<string>() returning typeof(string), typeof(string[])"
226 IL_0091: call void [mscorlib]System.Console::WriteLine(string)
229 IL_0098: ldloca.s V_3
230 IL_009a: ldloca.s V_4
231 IL_009c: callvirt instance void class IBar`1<object>::Bar3<string,string[]>(class [mscorlib]System.Type&,
232 class [mscorlib]System.Type&)
235 IL_00a3: ldtoken [mscorlib]System.String
236 IL_00a8: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
237 IL_00ad: call bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
238 class [mscorlib]System.Type)
239 IL_00b2: brfalse.s IL_00c7
242 IL_00b6: ldtoken string[]
243 IL_00bb: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
244 IL_00c0: call bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
245 class [mscorlib]System.Type)
246 IL_00c5: br.s IL_00c8
249 IL_00c8: ldstr "Calling IBar.Bar3<String, String[]>"
250 IL_00cd: call void Test::Assert(bool,
253 IL_00d3: call int32 Test::Ret()
255 IL_00da: br.s IL_00dc
259 } // end of method Program::Main
261 .method public hidebysig specialname rtspecialname
262 instance void .ctor() cil managed
267 IL_0001: call instance void [mscorlib]System.Object::.ctor()
270 } // end of method Program::.ctor
272 } // end of class Program
274 .class private auto ansi beforefieldinit Test
275 extends [mscorlib]System.Object
277 .field private static bool Pass
278 .method public hidebysig static int32 Ret() cil managed
280 // Code size 19 (0x13)
282 .locals init (int32 V_0)
284 IL_0001: ldsfld bool Test::Pass
285 IL_0006: brtrue.s IL_000c
287 IL_0008: ldc.i4.s 101
288 IL_000a: br.s IL_000e
292 IL_000f: br.s IL_0011
296 } // end of method Test::Ret
298 .method public hidebysig static void Assert(bool cond,
299 string msg) cil managed
301 // Code size 47 (0x2f)
303 .locals init (bool V_0)
308 IL_0004: brfalse.s IL_0015
311 IL_0007: ldstr "PASS"
312 IL_000c: call void [mscorlib]System.Console::WriteLine(string)
315 IL_0013: br.s IL_002e
318 IL_0016: ldstr "FAIL: "
320 IL_001c: call string [mscorlib]System.String::Concat(string,
322 IL_0021: call void [mscorlib]System.Console::WriteLine(string)
325 IL_0028: stsfld bool Test::Pass
328 } // end of method Test::Assert
330 .method public hidebysig specialname rtspecialname
331 instance void .ctor() cil managed
336 IL_0001: call instance void [mscorlib]System.Object::.ctor()
339 } // end of method Test::.ctor
341 .method private hidebysig specialname rtspecialname static
342 void .cctor() cil managed
347 IL_0001: stsfld bool Test::Pass
349 } // end of method Test::.cctor
351 } // end of class Test
354 // =============================================================
356 // *********** DISASSEMBLY COMPLETE ***********************
357 // WARNING: Created Win32 resource file genericmethods.res