Skip to content

Parameterless MethodBody Constructors#641

Merged
Washi1337 merged 4 commits into
developmentfrom
feature/parameterless-method-bodies
Jun 8, 2025
Merged

Parameterless MethodBody Constructors#641
Washi1337 merged 4 commits into
developmentfrom
feature/parameterless-method-bodies

Conversation

@Washi1337

@Washi1337 Washi1337 commented Jun 7, 2025

Copy link
Copy Markdown
Owner

Removes owner parameters from CilMethodBody, NativeMethodBody and UnresolvedMethodBody, allowing them to be used in C# object initializer syntax. Assigning to MethodDefinition::MethodBody may now throw an ArgumentException when the body was already assigned to another method body.

Before:

MethodDefinition method = ...;
var body = new CilMethodBody(owner: method)
{
   Instruction = { ... }
};
method.CilMethodBody = body;

After:

MethodDefinition method = ...;
method.CilMethodBody = new CilMethodBody
{
   Instruction = { ... }
};

@Washi1337 Washi1337 added this to the 6.0.0 milestone Jun 7, 2025
@Washi1337 Washi1337 added enhancement dotnet Issues related to AsmResolver.DotNet labels Jun 7, 2025
@Washi1337 Washi1337 merged commit db9b208 into development Jun 8, 2025
7 checks passed
@Washi1337 Washi1337 deleted the feature/parameterless-method-bodies branch June 8, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dotnet Issues related to AsmResolver.DotNet enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant