sonyps5201314
dc452836e0
Fix failing unit tests: `InitializerTests` and `ValueTypes`.
5 months ago
sonyps5201314
5672c58bcf
Fixed an issue where the `TestRef` type in the example below could not be decompiled correctly after the commit: `Fixed an issue where the logic of moving the initialization statement of class members in the constructor to the class member declaration was incompatible with complex expressions using parameters.`
...
```cs
public ref struct TestRef(ref int a)
{
public ref int AAA = ref a;
public void Print()
{
int val = AAA;
Console.WriteLine(val);
}
}
```
5 months ago
sonyps5201314
8abe38128e
Fixed an issue where [RestClientOptions]( https://github.com/restsharp/RestSharp/blob/dev/src/RestSharp/Options/RestClientOptions.cs ) could not be decompiled correctly after the commit: `Fixed an issue where the logic of moving the initialization statement of class members in the constructor to the class member declaration was incompatible with complex expressions using parameters.`
5 months ago
sonyps5201314
16c2b8c1a9
The logic was temporarily adjusted so that the `StructWithDefaultCtor` type in the unit test could pass the test. In fact, the member initialization statement in its constructor could be moved.
...
Here's an example:
when `IsPrimaryConstructor` return `false`:
```cs
struct StructWithDefaultCtor
{
int X = 42;
public StructWithDefaultCtor()
{
}
}
```
when `IsPrimaryConstructor` return `true`:
```cs
struct StructWithDefaultCtor()
{
int X = 42;
}
```
5 months ago
sonyps5201314
851a1f3af5
Fixed an issue where the logic of moving the initialization statement of class members in the constructor to the class member declaration was incompatible with complex expressions using parameters.
...
Here's an example:
```cs
public struct FromBinaryOperator
{
public int Leet;
public FromBinaryOperator(int dummy1, int dummy2)
{
Leet = dummy1 + dummy2;
}
}
public struct FromCall
{
public int Leet;
public FromCall(int dummy1, int dummy2)
{
Leet = Math.Max(dummy1, dummy2);
}
}
public struct FromConvert
{
public int Leet;
public FromConvert(double dummy1, double dummy2)
{
Leet = (int)Math.Min(dummy1, dummy2);
}
}
```
5 months ago
sonyps5201314
461ffe57fe
Fixed an issue in unit tests where the `RefFields` type would be decompiled into incorrect code when the return value of the `IsPrimaryConstructor` function was forcibly changed to `false`.
5 months ago
sonyps5201314
c5fc18c94e
Fixed an issue where the `Range` type in " https://github.com/restsharp/RestSharp/blob/dev/src/RestSharp/Polyfills/Range.cs " could not be decompiled correctly after adjusting the judgment logic of the primary constructor.
5 months ago
sonyps5201314
cae466e5b0
Make `ILSpy` support `struct` and `record struct` types declared with a primary constructor and containing other constructors.
...
Here's an example:
```cs
public record struct CopilotContextId_RecordStruct(Guid id)
{
public Guid guid { get; } = id;
public CopilotContextId_RecordStruct() : this(Guid.NewGuid())
{
}
}
public struct CopilotContextId_Struct(Guid id)
{
public Guid guid { get; } = id;
public CopilotContextId_Struct() : this(Guid.NewGuid())
{
}
}
```
5 months ago
sonyps5201314
9a4e49a7d4
Fixed an issue where the "CopilotQueriedScopeMention" type in "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\Microsoft.VisualStudio.Copilot.Contracts\Microsoft.VisualStudio.Copilot.dll" could not be decompiled correctly after expanding the judgment logic of IsPrimaryConstructor.
5 months ago
sonyps5201314
554ec92e73
Fix the issue where parameters in the base class constructor call are not passed correctly for inherited classes declared using the primary constructor form (e.g., the `DeserializationException` type in RestSharp), and also fix the subsequent issue where an extra parenthesis '()' is output if the base class is an interface (e.g., the `XmlRestSerializer` type in RestSharp).
6 months ago
Siegfried Pammer
c075f7b9c8
Fix out var for expressions appearing in a lambda and not in a statement.
6 months ago
Siegfried Pammer
d11c40719d
#3569 : Don't move out variable declarations out of lambdas.
6 months ago
ds5678
c54318173b
Fix lower case type name conflicting with variable name
6 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
7 months ago
Jan Kučera
9d11f523b1
Always move initializer decompilation setting
8 months ago
Siegfried Pammer
9dde97414a
Rename ResolvedUsingScope to UsingScope
8 months ago
Siegfried Pammer
c9e3790adc
Remove UnresolvedUsingScope
8 months ago
Siegfried Pammer
d2d9281072
Move CanTransformToExtensionMethodCall to CSharpResolver
8 months ago
Siegfried Pammer
e56f12cf93
Fix #2165 : DeclareVariables step must update ResolveResult annotation when using out var.
8 months ago
Siegfried Pammer
ddb7171a2a
Fix #3524 : Property without backing field cannot have an initializer.
8 months ago
Siegfried Pammer
49368caf1c
Rename option to "UseObjectCreationOfGenericTypeParameter"
9 months ago
DoctorKrolic
47eeacd7aa
Add an option to not transform `Activator.CreateInstance<T>()` to `new T()`
9 months ago
Siegfried Pammer
2fb90b49e0
Adjust string.Concat handling in ReplaceMethodCallsWithOperators to support unexpanded string.Concat calls.
9 months ago
ds5678
586c04d081
Support params keyword on non-array collections
9 months ago
Siegfried Pammer
978c31ca5e
Add PropertyAndEventBackingFieldLookup to improve performance of MemberIsHidden.
10 months ago
ds5678
361bb17618
Add configuration option to check for overflow and underflow
10 months ago
Siegfried Pammer
453fc06e02
Fix #3406 : Wrong decompilation of record struct without primary constructor.
1 year ago
Siegfried Pammer
0481c7d1ee
Improve LINQ decompiler to support combining lambda parameter names if they syntactically refer to the same range variable
1 year ago
Siegfried Pammer
fa50e8d8b3
Add non-embedded attributes to all tests that use older framework versions.
1 year ago
Siegfried Pammer
c478ccc2e0
Fix #3319 : KeyDownEvent field reference was replaced with KeyDown event reference.
1 year ago
Siegfried Pammer
e96605ca87
Fix #3310 : Filter out copy-constructor only if it's an actual record type.
1 year ago
Siegfried Pammer
2043e5dd6f
Add support for C# 12 primary constructors.
2 years ago
Siegfried Pammer
fd1de09489
Avoid using operator + for string concatenation when ref-like types are involved.
2 years ago
Siegfried Pammer
9d22e3ab41
NullableLiftingTransform: Undo new compiler optimization (omitting get_HasValue for comparisions with constants)
2 years ago
Siegfried Pammer
02d2a8c1f8
Add metadata processing for C# 12 'ref readonly' parameters
2 years ago
Siegfried Pammer
4bf9487ecd
Remove IsRef, IsOut and IsIn flags from IParameter and Replace ParameterModifiers with ReferenceKind.
2 years ago
Daniel Grunwald
d48df11133
Remove unused transforms: DecimalConstantTransform and ParameterNullCheckTransform
2 years ago
Siegfried Pammer
6c08851cb0
#3209 : Only add imports for extension methods.
2 years ago
Siegfried Pammer
972354913e
Fix #3209 : Ensure using directives are added for extension methods in higher level patterns such as: foreach -> GetEnumerator(), collection initializer -> Add() and deconstruction -> Deconstruct().
2 years ago
Siegfried Pammer
ca78d4a14d
Use MetadataFile instead of PEFile in TypeSystem.
2 years ago
Siegfried Pammer
ee160b4e2a
#3075 : Improve performance of CSharpResolver.LookupSimpleNameOrTypeName in cases with a large number of local variables.
3 years ago
Kirill Osenkov
7992d148e8
Generate sequence points for expression-bodied properties and indexers
3 years ago
Siegfried Pammer
13227e433e
Fix compound assignments with local variables.
3 years ago
Daniel Grunwald
b80d20b15d
Add support for calling `operator checked`.
3 years ago
Daniel Grunwald
8b9ba20847
Builtin unsigned right shift operator.
3 years ago
Daniel Grunwald
3c46271a11
Add support for unsigned right shift.
...
Only for user-defined operators so far; builtin right shifts still cast to the appropriate type.
3 years ago
Daniel Grunwald
9359d47c0b
Add support for ScopedRefAttribute
3 years ago
Siegfried Pammer
539925f259
Fix #2983 : display-class locals should be named uniquely per top-level ILFunction. Add assertion to ResolveCollisions: ensure that colliding/merged variables have the same type.
3 years ago
ElektroKill
a5febb3e4f
Add support for VB.NET automatic events
3 years ago
Siegfried Pammer
c3d0e5ecc2
Fix #1784 : Move RemoveEmbeddedAttributes transform to ICSharpCode.Decompiler and do no longer decompile embedded attributes in WholeProjectDecompiler and PortablePdbWriter.
3 years ago