Beef
Beef copied to clipboard
Incorrect "out parameter must be assigned" error
The code below only compiles if you uncomment the line after the while loop. However, even the compiler itself knows this code is useless since it will never reach that point.
public static bool Test(out int item)
{
int i = 0;
while (true)
{
if (++i == 10)
{
item = default;
return true;
}
}
//item = 10; // WARN: Unreachable code.
}
This issue might be related: https://github.com/beefytech/Beef/issues/1870 Tested with: https://github.com/beefytech/Beef/commit/aa4f9f7dfa8f2ad81a6807b87192516d0ce72a1a