Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE0004 false positive when using GetType() #75424

Closed
nalka0 opened this issue Oct 7, 2024 · 0 comments · Fixed by #76102
Closed

IDE0004 false positive when using GetType() #75424

nalka0 opened this issue Oct 7, 2024 · 0 comments · Fixed by #76102
Assignees
Labels
Area-IDE Feature - IDE0004 Remove unnecessary cast
Milestone

Comments

@nalka0
Copy link

nalka0 commented Oct 7, 2024

Version Used:

Visual Studio Community 2022 version 17.11.4

Steps to Reproduce:

var x = ((byte)3).GetType();

In the above snippet x represents typeof(byte) with the cast and would represent typeof(int) without it

Diagnostic Id:

"IDE0004: Cast is redundant"

Expected Behavior:

No IDE0004 on the above snippet

Actual Behavior:

IDE0004 happens on the above snippet

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 7, 2024
@deepakrathore33 deepakrathore33 added Feature - IDE0004 Remove unnecessary cast and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 16, 2024
@arunchndr arunchndr added this to the Backlog milestone Oct 28, 2024
@CyrusNajmabadi CyrusNajmabadi self-assigned this Nov 26, 2024
@CyrusNajmabadi CyrusNajmabadi modified the milestones: Backlog, 17.13 Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature - IDE0004 Remove unnecessary cast
Projects
None yet
4 participants