Area-IDEBugFeature - IDE0059help wanted
倉庫指標
- Star
- (20,414 star)
- PR 合併指標
- (平均合併 6天 17小時) (30 天內合併 256 個 PR)
描述
Version Used: Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.3.3, TargetFramework net6.0
Steps to Reproduce:
int count;
try
{
if (0 == 1) { } // comment out to "fix" suggestion
Console.WriteLine(); // comment out to "fix" suggestion
}
finally
{
count = 3;
}
if (count == 0) { }
Expected Behavior: Do not delete my variable assignment.
Actual Behavior: Wants to break my code. If I follow the suggestion it removes the variable. It can alter the code semantics by deleting necessary assignments. In my example the compiler will error because count was not assigned but it could be more subtle. If you comment out either statement in the try block, the suggestion will disappear.