Siegfried Pammer
bbac02a79f
Extract DecompileBodyForAnalysis from RecordDecompiler
...
Structural recognition of compiler-generated code needs method bodies as
ILAst decompiled with a fixed set of settings, so that recognition does
not depend on user-visible options. RecordDecompiler had this pipeline
as a private helper; hoist it to CSharpDecompiler so other recognizers
can share it, deriving the generic context from the method's declaring
type instead of a captured type definition.
Assisted-by: Claude:claude-fable-5:Claude Code
Claude-Session: https://claude.ai/code/session_01Btdypgm8utyxqt1Etn2BDi
2 months ago
Siegfried Pammer
79b0cbb719
Fix #3703 : Do not transform to a primary constructor if it's not public (or protected in abstract classes)
5 months ago
Siegfried Pammer
3fd9981535
Fix #3621 : Fix multiple uses of primary ctor parameter in initializer of record.
10 months ago
Siegfried Pammer
c34cc100b6
Records: Exclude static members from copy constructor check
10 months ago
Siegfried Pammer
2bb06709e9
RecordDecompiler: nullable enable
10 months ago
Siegfried Pammer
2271229b23
Fix #3618 : Extend validation of declared members and ctor parameters
10 months ago
Siegfried Pammer
94050a4aca
Rewrite TransformFieldAndConstructorInitializers from a step-by-step AST-based analysis to an analysis that tracks the whole constructor body.
10 months ago
Siegfried Pammer
cb48768b6d
Fix #3610 : Add more primary constructor test cases.
10 months ago
Siegfried Pammer
46c99f1a21
Fix #3452 : More bugs with primary constructors.
10 months ago
Siegfried Pammer
9c8d1e48d9
Many thanks to @sonyps5201314 for providing the test cases and a suggested fix, which inspired these changes.
...
Various improvements regarding primary constructor decompilation, including:
- introduce `HasPrimaryConstructor` property in the AST, as there is a difference between no primary constructor and a parameterless primary constructor
- improved support for inherited records and forwarded ctor calls
- exclude non-public fields and properties in IsPrintedMember
- introduce an option to always make the decompiler emit primary constructors, when possible
10 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
1 year ago
Siegfried Pammer
453fc06e02
Fix #3406 : Wrong decompilation of record struct without primary constructor.
1 year ago
Siegfried Pammer
2043e5dd6f
Add support for C# 12 primary constructors.
2 years ago
Siegfried Pammer
4bf9487ecd
Remove IsRef, IsOut and IsIn flags from IParameter and Replace ParameterModifiers with ReferenceKind.
2 years ago
Siegfried Pammer
ca78d4a14d
Use MetadataFile instead of PEFile in TypeSystem.
3 years ago
Andrew Crawley (US - DIAGNOSTICS)
7451b21650
Fix decompilation of record with missing base type
...
This commit updates `RecordDecompiler` to avoid a null ref when the
decompiler is unable to determine the base type of a record (e.g.
because the base type is defined in another assembly that is not
loaded).
3 years ago
Siegfried Pammer
ae0e83f0c4
Records: Support new EqualityContract pattern.
4 years ago
Siegfried Pammer
1f1e95d7a1
Update RecordDecompiler for Roslyn 4.3.0.
4 years ago
Daniel Grunwald
08ceffc3ad
Upgrade dotnet-format from version 5 to the version included with the .NET (6) SDK.
4 years ago
Siegfried Pammer
d248867302
Add support for C# 10 record structs.
4 years ago
SilverFox
1367e7ba95
Add support for `in parameters` in primary ctor of records
5 years ago
SilverFox
11b44e53b7
Add support for attributes of field/property in primary ctor of records
5 years ago
SilverFox
58bed656cd
Fix records support for Roslyn 4.0.0-3.final
5 years ago
SilverFox
89eebc387a
Fix #2475 : Fix support for records with custom copy ctor
5 years ago
SilverFox
d0d70a6496
Fix #2475 : Add support for sealed records and records with interface
5 years ago
Daniel Grunwald
55ab2a1739
Adjust RecordDecompiler to changes in Roslyn 3.10.0
5 years ago
Daniel Grunwald
bd9aabeae2
Update to dotnet-format 5.1.225507.
...
This makes the formatting expected by our CI consistent with that generated by VS2019.9.
5 years ago
Siegfried Pammer
032bd5356a
Fix formatting
6 years ago
Siegfried Pammer
a5858f1694
Add support for primary constructor syntax.
6 years ago
Daniel Grunwald
be9871981a
Records: Detect compiler-generated Equals() in derived records.
6 years ago
Daniel Grunwald
d9874380cd
Records: support generic records
6 years ago
Daniel Grunwald
0bf6d552e0
Records: support for fields.
6 years ago
Daniel Grunwald
a960216d5f
Add test case for simple records.
6 years ago
Daniel Grunwald
e02c4789f1
Records: detect copy constructor
6 years ago
Daniel Grunwald
c95f75d3bc
Records: detect whether GetHashCode is compiler-generated
6 years ago
Daniel Grunwald
648e7f9f87
Records: hide generated Equals() method
6 years ago
Daniel Grunwald
4fefd5f530
Records: detect when PrintMembers() is compiler-generated in derived records
6 years ago
Daniel Grunwald
500317a9e8
Records: detect when PrintMembers() is compiler-generated
...
Only for the simple case: record having only (auto-)properties but no fields and no inheritance.
6 years ago
Daniel Grunwald
0babcc5fe4
Records: detect when ToString() is compiler-generated
6 years ago
Daniel Grunwald
90ce77f400
Omit EqualityContract if it's automatically generated.
6 years ago