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 sharedgenerics
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 sharedgenerics.exe
26 // MVID: {0DEEC74C-30FE-495C-9653-12BE5220327A}
28 .file alignment 0x00000200
29 .stackreserve 0x00100000
30 .subsystem 0x0003 // WINDOWS_CUI
31 .corflags 0x00000001 // ILONLY
32 // Image base: 0x02D40000
35 // =============== CLASS MEMBERS DECLARATION ===================
37 .class interface private abstract auto ansi IFoo`1<T>
39 .method public hidebysig newslot virtual
40 instance class [mscorlib]System.Type
43 // Code size 50 (0x32)
45 .locals init (class [mscorlib]System.Type V_0)
47 IL_0001: ldstr "At IFoo.Foo:Arg={0}, TypeOf(T)={1}"
49 IL_0008: constrained. !T
50 IL_000e: callvirt instance string [mscorlib]System.Object::ToString()
52 IL_0018: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
53 IL_001d: call void [mscorlib]System.Console::WriteLine(string,
58 IL_0028: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
64 } // end of method IFoo`1::Foo
66 } // end of class IFoo`1
68 .class interface private abstract auto ansi IBar`1<- T>
70 .method public hidebysig newslot virtual
71 instance class [mscorlib]System.Type
74 // Code size 50 (0x32)
76 .locals init (class [mscorlib]System.Type V_0)
78 IL_0001: ldstr "At IBar.Bar:Arg={0}, TypeOf(T)={1}"
80 IL_0008: constrained. !T
81 IL_000e: callvirt instance string [mscorlib]System.Object::ToString()
83 IL_0018: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
84 IL_001d: call void [mscorlib]System.Console::WriteLine(string,
89 IL_0028: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
95 } // end of method IBar`1::Bar
97 } // end of class IBar`1
99 .class private auto ansi beforefieldinit FooBar`2<T,U>
100 extends [mscorlib]System.Object
101 implements class IFoo`1<!T>,
104 .method public hidebysig specialname rtspecialname
105 instance void .ctor() cil managed
110 IL_0001: call instance void [mscorlib]System.Object::.ctor()
113 } // end of method FooBar`2::.ctor
115 } // end of class FooBar`2
117 .class private auto ansi beforefieldinit Program
118 extends [mscorlib]System.Object
120 .method public hidebysig static int32 Main() cil managed
123 // Code size 126 (0x7e)
125 .locals init (class FooBar`2<string,object> V_0,
126 class IFoo`1<string> V_1,
127 class IBar`1<string[]> V_2,
130 IL_0001: newobj instance void class FooBar`2<string,object>::.ctor()
136 IL_000b: ldstr "Calling IFoo<string>.Foo on FooBar<string, object>"
137 + " - expecting default method IFoo<string>.Foo"
138 IL_0010: call void [mscorlib]System.Console::WriteLine(string)
142 IL_001c: callvirt instance class [mscorlib]System.Type class IFoo`1<string>::Foo(!0)
143 IL_0021: ldtoken [mscorlib]System.String
144 IL_0026: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
145 IL_002b: call bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
146 class [mscorlib]System.Type)
147 IL_0030: ldstr "Calling IFoo<string>.Foo on FooBar<string, object>"
148 IL_0035: call void Test::Assert(bool,
151 IL_003b: ldstr "Calling IBar<string[]>.Foo on FooBar<string, objec"
152 + "t> - expecting default method IBar<object>.Foo"
153 IL_0040: call void [mscorlib]System.Console::WriteLine(string)
157 IL_0048: newarr [mscorlib]System.String
162 IL_0055: callvirt instance class [mscorlib]System.Type class IBar`1<string[]>::Bar(!0)
163 IL_005a: ldtoken [mscorlib]System.Object
164 IL_005f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
165 IL_0064: call bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
166 class [mscorlib]System.Type)
167 IL_0069: ldstr "Calling IBar<object>.Bar on FooBar<string, object>"
168 IL_006e: call void Test::Assert(bool,
171 IL_0074: call int32 Test::Ret()
173 IL_007a: br.s IL_007c
177 } // end of method Program::Main
179 .method public hidebysig specialname rtspecialname
180 instance void .ctor() cil managed
185 IL_0001: call instance void [mscorlib]System.Object::.ctor()
188 } // end of method Program::.ctor
190 } // end of class Program
192 .class private auto ansi beforefieldinit Test
193 extends [mscorlib]System.Object
195 .field private static bool Pass
196 .method public hidebysig static int32 Ret() cil managed
198 // Code size 19 (0x13)
200 .locals init (int32 V_0)
202 IL_0001: ldsfld bool Test::Pass
203 IL_0006: brtrue.s IL_000c
205 IL_0008: ldc.i4.s 101
206 IL_000a: br.s IL_000e
208 IL_000c: ldc.i4.s 100
210 IL_000f: br.s IL_0011
214 } // end of method Test::Ret
216 .method public hidebysig static void Assert(bool cond,
217 string msg) cil managed
219 // Code size 47 (0x2f)
221 .locals init (bool V_0)
226 IL_0004: brfalse.s IL_0015
229 IL_0007: ldstr "PASS"
230 IL_000c: call void [mscorlib]System.Console::WriteLine(string)
233 IL_0013: br.s IL_002e
236 IL_0016: ldstr "FAIL: "
238 IL_001c: call string [mscorlib]System.String::Concat(string,
240 IL_0021: call void [mscorlib]System.Console::WriteLine(string)
243 IL_0028: stsfld bool Test::Pass
246 } // end of method Test::Assert
248 .method public hidebysig specialname rtspecialname
249 instance void .ctor() cil managed
254 IL_0001: call instance void [mscorlib]System.Object::.ctor()
257 } // end of method Test::.ctor
259 .method private hidebysig specialname rtspecialname static
260 void .cctor() cil managed
265 IL_0001: stsfld bool Test::Pass
267 } // end of method Test::.cctor
269 } // end of class Test
272 // =============================================================
274 // *********** DISASSEMBLY COMPLETE ***********************
275 // WARNING: Created Win32 resource file sharedgenerics.res