Skip to content

Disambiguate WithShawarma overloads#16

Merged
centeredgebot[bot] merged 1 commit into
mainfrom
withshawarma-overload-resolution
Mar 6, 2026
Merged

Disambiguate WithShawarma overloads#16
centeredgebot[bot] merged 1 commit into
mainfrom
withshawarma-overload-resolution

Conversation

@brantburnett
Copy link
Copy Markdown
Collaborator

Motivation

The current overloads of WithShawarma leave ambiguity in overload resolution, in particular if you want to call with no parameters or with only an endpoint name.

Modifications

Add overloads and change defaults in a way that is both source and binary backward compatible. Also eliminate a minor heap allocation in the case where autoStart is passed as false by reusing the shared default options.

Motivation
----------
The current overloads of WithShawarma leave ambiguity in overload
resolution, in particular if you want to call with no parameters or
with only an endpoint name.

Modifications
-------------
Add overloads and change defaults in a way that is both source and
binary backward compatible. Also eliminate a minor heap allocation in
the case where `autoStart` is passed as `false` by reusing the
shared default options.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the WithShawarma extension method overload set to avoid ambiguous overload resolution (notably for parameterless calls and calls specifying only an endpoint name) while keeping behavior source/binary compatible and reducing allocations in the common autoStart: false path.

Changes:

  • Added overloads for WithShawarma()/WithShawarma(bool autoStart) and WithShawarma(ShawarmaOptions? options) to make common call patterns unambiguous.
  • Adjusted the existing endpoint-based overload signatures to remove optional parameters that contributed to ambiguity.
  • Reused ShawarmaOptions.Default when autoStart is false to avoid allocating a new options instance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brantburnett brantburnett marked this pull request as ready for review March 6, 2026 13:23
@brantburnett
Copy link
Copy Markdown
Collaborator Author

/merge

@centeredgebot centeredgebot Bot merged commit 0fd3889 into main Mar 6, 2026
10 checks passed
@centeredgebot centeredgebot Bot deleted the withshawarma-overload-resolution branch March 6, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants