Problem
C# partial method signature customization can generate invalid or uncompilable code in some paths.
Observed issues:
- Method modifiers can be emitted in invalid order when the custom partial declaration includes
virtual, e.g. public partial virtual ... instead of public virtual partial ....
- The generic late customization path can update the generated method signature with custom parameter names, while the already-built method body still references the old generated parameter names.
- Async partial implementations need to preserve generated
async because custom partial declarations cannot include async without a body.
Expected behavior
When a generated method matches a custom partial method declaration:
- emitted modifiers should be valid C#;
- generated bodies should reference the final parameter names;
- async generated implementations should remain async;
- optional parameter metadata should continue to come from the custom partial declaration.
Notes
This is separate from the broader parameter ownership cleanup tracked by #11244.
Problem
C# partial method signature customization can generate invalid or uncompilable code in some paths.
Observed issues:
virtual, e.g.public partial virtual ...instead ofpublic virtual partial ....asyncbecause custom partial declarations cannot includeasyncwithout a body.Expected behavior
When a generated method matches a custom partial method declaration:
Notes
This is separate from the broader parameter ownership cleanup tracked by #11244.