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

binderName is Async when binder.Name ends with Async #14405

Closed
vjacquet opened this issue Sep 29, 2023 · 1 comment · Fixed by #14407
Closed

binderName is Async when binder.Name ends with Async #14405

vjacquet opened this issue Sep 29, 2023 · 1 comment · Fixed by #14407

Comments

@vjacquet
Copy link
Contributor

if (binderName.EndsWith("Async", StringComparison.Ordinal))
{
binderName = binder.Name[^"Async".Length..];
}

Unless I am mistaken, the intent of the code is to trim the Async suffix, yet it does the opposite, keeping only the Async

var binderName = "TestAsync";
if (binderName.EndsWith("Async", StringComparison.Ordinal))
{
    binderName = binderName[^"Async".Length..];
    Debug.Assert(binderName != "Async", "binderName is set to Async");
}

Line 41 should be

    binderName = binderName[..^"Async".Length];
@hishamco
Copy link
Member

You are right, could you please send a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants