Skip to content

Incorrect IDE004 "Cast is redundant" hint #11008

@IharBury

Description

@IharBury

Version Used:
Microsoft Visual Studio 2015 14.0.25123.0 Update 2
.NET Framework 4.6.01038

Steps to Reproduce:
Write code:

static class Program
{
  static readonly long x = -(long)int.MinValue;
}

Expected Behavior:
No compiler hints

Actual Behavior:
IDE0004 Cast is redundant

If the cast is removed:
CS0220 The operation overflows at compile time in checked mode

Metadata

Metadata

Labels

Area-IDEBughelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions