-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ignore conditional block when condition is CancellationToken.IsCancellationRequested #61
Comments
@skarllot not sure that ISG should care about this issue. Imagine more complex if statements like I guess this case is the case for |
On second thought I believe you are right, I prefer using compiler conditional. |
Great issue. The source generator has already picked an aggressive/advanced way of dealing with such issues. The goal is to make is as close to the code one would write by hand. For example if it sees if (true)
{
progress.Report(1);
} the entire if block will be dropped. This approach did land us in a bit of a hot water, for example in #45 (comment) I think that the example above should be dropped without forcing the user to invoke When combined with If there's Looking at code occurrences under
|
This fix is available in 1.3.35. Let me know how this works out. At the end not unrolling the if block because you could have a duplicate variable: if (true)
{
var myVar = 1;
}
if (true)
{
var myVar = 1;
} Taking either myVar out of scope would cause a compilation issue. |
If the asynchronous method has a conditional block testing if CancellationToken is canceled that block should be ignored.
The text was updated successfully, but these errors were encountered: