Skip to content

[http-client-csharp] Fix partial method customization parameter rebinding #11245

Description

@ArcturusZhang

Problem

C# partial method signature customization can generate invalid or uncompilable code in some paths.

Observed issues:

  1. 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 ....
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingemitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharp

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions