PVS Studio throws V3137: The 'funclist' variable is assigned but is not used until the end of the function. Program.cs 13
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace V3137_False_Positive
{
class Program
{
static void Main()
{
List<(string name, Func<Task> func)> funclist;
funclist = new List<(string name, Func<Task> func)>
{
("Test", new Func<Task>(() => Task.CompletedTask)),
};
foreach ((string name, Func<Task> func) in funclist)
{
var task = func;
}
}
}
}
Is this a false positive?
Looks like a false positive. We'll try fixing it in one of the future releases.
Also, false-positive reports are not the entirely right format of questions for stackoverflow, so consider sending them directly to PVS-Studio support at [email protected] or https://www.viva64.com/en/about-feedback/.
Thanks for your feedback!