✅ Compiler limitation or is this logic wrong?
I'd expect the
return true statement to work but I get "Parameter 'format' must be assigned upon exit". The method returns bool and has an out parameter called format.gotogotoformat = input.AsSpan(input.Length - 2, 2) switch
{
"KB" => MemoryFormatType.KiloByte1024,
"MB" => MemoryFormatType.GigaByte1024,
"TB" => MemoryFormatType.TeraByte1024
_ => null
};
return format is not null;