In the following code
class C
{
void M()
{
var i = 1;
C x = i switch
{
0 => new A(),
1 => new B(),
_ => throw new ArgumentException(),
};
}
}
class A : C { }
class B : C { }
The switch expression has no "natural" type, as there is no common type among the expressions. It does, however, have a ConvertedType of C due to the target-typed switch expression conversion.
However, the semantic model currently reports that the switch expression has the type C. It should return null for the type.
/cc @allisonchou