dotnet/roslyn

IDE0059 Incorrectly reported for out arguments

开放

#58,564 创建于 2022年1月3日

 (3 条评论) (1 个反应) (0 位负责人)C# (4,257 个派生)batch import
Area-IDEBugFeature - IDE0059help wanted

仓库指标

星标
 (20,414 个星标)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 256 个 PR)

描述

Version Used: 6.0

Steps to Reproduce:

class Test
{
		public static void Foo ()
		{
			int i;
			OutFoo (out i, 9); // error IDE0059: Unnecessary assignment of a value to 'i'
			OutFoo (out i, i);
            Console.WriteLine (i);
		}

		public static void OutFoo (out int i, int arg)
		{
			i = ++arg;
		}
}

Expected Behavior:

No IDE0059 reported

Actual Behavior:

error IDE0059: Unnecessary assignment of a value to 'i'

贡献者指南