.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Siegfried Pammer ffcd468d22 Fix #1572: parameters of lambdas and local functions are renamed, if there are with names from outer scopes collisions. 2 months ago
..
.gitignore Move UnsafeCode tests to pretty-tests (except for those that are not yet successful). 8 years ago
AnonymousTypes.cs Fix #603: Single element arrays should not span multiple lines 4 years ago
AssemblyCustomAttributes.cs Rearrange pretty tests, so that they work with Roslyn compilers as well. 7 years ago
Async.cs Rewrite AssignVariableNames algorithm to use variable usages instead of the list of variables. 10 months ago
AsyncForeach.cs Fix #1749, fix #2339, fix #2353: Add support for rethrow in async exception handlers, fix await catch/finally patterns for complex methods. 4 years ago
AsyncMain.cs Fix lines starting with spaces 7 years ago
AsyncStreams.cs #2128: Reformat the whole code base. 5 years ago
AsyncUsing.cs #2128: Reformat the whole code base. 5 years ago
AutoProperties.cs Fix #3010: Remove compiler-generated attributes for required members with custom ctors. 2 years ago
CS9_ExtensionGetEnumerator.cs Add additional tests for .NET 4.0 3 years ago
CS72_PrivateProtected.cs Fix #603: Single element arrays should not span multiple lines 4 years ago
CS73_StackAllocInitializers.cs Âdd a test case for stackalloc in nested context. 3 years ago
CheckedUnchecked.cs Fix #603: Single element arrays should not span multiple lines 4 years ago
Comparisons.cs Fix #3322: Add missing checks for equality comparison 3 months ago
CompoundAssignmentTest.cs #1572: Do not generate variable names that match C# keywords. 2 months ago
ConstantsTests.cs Fix #3367: Add extra validation to TransformDecimalCtorToConstant to prevent crashes with obfuscated assemblies. 4 months ago
ConstructorInitializers.cs Fix #3310: Filter out copy-constructor only if it's an actual record type. 7 months ago
CovariantReturns.cs Adds support for C# 9 covariant return types in methods and getter-only properties and indexers. 4 years ago
CustomAttributeConflicts.cs #2128: Reformat the whole code base. 5 years ago
CustomAttributeSamples.cs Fix #2448: Decompiler shows some enum values as hexdecimal instead of decimal 4 years ago
CustomAttributes.cs Add test case for generic attributes. 2 years ago
CustomAttributes2.cs Fix #2448: Decompiler shows some enum values as hexdecimal instead of decimal 4 years ago
CustomShortCircuitOperators.cs #2128: Reformat the whole code base. 5 years ago
CustomTaskType.cs Fix #603: Single element arrays should not span multiple lines 4 years ago
DeconstructionTests.cs Add additional tests for .NET 4.0 3 years ago
DelegateConstruction.cs Fix #1572: parameters of lambdas and local functions are renamed, if there are with names from outer scopes collisions. 2 months ago
Discards.cs Fix #2140: ILSpy 6.2p1 no longer respects "use discards" setting 5 years ago
DynamicTests.cs Transform RequiresLocationAttribute to 'ref readonly' on function pointers. 10 months ago
EnumTests.cs Fix #2646: Missing values for enums with skipped or duplicate items 3 years ago
ExceptionHandling.cs Fix nullable and other warnings. 3 years ago
ExpressionTrees.cs Fix #3014: Missing type information in lambda expressions. 2 years ago
FileScopedNamespaces.cs Generate file-scoped namespace declarations, if possible. 4 years ago
FixProxyCalls.cs Fix #3014: Missing type information in lambda expressions. 2 years ago
FunctionPointers.cs Transform RequiresLocationAttribute to 'ref readonly' on function pointers. 10 months ago
Generics.cs Fix #2231: Add support for ldloca; dup; initobj pattern used by Roslyn. 4 years ago
HelloWorld.cs Move test projects to their own directory in \ 8 years ago
IndexRangeTest.cs Fix #2156: range syntax not being detected correctly in some cases 5 years ago
InitializerTests.cs Allow explicit null termination character 3 months ago
InlineAssignmentTest.cs Fix #603: Single element arrays should not span multiple lines 4 years ago
InterfaceTests.cs Output attributes on lambda expressions 3 years ago
Issue1080.cs #2128: Reformat the whole code base. 5 years ago
LiftedOperators.cs Adjust NullableLiftingTransform to match new patterns due to RemoveInfeasiblePathTransform. 4 years ago
LocalFunctions.cs Rewrite AssignVariableNames algorithm to use variable usages instead of the list of variables. 10 months ago
Lock.cs #2128: Reformat the whole code base. 5 years ago
Loops.cs mcs 5 generates IL patterns that might lead to wrong behavior, if inlined, therefore we have to add another special case to the tests. 4 years ago
MemberTests.cs Fix #2389: missing extern keyword for properties and events. 4 years ago
MetadataAttributes.cs Add MethodCodeType argument to MethodImplAttribute. 3 years ago
MultidimensionalArray.cs Add old MultidimensionalArrays test to pretty test runner. 6 years ago
NamedArguments.cs Move named arguments to its own transform. 7 years ago
NativeInts.cs Merge pull request #2873 from icsharpcode/net-7.0 2 years ago
NullPropagation.cs Fix #3181: missing type information on NullReferenceExpression used with nullable value types. 4 months ago
NullableRefTypes.cs Add test case for explicit interface implementation involving nullable types 2 years ago
Operators.cs Add support for calling `operator checked`. 2 years ago
OptionalArguments.cs Fix #3384: add special case for null-literal conversions in optional argument handling. 3 months ago
OutVariables.cs Fix #2806: Do not use implicitly typed out variables, if argument and parameter types do not match exactly. 3 years ago
PInvoke.cs Fix interaction of C# 11 nint==IntPtr with overload resolution. 2 years ago
PatternMatching.cs Add test case for empty string pattern 2 years ago
PropertiesAndEvents.cs Fix #603: Single element arrays should not span multiple lines 4 years ago
QualifierTests.cs #1828: Add test case 4 years ago
QueryExpressions.cs Remove incomplete/wrong support for null-forgiving operator. 3 years ago
Readme.txt Upgrade Roslyn for tests to 3.0.0-beta3. 6 years ago
Records.cs Add non-embedded attributes to all tests that use older framework versions. 3 months ago
ReduceNesting.cs Adjust test name 2 years ago
RefFields.cs Add support for ScopedRefAttribute 2 years ago
RefLocalsAndReturns.cs #1572: Do not generate variable names that match C# keywords. 2 months ago
ShortCircuit.cs Fix DecompilerSettings.PatternMatching should only be active in case >= CS70. 4 years ago
StaticAbstractInterfaceMembers.cs Implement support for explicit interface implementation of operators and operator uses. 2 years ago
StringInterpolation.cs Support concatenation involving arguments of type ReadOnlySpan<char>. 10 months ago
Structs.cs Add non-embedded attributes to all tests that use older framework versions. 3 months ago
Switch.cs Fix switch-on-string transform for optimized Roslyn. 4 months ago
SwitchExpressions.cs Update to dotnet-format 5.1.225507. 4 years ago
ThrowExpressions.cs Fix #603: Single element arrays should not span multiple lines 4 years ago
TupleTests.cs Fix #3014: Missing type information in lambda expressions. 2 years ago
TypeAnalysisTests.cs Fix #2166: Unnecessary uint casts/conversions for certain bitwise operations 7 months ago
TypeMemberTests.cs Fix #3319: KeyDownEvent field reference was replaced with KeyDown event reference. 6 months ago
UnsafeCode.cs AssignVariableNames: Handle fixed statement special cases 10 months ago
UserDefinedConversions.cs Fix #1944: Add support for implicit conversions with `in` parameters. 4 years ago
Using.cs Fix #3385: Allow address uses of structs in using transform, if the reference is passed to an in parameter. 3 months ago
UsingVariables.cs Add additional tests for .NET 4.0 3 years ago
ValueTypes.cs Support ILInlining for in parameters 10 months ago
VariableNaming.cs Fix #3278: Missing variable declaration in nested for-loop after many other loops 8 months ago
VariableNamingWithoutSymbols.cs Rewrite AssignVariableNames algorithm to use variable usages instead of the list of variables. 10 months ago
WellKnownConstants.cs Add additional tests for .NET 4.0 3 years ago
YieldReturn.cs Revert "Add support for C# 11 parameter null checks" 10 months ago

Readme.txt

The files in this folder are prettiness tests for the decompiler.

The NUnit class running these tests is ../PrettyTestRunner.cs.

Each test case is a C# file.
The test runner will:
1. Compile the file into an .exe/.dll
2. Decompile the .exe/.dll
3. Compare the resulting code with the original input code.

The tests pass if the code looks exactly the same as the input code, ignoring comments, empty lines and preprocessor directives.
It also ignores disabled preprocessors sections (e.g. "#if ROSLYN") when the test runs with a compiler that does not set this symbol.
See Tester.GetPreprocessorSymbols() for the available symbols.