You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support default value for structs, such as default(CancellationToken) #817
changed the title [-]Default value for default(CancellationToken)[/-][+]Support default value for structs, such as default(CancellationToken)[/+]on May 25, 2022
Thanks for the report, I managed to reproduce this with something like:
publicvoidTest(CancellationTokentoken=default);
A potential fix would be to add some sort of check to DefaultArgBuilder.ToExpression in the DLR (don't think this is correct but something similar may work):
Thanks, can we do this without modified the IronPython Souce Code?
I don't have any workaround, I think you will have to explicitly pass in the argument CountDocuments[BsonDocument]("collection", cancellationToken=CancellationToken.None).
Activity
[-]Default value for default(CancellationToken)[/-][+]Support default value for structs, such as default(CancellationToken)[/+]slozier commentedon May 27, 2022
Thanks for the report, I managed to reproduce this with something like:
A potential fix would be to add some sort of check to
DefaultArgBuilder.ToExpressionin the DLR (don't think this is correct but something similar may work):bnuzhouwei commentedon May 27, 2022
Thanks, can we do this without modified the IronPython Souce Code?
slozier commentedon May 28, 2022
I don't have any workaround, I think you will have to explicitly pass in the argument
CountDocuments[BsonDocument]("collection", cancellationToken=CancellationToken.None).