Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

And the Useless Constructor Overload Award goes to... #6763

Open
daggmano opened this issue Mar 17, 2024 · 1 comment
Open

And the Useless Constructor Overload Award goes to... #6763

daggmano opened this issue Mar 17, 2024 · 1 comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@daggmano
Copy link

Version

Bot Framework DotNet SDK 4.22.2

Describe the bug

The constructor for a TeamsChannelAccount object has two overloads, both filled with optional parameters. The combination of these constructors means that, in practice, NONE (or perhaps only one) of the parameters are actually optional.

To Reproduce

  1. Create a TeamsChannelAccount object by only passing in an id value (first parameter).
  2. Attempt to build.
  3. See error.

Expected behavior

Since all parameters are optional, I would expect to be able to pass in 1, 2, 3, 4, 5, 6, 7 or 8 parameters and have a successful build.

Additional context

See overloads in libraries/Microsoft.Bot.Schema/Teams/TeamsChannelAccount.cs. The constructor in lines 45-58 is completely superfluous and can only cause problems - unless there's some secret understanding I'm missing?

@daggmano daggmano added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Mar 17, 2024
@tracyboehrer
Copy link
Member

@daggmano Oh come now. Perhaps an honorable mention, but the actual award? We'll take a look. As long as it isn't breaking we can perhaps get back on your "meh, they're ok" list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants