dotnet/roslyn
GitHub で見る"Unassigned local" error for reference to "out var" in lambda with error parameter
Open
#17,225 opened on 2017年2月17日
Area-CompilersBugConcept-Diagnostic Clarityhelp wanted
説明
Reports CS0165 for z > 0:
using System;
class C
{
static void Main()
{
G((x, y) => y > 0 && F(out var z) && z > 0);
}
static bool F(out int i)
{
i = 0;
return true;
}
static void G(Func<int, bool> f, object o) { }
static void G(Func<int, bool> f, object x, object y) { }
}
(6,9): error CS1501: No overload for method 'G' takes 1 arguments
(6,46): error CS0165: Use of unassigned local variable 'z'