-
-
Notifications
You must be signed in to change notification settings - Fork 773
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
False positives on UnsafeCast on AppVeyor (Windows?) only #1137
Comments
This has come up previously: #926 |
Hm I missed that, sorry. In this case though those are plain false positives... |
Oh sorry, I meant more that the difference in results between *nix and Windows had come up previously (but again with UnsafeCast). |
Ah yeah no problem mate :) I don't know what makes that rule so platform-reliant... Haven't had time to look at the implementation. I plan on doing, but I really have little time these days |
The implementation just uses a function provided by the kotlin compiler, so I guess we need to track this down on the kotlin side. Thanks for the linking! |
I've looked into this more closely - the current check provided by detekt does not respect smart casts. The compiler's implementation only checks the format of the expression and looks for the To fix this so the check respects smart casts I expect we need type and symbol resolution. Didn't look into differences between Windows & Linux. |
Steps to Reproduce (for bugs)
See https://github.com/arturbosch/detekt/blob/fab854abc1d1efdc6218dc8e5cf486f6fb194de2/detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/ThresholdedCodeSmellAssert.kt
On *nix (my macOS machine, and on Travis' CI machines) I get no warnings.
On Windows (AppVeyor) we get these warnings:
The warnings on Windows are incorrect, as those casts are all guarded behind an assertion. Neither the compiler nor the IDE complain about those.
Your Environment
The text was updated successfully, but these errors were encountered: