【发布时间】:2019-01-17 10:52:50
【问题描述】:
PVS Studio 抛出 V3125:“control.Parent”对象在针对 null 进行验证后被使用。检查行:11、9。
using System.Windows.Forms;
namespace V3125_False_Positive
{
static class Program
{
static void Main()
{
if (new Control() is Control control && control.Parent != null)
{
string parentname = control.Parent.Name;
}
}
}
}
这是误报吗?
【问题讨论】:
标签: pvs-studio