dotnet/roslyn

IDE0059 Incorrectly reported for out arguments

オープン

#58,564 opened on 2022/01/03

 (3 件のコメント) (1 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEBugFeature - IDE0059help wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

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'

コントリビューターガイド