Hello Boris, Thank you for the sample! It's a known problem that ReSharper can incorrectly find unused variables, which are actually used, inside "while(true){}" statements. We're planning to fix it in ReSharper 2.0.
Thanks, Andrew Serebryansky
Got it. Here is the minimal code example. Note try/catch and while(true).
public void Run() { try { while(true) { foreach(Item item in collection) item.Do(); } } catch(Exception) { } } private ItemCollection collection = new ItemCollection();
Is this reproducable only in particular place of code or you can reproduce
it on a small example?
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Got it. Here is the minimal code example. Note try/catch
and while(true).
public void Run()
{
try
{
while(true)
{
foreach(Item item in collection)
item.Do();
}
}
catch(Exception)
{
}
}
private ItemCollection collection = new ItemCollection();
Hello Boris,
Thank you for the sample! It's a known problem that ReSharper can incorrectly find unused variables, which are actually used, inside "while(true){}" statements. We're planning to fix it in ReSharper 2.0.
Thanks,
Andrew Serebryansky