Version Used:
Microsoft Visual Studio Community 2019
Version 16.8.4
Steps to Reproduce:
var x = (IntPtr)long.MaxValue; // Only works in 64bit platform. OverflowException will be thrown in 32bit platform
//var y = (int)x; // OverflowException
var y = (int)(nint)x; // IDE0004 says (nint) is redundant
Expected Behavior:
(nint) is not reported as redundant
Actual Behavior:
(nint) is reported as redundant
Version Used:
Microsoft Visual Studio Community 2019
Version 16.8.4
Steps to Reproduce:
Expected Behavior:
(nint)is not reported as redundantActual Behavior:
(nint)is reported as redundant