Version Used: Version 16.6.0 Preview 2.0 (master) (private branch build with unrelated changes)
Steps to Reproduce:
enum E { A, B }
class C
{
bool M(int i)
{
return (E)i switch
// ~~~ IDE0004 cast is redundant
{
E.A => true,
_ => false
};
}
}
Expected Behavior:
Cast is not flagged as redundant.
Actual Behavior:
Cast is flagged as redundant. Removing it introduces CS0266 on E.A in switch case.
Version Used: Version 16.6.0 Preview 2.0 (master) (private branch build with unrelated changes)
Steps to Reproduce:
Expected Behavior:
Cast is not flagged as redundant.
Actual Behavior:
Cast is flagged as redundant. Removing it introduces CS0266 on
E.Ain switch case.