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 constrainedcall
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 constrainedcall.exe
26 // MVID: {6171EA0F-1009-482D-8EF6-C944886D5D66}
28 .file alignment 0x00000200
29 .stackreserve 0x00100000
30 .subsystem 0x0003 // WINDOWS_CUI
31 .corflags 0x00000001 // ILONLY
32 // Image base: 0x01860000
35 // =============== CLASS MEMBERS DECLARATION ===================
37 .class interface private abstract auto ansi IFoo
39 .method public hidebysig newslot virtual
40 instance int32 Foo(int32 c) cil managed
42 // Code size 20 (0x14)
44 .locals init (class IAdd V_0,
48 IL_0002: castclass IAdd
52 IL_000a: callvirt instance int32 IAdd::Add(int32)
58 } // end of method IFoo::Foo
60 } // end of class IFoo
62 .class interface private abstract auto ansi IAdd
64 .method public hidebysig newslot abstract virtual
65 instance int32 Add(int32 c) cil managed
67 } // end of method IAdd::Add
69 } // end of class IAdd
71 .class private sequential ansi sealed beforefieldinit FooValue
72 extends [mscorlib]System.ValueType
76 .field public int32 val
78 .method public hidebysig newslot virtual final
79 instance int32 Add(int32 c) cil managed
81 // Code size 26 (0x1a)
83 .locals init (int32 V_0)
87 IL_0003: ldfld int32 FooValue::val
90 IL_000a: stfld int32 FooValue::val
92 IL_0010: ldfld int32 FooValue::val
98 } // end of method FooValue::Add
100 } // end of class FooValue
102 .class interface private abstract auto ansi IHorrible`1<T>
104 .method public hidebysig newslot abstract virtual
105 instance int32 GetLocalVal() cil managed
107 } // end of method IHorrible`1::GetLocalVal
109 .method public hidebysig newslot abstract virtual
110 instance void SetLocalVal(int32 val) cil managed
112 } // end of method IHorrible`1::SetLocalVal
114 .method public hidebysig newslot virtual
115 instance int32 Horrible() cil managed
117 // Code size 26 (0x1a)
119 .locals init (int32 V_0,
123 IL_0002: callvirt instance int32 class IHorrible`1<!T>::GetLocalVal()
131 IL_000e: callvirt instance void class IHorrible`1<!T>::SetLocalVal(int32)
135 IL_0016: br.s IL_0018
139 } // end of method IHorrible`1::Horrible
141 } // end of class IHorrible`1
143 .class private sequential ansi sealed beforefieldinit HorribleCase`1<Z>
144 extends [mscorlib]System.ValueType
145 implements class IHorrible`1<class [mscorlib]System.Collections.Generic.IList`1<!Z>>,
146 class IHorrible`1<class [mscorlib]System.Collections.Generic.IEnumerable`1<!Z>>
148 .field private int32 localVal
149 .method public hidebysig newslot virtual final
150 instance int32 GetLocalVal() cil managed
152 // Code size 12 (0xc)
154 .locals init (int32 V_0)
157 IL_0002: ldfld int32 valuetype HorribleCase`1<!Z>::localVal
159 IL_0008: br.s IL_000a
163 } // end of method HorribleCase`1::GetLocalVal
165 .method public hidebysig newslot virtual final
166 instance void SetLocalVal(int32 val) cil managed
173 IL_0003: stfld int32 valuetype HorribleCase`1<!Z>::localVal
175 } // end of method HorribleCase`1::SetLocalVal
177 .method private hidebysig newslot virtual final
178 instance int32 'IHorrible<System.Collections.Generic.IList<Z>>.Horrible'() cil managed
180 .override method instance int32 class IHorrible`1<class [mscorlib]System.Collections.Generic.IList`1<!Z>>::Horrible()
181 // Code size 23 (0x17)
183 .locals init (int32 V_0,
188 IL_0003: ldfld int32 valuetype HorribleCase`1<!Z>::localVal
193 IL_000c: stfld int32 valuetype HorribleCase`1<!Z>::localVal
196 IL_0013: br.s IL_0015
200 } // end of method HorribleCase`1::'IHorrible<System.Collections.Generic.IList<Z>>.Horrible'
201 } // end of class HorribleCase`1
203 .class private auto ansi beforefieldinit HorribleTest
204 extends [mscorlib]System.Object
206 .method public hidebysig static int32 Horror<(class IHorrible`1<!!U>) T,U>(!!T t) cil managed
208 // Code size 33 (0x21)
210 .locals init (int32 V_0)
213 IL_0003: constrained. !!T
214 IL_0009: callvirt instance int32 class IHorrible`1<!!U>::Horrible()
216 IL_0010: constrained. !!T
217 IL_0016: callvirt instance int32 class IHorrible`1<!!U>::Horrible()
220 IL_001d: br.s IL_001f
224 } // end of method HorribleTest::Horror
226 .method public hidebysig static void RunTest() cil managed
228 // Code size 58 (0x3a)
230 .locals init (valuetype HorribleCase`1<object> V_0)
232 IL_0001: ldloca.s V_0
233 IL_0003: initobj valuetype HorribleCase`1<object>
235 IL_000a: call int32 HorribleTest::Horror<valuetype HorribleCase`1<object>,class [mscorlib]System.Collections.Generic.IEnumerable`1<object>>(!!0)
238 IL_0012: ldstr "Fail"
239 IL_0017: call void Test::Assert(bool,
242 IL_001d: ldloca.s V_0
243 IL_001f: initobj valuetype HorribleCase`1<object>
245 IL_0026: call int32 HorribleTest::Horror<valuetype HorribleCase`1<object>,class [mscorlib]System.Collections.Generic.IList`1<object>>(!!0)
248 IL_002e: ldstr "Fail"
249 IL_0033: call void Test::Assert(bool,
253 } // end of method HorribleTest::RunTest
255 .method public hidebysig specialname rtspecialname
256 instance void .ctor() cil managed
261 IL_0001: call instance void [mscorlib]System.Object::.ctor()
264 } // end of method HorribleTest::.ctor
266 } // end of class HorribleTest
268 .class private auto ansi beforefieldinit SimpleConstraintTest
269 extends [mscorlib]System.Object
271 .method public hidebysig static int32 CallFoo_WithConstraints<(IFoo) T>(!!T& foo,
272 int32 val) cil managed
274 // Code size 19 (0x13)
276 .locals init (int32 V_0)
280 IL_0003: constrained. !!T
281 IL_0009: callvirt instance int32 IFoo::Foo(int32)
283 IL_000f: br.s IL_0011
287 } // end of method SimpleConstraintTest::CallFoo_WithConstraints
289 .method public hidebysig static void RunTest() cil managed
291 // Code size 75 (0x4b)
293 .locals init (valuetype FooValue V_0)
295 IL_0001: ldloca.s V_0
296 IL_0003: initobj FooValue
297 IL_0009: ldloca.s V_0
299 IL_000d: stfld int32 FooValue::val
300 IL_0012: ldstr "Calling CallFoo_WithConstraints on FooValue - expe"
302 IL_0017: call void [mscorlib]System.Console::WriteLine(string)
304 IL_001d: ldloca.s V_0
306 IL_0021: call int32 SimpleConstraintTest::CallFoo_WithConstraints<valuetype FooValue>(!!0&,
310 IL_002a: ldstr "Calling CallFoo_WithConstraints on FooValue"
311 IL_002f: call void Test::Assert(bool,
315 IL_0036: ldfld int32 FooValue::val
318 IL_003f: ldstr "Expecting boxing on CallFoo_WithConstraints"
319 IL_0044: call void Test::Assert(bool,
323 } // end of method SimpleConstraintTest::RunTest
325 .method public hidebysig specialname rtspecialname
326 instance void .ctor() cil managed
331 IL_0001: call instance void [mscorlib]System.Object::.ctor()
334 } // end of method SimpleConstraintTest::.ctor
336 } // end of class SimpleConstraintTest
338 .class private auto ansi beforefieldinit Program
339 extends [mscorlib]System.Object
341 .method public hidebysig static int32 Main() cil managed
344 // Code size 23 (0x17)
346 .locals init (int32 V_0)
348 IL_0001: call void HorribleTest::RunTest()
350 IL_0007: call void SimpleConstraintTest::RunTest()
352 IL_000d: call int32 Test::Ret()
354 IL_0013: br.s IL_0015
358 } // end of method Program::Main
360 .method public hidebysig specialname rtspecialname
361 instance void .ctor() cil managed
366 IL_0001: call instance void [mscorlib]System.Object::.ctor()
369 } // end of method Program::.ctor
371 } // end of class Program
373 .class private auto ansi beforefieldinit Test
374 extends [mscorlib]System.Object
376 .field private static bool Pass
377 .method public hidebysig static int32 Ret() cil managed
379 // Code size 19 (0x13)
381 .locals init (int32 V_0)
383 IL_0001: ldsfld bool Test::Pass
384 IL_0006: brtrue.s IL_000c
386 IL_0008: ldc.i4.s 101
387 IL_000a: br.s IL_000e
391 IL_000f: br.s IL_0011
395 } // end of method Test::Ret
397 .method public hidebysig static void Assert(bool cond,
398 string msg) cil managed
400 // Code size 47 (0x2f)
402 .locals init (bool V_0)
407 IL_0004: brfalse.s IL_0015
410 IL_0007: ldstr "PASS"
411 IL_000c: call void [mscorlib]System.Console::WriteLine(string)
414 IL_0013: br.s IL_002e
417 IL_0016: ldstr "FAIL: "
419 IL_001c: call string [mscorlib]System.String::Concat(string,
421 IL_0021: call void [mscorlib]System.Console::WriteLine(string)
424 IL_0028: stsfld bool Test::Pass
427 } // end of method Test::Assert
429 .method public hidebysig specialname rtspecialname
430 instance void .ctor() cil managed
435 IL_0001: call instance void [mscorlib]System.Object::.ctor()
438 } // end of method Test::.ctor
440 .method private hidebysig specialname rtspecialname static
441 void .cctor() cil managed
446 IL_0001: stsfld bool Test::Pass
448 } // end of method Test::.cctor
450 } // end of class Test
453 // =============================================================
455 // *********** DISASSEMBLY COMPLETE ***********************
456 // WARNING: Created Win32 resource file constrainedcall.res