Open ashahabov opened 2 years ago
To add to this it appears to struggle with Type-testing operators: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast
namely:
if (thing is IInterface newTypeCheckedVariable)
will result in the same error.
Facing the same problem on 1.5.0
Use of unassigned local variable 'typeName' (Source code: typeName)
public static string GetGenericTypeName(this Type type)
{
string typeName;
if (type.IsGenericType)
{
var genericTypes = string.Join(",", type.GetGenericArguments().Select(t => t.Name).ToArray());
typeName =
$"{type.Name.Remove(type.Name.IndexOf('`', StringComparison.OrdinalIgnoreCase))}<{genericTypes}>";
}
else
{
typeName = type.Name;
}
return typeName;
}
Describe the bug The Stryker raises "Use of unassigned local variable..." warning message and asks to report this on GitHub.
Logs
Expected behavior That file can be mutated.
Desktop (please complete the following information):
Additional context
The source code:
The source code with line numbers: