Version Used: 16.7-p3.1
There should be no diagnostics here. Any change results in different runtime behavior.
_ denotes a faded span.
class C
{
bool M(object obj)
{
// IDE0004: Cast is redundant
// ______ ______ _______ _______ ________ ______ _______
return obj is 0 or (uint)0 or (long)0 or (ulong)0 or (short)0 or (ushort)0 or (byte)0 or (sbyte)0 or (float)0
// ________ _________ __________________
or (double)0 or (decimal)0 or (AttributeTargets)0;
}
}
(All but short, ushort, byte, and sbyte would normally be written using numeric literal suffixes rather than explicit casts.)
Version Used: 16.7-p3.1
There should be no diagnostics here. Any change results in different runtime behavior.
_denotes a faded span.(All but short, ushort, byte, and sbyte would normally be written using numeric literal suffixes rather than explicit casts.)