mirror of https://github.com/icsharpcode/ILSpy.git
40 changed files with 2278 additions and 441 deletions
@ -0,0 +1,94 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||||
|
// software and associated documentation files (the "Software"), to deal in the Software
|
||||||
|
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||||
|
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||||
|
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in all copies or
|
||||||
|
// substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||||
|
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||||
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using System.Threading.Tasks; |
||||||
|
|
||||||
|
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness |
||||||
|
{ |
||||||
|
class Loops |
||||||
|
{ |
||||||
|
static void Main() |
||||||
|
{ |
||||||
|
ForWithMultipleVariables(); |
||||||
|
DoubleForEachWithSameVariable(new[] { "a", "b", "c" }); |
||||||
|
ForeachExceptForNameCollision(new[] { 42, 43, 44, 45 }); |
||||||
|
} |
||||||
|
|
||||||
|
public static void ForWithMultipleVariables() |
||||||
|
{ |
||||||
|
int x, y; |
||||||
|
Console.WriteLine("before for"); |
||||||
|
for (x = y = 0; x < 10; x++) { |
||||||
|
y++; |
||||||
|
Console.WriteLine("x = " + x + ", y = " + y); |
||||||
|
} |
||||||
|
Console.WriteLine("after for"); |
||||||
|
} |
||||||
|
|
||||||
|
public static void DoubleForEachWithSameVariable(IEnumerable<string> enumerable) |
||||||
|
{ |
||||||
|
Console.WriteLine("DoubleForEachWithSameVariable:"); |
||||||
|
foreach (string current in enumerable) { |
||||||
|
Console.WriteLine(current.ToLower()); |
||||||
|
} |
||||||
|
Console.WriteLine("after first loop"); |
||||||
|
foreach (string current in enumerable) { |
||||||
|
Console.WriteLine(current.ToUpper()); |
||||||
|
} |
||||||
|
Console.WriteLine("after second loop"); |
||||||
|
} |
||||||
|
|
||||||
|
public static void ForeachExceptForNameCollision(IEnumerable<int> inputs) |
||||||
|
{ |
||||||
|
Console.WriteLine("ForeachWithNameCollision:"); |
||||||
|
int current; |
||||||
|
using (IEnumerator<int> enumerator = inputs.GetEnumerator()) { |
||||||
|
while (enumerator.MoveNext()) { |
||||||
|
current = enumerator.Current; |
||||||
|
Console.WriteLine(current); |
||||||
|
} |
||||||
|
} |
||||||
|
current = 1; |
||||||
|
Console.WriteLine(current); |
||||||
|
} |
||||||
|
|
||||||
|
public static void NonGenericForeachWithReturnFallbackTest(IEnumerable e) |
||||||
|
{ |
||||||
|
Console.WriteLine("NonGenericForeachWithReturnFallback:"); |
||||||
|
IEnumerator enumerator = e.GetEnumerator(); |
||||||
|
try { |
||||||
|
Console.WriteLine("MoveNext"); |
||||||
|
if (enumerator.MoveNext()) { |
||||||
|
object current = enumerator.Current; |
||||||
|
Console.WriteLine("current: " + current); |
||||||
|
} |
||||||
|
} finally { |
||||||
|
IDisposable disposable = enumerator as IDisposable; |
||||||
|
if (disposable != null) { |
||||||
|
disposable.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
Console.WriteLine("After finally!"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,72 +0,0 @@ |
|||||||
using System; |
|
||||||
using System.Collections.Generic; |
|
||||||
using System.Linq; |
|
||||||
using System.Text; |
|
||||||
using System.Threading.Tasks; |
|
||||||
|
|
||||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// This file contains special cases of some patterns that cannot be tested in pretty tests.
|
|
||||||
/// </summary>
|
|
||||||
class Patterns |
|
||||||
{ |
|
||||||
static void Main() |
|
||||||
{ |
|
||||||
SimpleUsingNullStatement(); |
|
||||||
ForWithMultipleVariables(); |
|
||||||
DoubleForEachWithSameVariable(new[] { "a", "b", "c" }); |
|
||||||
ForeachExceptForNameCollision(new[] { 42, 43, 44, 45 }); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Special case: Roslyn eliminates the try-finally altogether.
|
|
||||||
/// </summary>
|
|
||||||
public static void SimpleUsingNullStatement() |
|
||||||
{ |
|
||||||
Console.WriteLine("before using"); |
|
||||||
using (null) { |
|
||||||
Console.WriteLine("using (null)"); |
|
||||||
} |
|
||||||
Console.WriteLine("after using"); |
|
||||||
} |
|
||||||
|
|
||||||
public static void ForWithMultipleVariables() |
|
||||||
{ |
|
||||||
int x, y; |
|
||||||
Console.WriteLine("before for"); |
|
||||||
for (x = y = 0; x < 10; x++) { |
|
||||||
y++; |
|
||||||
Console.WriteLine("x = " + x + ", y = " + y); |
|
||||||
} |
|
||||||
Console.WriteLine("after for"); |
|
||||||
} |
|
||||||
|
|
||||||
public static void DoubleForEachWithSameVariable(IEnumerable<string> enumerable) |
|
||||||
{ |
|
||||||
Console.WriteLine("DoubleForEachWithSameVariable:"); |
|
||||||
foreach (string current in enumerable) { |
|
||||||
Console.WriteLine(current.ToLower()); |
|
||||||
} |
|
||||||
Console.WriteLine("after first loop"); |
|
||||||
foreach (string current in enumerable) { |
|
||||||
Console.WriteLine(current.ToUpper()); |
|
||||||
} |
|
||||||
Console.WriteLine("after second loop"); |
|
||||||
} |
|
||||||
|
|
||||||
public static void ForeachExceptForNameCollision(IEnumerable<int> inputs) |
|
||||||
{ |
|
||||||
Console.WriteLine("ForeachWithNameCollision:"); |
|
||||||
int current; |
|
||||||
using (IEnumerator<int> enumerator = inputs.GetEnumerator()) { |
|
||||||
while (enumerator.MoveNext()) { |
|
||||||
current = enumerator.Current; |
|
||||||
Console.WriteLine(current); |
|
||||||
} |
|
||||||
} |
|
||||||
current = 1; |
|
||||||
Console.WriteLine(current); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,164 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||||
|
// software and associated documentation files (the "Software"), to deal in the Software
|
||||||
|
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||||
|
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||||
|
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in all copies or
|
||||||
|
// substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||||
|
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||||
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness |
||||||
|
{ |
||||||
|
class Using |
||||||
|
{ |
||||||
|
class PrintOnDispose : IDisposable |
||||||
|
{ |
||||||
|
private string v; |
||||||
|
|
||||||
|
public PrintOnDispose(string v) |
||||||
|
{ |
||||||
|
this.v = v; |
||||||
|
} |
||||||
|
|
||||||
|
public void Dispose() |
||||||
|
{ |
||||||
|
Console.WriteLine(this.v); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
static void Main() |
||||||
|
{ |
||||||
|
SimpleUsingNullStatement(); |
||||||
|
NoUsingDueToAssignment(); |
||||||
|
NoUsingDueToAssignment2(); |
||||||
|
NoUsingDueToByRefCall(); |
||||||
|
NoUsingDueToContinuedDisposableUse(); |
||||||
|
ContinuedObjectUse(); |
||||||
|
VariableAlreadyUsedBefore(); |
||||||
|
UsingObject(); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Special case: Roslyn eliminates the try-finally altogether.
|
||||||
|
/// </summary>
|
||||||
|
public static void SimpleUsingNullStatement() |
||||||
|
{ |
||||||
|
Console.WriteLine("before using"); |
||||||
|
using (null) { |
||||||
|
Console.WriteLine("using (null)"); |
||||||
|
} |
||||||
|
Console.WriteLine("after using"); |
||||||
|
} |
||||||
|
|
||||||
|
public static void NoUsingDueToAssignment() |
||||||
|
{ |
||||||
|
PrintOnDispose printOnDispose = new PrintOnDispose("Wrong"); |
||||||
|
try { |
||||||
|
printOnDispose = new PrintOnDispose("Correct"); |
||||||
|
} finally { |
||||||
|
printOnDispose.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void NoUsingDueToAssignment2() |
||||||
|
{ |
||||||
|
PrintOnDispose printOnDispose = new PrintOnDispose("NoUsing(): Wrong"); |
||||||
|
try { |
||||||
|
printOnDispose = new PrintOnDispose("NoUsing(): Correct"); |
||||||
|
} finally { |
||||||
|
IDisposable disposable = (object)printOnDispose as IDisposable; |
||||||
|
if (disposable != null) { |
||||||
|
disposable.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
static void Clear<T>(ref T t) |
||||||
|
{ |
||||||
|
t = default(T); |
||||||
|
} |
||||||
|
|
||||||
|
public static void NoUsingDueToByRefCall() |
||||||
|
{ |
||||||
|
PrintOnDispose printOnDispose = new PrintOnDispose("NoUsingDueToByRefCall(): Wrong"); |
||||||
|
try { |
||||||
|
Console.WriteLine("NoUsingDueToByRefCall"); |
||||||
|
Clear(ref printOnDispose); |
||||||
|
} finally { |
||||||
|
IDisposable disposable = (object)printOnDispose as IDisposable; |
||||||
|
if (disposable != null) { |
||||||
|
disposable.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void NoUsingDueToContinuedDisposableUse() |
||||||
|
{ |
||||||
|
var obj = new System.IO.StringWriter(); |
||||||
|
IDisposable disposable; |
||||||
|
try { |
||||||
|
obj.WriteLine("NoUsingDueToContinuedDisposableUse"); |
||||||
|
} finally { |
||||||
|
disposable = (object)obj as IDisposable; |
||||||
|
if (disposable != null) { |
||||||
|
disposable.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
Console.WriteLine(disposable); |
||||||
|
} |
||||||
|
|
||||||
|
public static void ContinuedObjectUse() |
||||||
|
{ |
||||||
|
var obj = new System.IO.StringWriter(); |
||||||
|
try { |
||||||
|
obj.WriteLine("ContinuedObjectUse"); |
||||||
|
} finally { |
||||||
|
IDisposable disposable = (object)obj as IDisposable; |
||||||
|
if (disposable != null) { |
||||||
|
disposable.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
Console.WriteLine(obj); |
||||||
|
} |
||||||
|
|
||||||
|
public static void VariableAlreadyUsedBefore() |
||||||
|
{ |
||||||
|
System.IO.StringWriter obj = new System.IO.StringWriter(); |
||||||
|
obj.Write("VariableAlreadyUsedBefore - 1"); |
||||||
|
Console.WriteLine(obj); |
||||||
|
obj = new System.IO.StringWriter(); |
||||||
|
try { |
||||||
|
obj.WriteLine("VariableAlreadyUsedBefore - 2"); |
||||||
|
} finally { |
||||||
|
IDisposable disposable = (object)obj as IDisposable; |
||||||
|
if (disposable != null) { |
||||||
|
disposable.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void UsingObject() |
||||||
|
{ |
||||||
|
object obj = new object(); |
||||||
|
try { |
||||||
|
Console.WriteLine("UsingObject: {0}", obj); |
||||||
|
} finally { |
||||||
|
IDisposable disposable = obj as IDisposable; |
||||||
|
if (disposable != null) { |
||||||
|
disposable.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,54 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||||
|
// software and associated documentation files (the "Software"), to deal in the Software
|
||||||
|
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||||
|
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||||
|
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in all copies or
|
||||||
|
// substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||||
|
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||||
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
||||||
|
{ |
||||||
|
internal class Generics |
||||||
|
{ |
||||||
|
private class GenericClass<T> |
||||||
|
{ |
||||||
|
public void M(out GenericClass<T> self) |
||||||
|
{ |
||||||
|
self = this; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public class BaseClass |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public class DerivedClass : BaseClass |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public T CastToTypeParameter<T>(DerivedClass d) where T : BaseClass |
||||||
|
{ |
||||||
|
return (T)(BaseClass)d; |
||||||
|
} |
||||||
|
|
||||||
|
public T New<T>() where T : new() |
||||||
|
{ |
||||||
|
return new T(); |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsNull<T>(T t) |
||||||
|
{ |
||||||
|
return t == null; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,172 @@ |
|||||||
|
|
||||||
|
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929 |
||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved. |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Metadata version: v4.0.30319 |
||||||
|
.assembly extern mscorlib |
||||||
|
{ |
||||||
|
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. |
||||||
|
.ver 4:0:0:0 |
||||||
|
} |
||||||
|
.assembly lb3mdocq |
||||||
|
{ |
||||||
|
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) |
||||||
|
.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 |
||||||
|
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. |
||||||
|
.permissionset reqmin |
||||||
|
= {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} |
||||||
|
.hash algorithm 0x00008004 |
||||||
|
.ver 0:0:0:0 |
||||||
|
} |
||||||
|
.module lb3mdocq.dll |
||||||
|
// MVID: {4412C112-CBEB-40EB-BC42-5C82526C8657} |
||||||
|
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) |
||||||
|
.imagebase 0x10000000 |
||||||
|
.file alignment 0x00000200 |
||||||
|
.stackreserve 0x00100000 |
||||||
|
.subsystem 0x0003 // WINDOWS_CUI |
||||||
|
.corflags 0x00000001 // ILONLY |
||||||
|
// Image base: 0x03060000 |
||||||
|
|
||||||
|
|
||||||
|
// =============== CLASS MEMBERS DECLARATION =================== |
||||||
|
|
||||||
|
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.class auto ansi nested private beforefieldinit GenericClass`1<T> |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.method public hidebysig instance void |
||||||
|
M([out] class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/GenericClass`1<!T>& self) cil managed |
||||||
|
{ |
||||||
|
// Code size 5 (0x5) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: nop |
||||||
|
IL_0001: ldarg.1 |
||||||
|
IL_0002: ldarg.0 |
||||||
|
IL_0003: stind.ref |
||||||
|
IL_0004: ret |
||||||
|
} // end of method GenericClass`1::M |
||||||
|
|
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method GenericClass`1::.ctor |
||||||
|
|
||||||
|
} // end of class GenericClass`1 |
||||||
|
|
||||||
|
.class auto ansi nested public beforefieldinit BaseClass |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method BaseClass::.ctor |
||||||
|
|
||||||
|
} // end of class BaseClass |
||||||
|
|
||||||
|
.class auto ansi nested public beforefieldinit DerivedClass |
||||||
|
extends ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass |
||||||
|
{ |
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method DerivedClass::.ctor |
||||||
|
|
||||||
|
} // end of class DerivedClass |
||||||
|
|
||||||
|
.method public hidebysig instance !!T CastToTypeParameter<(ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass) T>(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/DerivedClass d) cil managed |
||||||
|
{ |
||||||
|
// Code size 12 (0xc) |
||||||
|
.maxstack 1 |
||||||
|
.locals init (!!T V_0) |
||||||
|
IL_0000: nop |
||||||
|
IL_0001: ldarg.1 |
||||||
|
IL_0002: unbox.any !!T |
||||||
|
IL_0007: stloc.0 |
||||||
|
IL_0008: br.s IL_000a |
||||||
|
|
||||||
|
IL_000a: ldloc.0 |
||||||
|
IL_000b: ret |
||||||
|
} // end of method Generics::CastToTypeParameter |
||||||
|
|
||||||
|
.method public hidebysig instance !!T New<.ctor T>() cil managed |
||||||
|
{ |
||||||
|
// Code size 39 (0x27) |
||||||
|
.maxstack 1 |
||||||
|
.locals init (!!T V_0, |
||||||
|
!!T V_1) |
||||||
|
IL_0000: nop |
||||||
|
IL_0001: ldloca.s V_1 |
||||||
|
IL_0003: initobj !!T |
||||||
|
IL_0009: ldloc.1 |
||||||
|
IL_000a: box !!T |
||||||
|
IL_000f: brfalse.s IL_001c |
||||||
|
|
||||||
|
IL_0011: ldloca.s V_1 |
||||||
|
IL_0013: initobj !!T |
||||||
|
IL_0019: ldloc.1 |
||||||
|
IL_001a: br.s IL_0021 |
||||||
|
|
||||||
|
IL_001c: call !!0 [mscorlib]System.Activator::CreateInstance<!!0>() |
||||||
|
IL_0021: nop |
||||||
|
IL_0022: stloc.0 |
||||||
|
IL_0023: br.s IL_0025 |
||||||
|
|
||||||
|
IL_0025: ldloc.0 |
||||||
|
IL_0026: ret |
||||||
|
} // end of method Generics::New |
||||||
|
|
||||||
|
.method public hidebysig instance bool |
||||||
|
IsNull<T>(!!T t) cil managed |
||||||
|
{ |
||||||
|
// Code size 15 (0xf) |
||||||
|
.maxstack 2 |
||||||
|
.locals init (bool V_0) |
||||||
|
IL_0000: nop |
||||||
|
IL_0001: ldarg.1 |
||||||
|
IL_0002: box !!T |
||||||
|
IL_0007: ldnull |
||||||
|
IL_0008: ceq |
||||||
|
IL_000a: stloc.0 |
||||||
|
IL_000b: br.s IL_000d |
||||||
|
|
||||||
|
IL_000d: ldloc.0 |
||||||
|
IL_000e: ret |
||||||
|
} // end of method Generics::IsNull |
||||||
|
|
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method Generics::.ctor |
||||||
|
|
||||||
|
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics |
||||||
|
|
||||||
|
|
||||||
|
// ============================================================= |
||||||
|
|
||||||
|
// *********** DISASSEMBLY COMPLETE *********************** |
||||||
|
// WARNING: Created Win32 resource file ../../../TestCases/Pretty\Generics.res |
@ -0,0 +1,153 @@ |
|||||||
|
|
||||||
|
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929 |
||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved. |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Metadata version: v4.0.30319 |
||||||
|
.assembly extern mscorlib |
||||||
|
{ |
||||||
|
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. |
||||||
|
.ver 4:0:0:0 |
||||||
|
} |
||||||
|
.assembly sxsfxc4c |
||||||
|
{ |
||||||
|
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) |
||||||
|
.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 |
||||||
|
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. |
||||||
|
.permissionset reqmin |
||||||
|
= {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} |
||||||
|
.hash algorithm 0x00008004 |
||||||
|
.ver 0:0:0:0 |
||||||
|
} |
||||||
|
.module sxsfxc4c.dll |
||||||
|
// MVID: {4BDFEFB1-623B-4D1C-B489-AE8EC4D00CF2} |
||||||
|
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) |
||||||
|
.imagebase 0x10000000 |
||||||
|
.file alignment 0x00000200 |
||||||
|
.stackreserve 0x00100000 |
||||||
|
.subsystem 0x0003 // WINDOWS_CUI |
||||||
|
.corflags 0x00000001 // ILONLY |
||||||
|
// Image base: 0x02FA0000 |
||||||
|
|
||||||
|
|
||||||
|
// =============== CLASS MEMBERS DECLARATION =================== |
||||||
|
|
||||||
|
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.class auto ansi nested private beforefieldinit GenericClass`1<T> |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.method public hidebysig instance void |
||||||
|
M([out] class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/GenericClass`1<!T>& self) cil managed |
||||||
|
{ |
||||||
|
// Code size 4 (0x4) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.1 |
||||||
|
IL_0001: ldarg.0 |
||||||
|
IL_0002: stind.ref |
||||||
|
IL_0003: ret |
||||||
|
} // end of method GenericClass`1::M |
||||||
|
|
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method GenericClass`1::.ctor |
||||||
|
|
||||||
|
} // end of class GenericClass`1 |
||||||
|
|
||||||
|
.class auto ansi nested public beforefieldinit BaseClass |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method BaseClass::.ctor |
||||||
|
|
||||||
|
} // end of class BaseClass |
||||||
|
|
||||||
|
.class auto ansi nested public beforefieldinit DerivedClass |
||||||
|
extends ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass |
||||||
|
{ |
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method DerivedClass::.ctor |
||||||
|
|
||||||
|
} // end of class DerivedClass |
||||||
|
|
||||||
|
.method public hidebysig instance !!T CastToTypeParameter<(ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass) T>(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/DerivedClass d) cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.1 |
||||||
|
IL_0001: unbox.any !!T |
||||||
|
IL_0006: ret |
||||||
|
} // end of method Generics::CastToTypeParameter |
||||||
|
|
||||||
|
.method public hidebysig instance !!T New<.ctor T>() cil managed |
||||||
|
{ |
||||||
|
// Code size 32 (0x20) |
||||||
|
.maxstack 1 |
||||||
|
.locals init (!!T V_0, |
||||||
|
!!T V_1) |
||||||
|
IL_0000: ldloca.s V_0 |
||||||
|
IL_0002: initobj !!T |
||||||
|
IL_0008: ldloc.0 |
||||||
|
IL_0009: box !!T |
||||||
|
IL_000e: brfalse.s IL_001a |
||||||
|
|
||||||
|
IL_0010: ldloca.s V_1 |
||||||
|
IL_0012: initobj !!T |
||||||
|
IL_0018: ldloc.1 |
||||||
|
IL_0019: ret |
||||||
|
|
||||||
|
IL_001a: call !!0 [mscorlib]System.Activator::CreateInstance<!!0>() |
||||||
|
IL_001f: ret |
||||||
|
} // end of method Generics::New |
||||||
|
|
||||||
|
.method public hidebysig instance bool |
||||||
|
IsNull<T>(!!T t) cil managed |
||||||
|
{ |
||||||
|
// Code size 10 (0xa) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.1 |
||||||
|
IL_0001: box !!T |
||||||
|
IL_0006: ldnull |
||||||
|
IL_0007: ceq |
||||||
|
IL_0009: ret |
||||||
|
} // end of method Generics::IsNull |
||||||
|
|
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method Generics::.ctor |
||||||
|
|
||||||
|
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics |
||||||
|
|
||||||
|
|
||||||
|
// ============================================================= |
||||||
|
|
||||||
|
// *********** DISASSEMBLY COMPLETE *********************** |
||||||
|
// WARNING: Created Win32 resource file ../../../TestCases/Pretty\Generics.opt.res |
@ -0,0 +1,143 @@ |
|||||||
|
|
||||||
|
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929 |
||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved. |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Metadata version: v4.0.30319 |
||||||
|
.assembly extern mscorlib |
||||||
|
{ |
||||||
|
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. |
||||||
|
.ver 4:0:0:0 |
||||||
|
} |
||||||
|
.assembly Generics |
||||||
|
{ |
||||||
|
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) |
||||||
|
.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 |
||||||
|
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. |
||||||
|
|
||||||
|
// --- The following custom attribute is added automatically, do not uncomment ------- |
||||||
|
// .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 02 00 00 00 00 00 ) |
||||||
|
|
||||||
|
.permissionset reqmin |
||||||
|
= {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} |
||||||
|
.hash algorithm 0x00008004 |
||||||
|
.ver 0:0:0:0 |
||||||
|
} |
||||||
|
.module Generics.dll |
||||||
|
// MVID: {6515FC2D-ED0B-41CF-9FD2-8CD5192CF5A1} |
||||||
|
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) |
||||||
|
.imagebase 0x10000000 |
||||||
|
.file alignment 0x00000200 |
||||||
|
.stackreserve 0x00100000 |
||||||
|
.subsystem 0x0003 // WINDOWS_CUI |
||||||
|
.corflags 0x00000001 // ILONLY |
||||||
|
// Image base: 0x01880000 |
||||||
|
|
||||||
|
|
||||||
|
// =============== CLASS MEMBERS DECLARATION =================== |
||||||
|
|
||||||
|
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.class auto ansi nested private beforefieldinit GenericClass`1<T> |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.method public hidebysig instance void |
||||||
|
M([out] class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/GenericClass`1<!T>& self) cil managed |
||||||
|
{ |
||||||
|
// Code size 4 (0x4) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.1 |
||||||
|
IL_0001: ldarg.0 |
||||||
|
IL_0002: stind.ref |
||||||
|
IL_0003: ret |
||||||
|
} // end of method GenericClass`1::M |
||||||
|
|
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method GenericClass`1::.ctor |
||||||
|
|
||||||
|
} // end of class GenericClass`1 |
||||||
|
|
||||||
|
.class auto ansi nested public beforefieldinit BaseClass |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method BaseClass::.ctor |
||||||
|
|
||||||
|
} // end of class BaseClass |
||||||
|
|
||||||
|
.class auto ansi nested public beforefieldinit DerivedClass |
||||||
|
extends ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass |
||||||
|
{ |
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method DerivedClass::.ctor |
||||||
|
|
||||||
|
} // end of class DerivedClass |
||||||
|
|
||||||
|
.method public hidebysig instance !!T CastToTypeParameter<(ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass) T>(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/DerivedClass d) cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.1 |
||||||
|
IL_0001: unbox.any !!T |
||||||
|
IL_0006: ret |
||||||
|
} // end of method Generics::CastToTypeParameter |
||||||
|
|
||||||
|
.method public hidebysig instance !!T New<.ctor T>() cil managed |
||||||
|
{ |
||||||
|
// Code size 6 (0x6) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: call !!0 [mscorlib]System.Activator::CreateInstance<!!0>() |
||||||
|
IL_0005: ret |
||||||
|
} // end of method Generics::New |
||||||
|
|
||||||
|
.method public hidebysig instance bool |
||||||
|
IsNull<T>(!!T t) cil managed |
||||||
|
{ |
||||||
|
// Code size 10 (0xa) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.1 |
||||||
|
IL_0001: box !!T |
||||||
|
IL_0006: ldnull |
||||||
|
IL_0007: ceq |
||||||
|
IL_0009: ret |
||||||
|
} // end of method Generics::IsNull |
||||||
|
|
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 7 (0x7) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: ret |
||||||
|
} // end of method Generics::.ctor |
||||||
|
|
||||||
|
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics |
||||||
|
|
||||||
|
|
||||||
|
// ============================================================= |
||||||
|
|
||||||
|
// *********** DISASSEMBLY COMPLETE *********************** |
@ -0,0 +1,166 @@ |
|||||||
|
|
||||||
|
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929 |
||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved. |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Metadata version: v4.0.30319 |
||||||
|
.assembly extern mscorlib |
||||||
|
{ |
||||||
|
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. |
||||||
|
.ver 4:0:0:0 |
||||||
|
} |
||||||
|
.assembly Generics |
||||||
|
{ |
||||||
|
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) |
||||||
|
.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 |
||||||
|
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. |
||||||
|
|
||||||
|
// --- The following custom attribute is added automatically, do not uncomment ------- |
||||||
|
// .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 ) |
||||||
|
|
||||||
|
.permissionset reqmin |
||||||
|
= {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} |
||||||
|
.hash algorithm 0x00008004 |
||||||
|
.ver 0:0:0:0 |
||||||
|
} |
||||||
|
.module Generics.dll |
||||||
|
// MVID: {9BC41AF0-27DC-4022-8C9C-4D7039122350} |
||||||
|
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) |
||||||
|
.imagebase 0x10000000 |
||||||
|
.file alignment 0x00000200 |
||||||
|
.stackreserve 0x00100000 |
||||||
|
.subsystem 0x0003 // WINDOWS_CUI |
||||||
|
.corflags 0x00000001 // ILONLY |
||||||
|
// Image base: 0x03030000 |
||||||
|
|
||||||
|
|
||||||
|
// =============== CLASS MEMBERS DECLARATION =================== |
||||||
|
|
||||||
|
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.class auto ansi nested private beforefieldinit GenericClass`1<T> |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.method public hidebysig instance void |
||||||
|
M([out] class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/GenericClass`1<!T>& self) cil managed |
||||||
|
{ |
||||||
|
// Code size 5 (0x5) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: nop |
||||||
|
IL_0001: ldarg.1 |
||||||
|
IL_0002: ldarg.0 |
||||||
|
IL_0003: stind.ref |
||||||
|
IL_0004: ret |
||||||
|
} // end of method GenericClass`1::M |
||||||
|
|
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 8 (0x8) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: nop |
||||||
|
IL_0007: ret |
||||||
|
} // end of method GenericClass`1::.ctor |
||||||
|
|
||||||
|
} // end of class GenericClass`1 |
||||||
|
|
||||||
|
.class auto ansi nested public beforefieldinit BaseClass |
||||||
|
extends [mscorlib]System.Object |
||||||
|
{ |
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 8 (0x8) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: nop |
||||||
|
IL_0007: ret |
||||||
|
} // end of method BaseClass::.ctor |
||||||
|
|
||||||
|
} // end of class BaseClass |
||||||
|
|
||||||
|
.class auto ansi nested public beforefieldinit DerivedClass |
||||||
|
extends ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass |
||||||
|
{ |
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 8 (0x8) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass::.ctor() |
||||||
|
IL_0006: nop |
||||||
|
IL_0007: ret |
||||||
|
} // end of method DerivedClass::.ctor |
||||||
|
|
||||||
|
} // end of class DerivedClass |
||||||
|
|
||||||
|
.method public hidebysig instance !!T CastToTypeParameter<(ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/BaseClass) T>(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics/DerivedClass d) cil managed |
||||||
|
{ |
||||||
|
// Code size 12 (0xc) |
||||||
|
.maxstack 1 |
||||||
|
.locals init (!!T V_0) |
||||||
|
IL_0000: nop |
||||||
|
IL_0001: ldarg.1 |
||||||
|
IL_0002: unbox.any !!T |
||||||
|
IL_0007: stloc.0 |
||||||
|
IL_0008: br.s IL_000a |
||||||
|
|
||||||
|
IL_000a: ldloc.0 |
||||||
|
IL_000b: ret |
||||||
|
} // end of method Generics::CastToTypeParameter |
||||||
|
|
||||||
|
.method public hidebysig instance !!T New<.ctor T>() cil managed |
||||||
|
{ |
||||||
|
// Code size 11 (0xb) |
||||||
|
.maxstack 1 |
||||||
|
.locals init (!!T V_0) |
||||||
|
IL_0000: nop |
||||||
|
IL_0001: call !!0 [mscorlib]System.Activator::CreateInstance<!!0>() |
||||||
|
IL_0006: stloc.0 |
||||||
|
IL_0007: br.s IL_0009 |
||||||
|
|
||||||
|
IL_0009: ldloc.0 |
||||||
|
IL_000a: ret |
||||||
|
} // end of method Generics::New |
||||||
|
|
||||||
|
.method public hidebysig instance bool |
||||||
|
IsNull<T>(!!T t) cil managed |
||||||
|
{ |
||||||
|
// Code size 15 (0xf) |
||||||
|
.maxstack 2 |
||||||
|
.locals init (bool V_0) |
||||||
|
IL_0000: nop |
||||||
|
IL_0001: ldarg.1 |
||||||
|
IL_0002: box !!T |
||||||
|
IL_0007: ldnull |
||||||
|
IL_0008: ceq |
||||||
|
IL_000a: stloc.0 |
||||||
|
IL_000b: br.s IL_000d |
||||||
|
|
||||||
|
IL_000d: ldloc.0 |
||||||
|
IL_000e: ret |
||||||
|
} // end of method Generics::IsNull |
||||||
|
|
||||||
|
.method public hidebysig specialname rtspecialname |
||||||
|
instance void .ctor() cil managed |
||||||
|
{ |
||||||
|
// Code size 8 (0x8) |
||||||
|
.maxstack 8 |
||||||
|
IL_0000: ldarg.0 |
||||||
|
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||||
|
IL_0006: nop |
||||||
|
IL_0007: ret |
||||||
|
} // end of method Generics::.ctor |
||||||
|
|
||||||
|
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Generics |
||||||
|
|
||||||
|
|
||||||
|
// ============================================================= |
||||||
|
|
||||||
|
// *********** DISASSEMBLY COMPLETE *********************** |
Loading…
Reference in new issue