Reporter | Marcin Smółka (msmolka) |
---|---|
Created | Mar 22, 2011 6:50:37 PM |
Updated | Jan 31, 2012 9:27:21 AM |
Priority | Normal |
Type | Bug |
Fix versions | Next |
State | Submitted |
Assignee | Alexey Kuptsov (alexey.kuptsov) |
Subsystem | Quick Fixes |
Affected versions | 5.1.2, 5.1.3 |
Fixed in build | No Fixed in build |
Resharepr produces wrong code after quick fix apply:
following code:
private Expression ParsePrimary()
{
Expression expr = this.ParsePrimaryStart();
while (true)
{
if (this.token.Id == TokenId.Dot)
{
this.NextToken();
expr = this.ParseMemberAccess(null, expr);
}
else if (this.token.Id == TokenId.OpenBracket)
{
expr = this.ParseElementAccess(expr);
}
else
{
break;
}
}
return expr;
}
allow quick fix - convert to switch. But produced code is wrong. Loop is never exiting.
following code:
private Expression ParsePrimary()
{
Expression expr = this.ParsePrimaryStart();
while (true)
{
if (this.token.Id == TokenId.Dot)
{
this.NextToken();
expr = this.ParseMemberAccess(null, expr);
}
else if (this.token.Id == TokenId.OpenBracket)
{
expr = this.ParseElementAccess(expr);
}
else
{
break;
}
}
return expr;
}
allow quick fix - convert to switch. But produced code is wrong. Loop is never exiting.