botbuilder-dotnet
botbuilder-dotnet copied to clipboard
And the Useless Constructor Overload Award goes to...
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
- Create a
TeamsChannelAccount
object by only passing in anid
value (first parameter). - Attempt to build.
- 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 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.
This will be resolved in next major release.