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

Redundant Cast incorrect for SimpleArguments #44516

Closed
paul1956 opened this issue May 22, 2020 · 1 comment · Fixed by #45102
Closed

Redundant Cast incorrect for SimpleArguments #44516

paul1956 opened this issue May 22, 2020 · 1 comment · Fixed by #45102
Labels
Area-IDE Bug IDE-CodeStyle Built-in analyzers, fixes, and refactorings Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@paul1956
Copy link
Contributor

Version Used:
VS 16.6 and 16.7 Preview 1
Steps to Reproduce:

Dim X As New Point(CInt(Math.Floor(1.1)), 1)
Dim Y As New Point(CInt(1.1), 1)

Expected Behavior:
No Cast is Redundant messages
Actual Behavior:
Cast is Redundant messages and if you follow suggestion you get error BC30512 Option Strict On disallows implicit conversions from 'Double' to 'Integer'. This happens for all Math functions that return non integers and constants.

@jinujoseph jinujoseph added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it IDE-CodeStyle Built-in analyzers, fixes, and refactorings labels May 27, 2020
@jinujoseph jinujoseph added this to the Backlog milestone May 27, 2020
@Youssef1313
Copy link
Member

To me, a good starting point to debug this seem to be from here

@paul1956 paul1956 changed the title CInt Redundant Cast incorrect for Math functions and constants Redundant Cast incorrect for SimpleArguments Jun 12, 2020
CyrusNajmabadi added a commit that referenced this issue Jul 6, 2020
FIx Redundant Cast incorrect for SimpleArguments #44516
@sharwell sharwell modified the milestones: Backlog, 16.8.P1 Jul 28, 2020
@sharwell sharwell added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed help wanted The issue is "up for grabs" - add a comment if you are interested in working on it labels Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug IDE-CodeStyle Built-in analyzers, fixes, and refactorings Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants