【问题标题】:V3125 False PositiveV3125 误报
【发布时间】: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


    【解决方案1】:

    确实,这是误报。我们会研究它并尝试在下一个版本中修复它(实际上是下一个版本之后的版本,因为我们计划在大约一周内发布一个新版本,所以修复不会成功)。

    感谢您的提示!

    【讨论】:

      猜你喜欢
      • 2017-09-26
      • 1970-01-01
      • 2011-07-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-20
      • 2019-01-20
      • 2021-01-18
      • 1970-01-01
      相关资源
      最近更新 更多