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
Deprecate numeric conversions that lose precision (e.g., Long to Double) #8679
Conversation
Int to Float, Long to Float and Long to Double are dangerous conversions and should never be done automatically.
A deprecation warning is emitted eagerly, even during silent typechecking.
e2cd9f5
to
fdcd611
Compare
Maybe escalate to error under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @smarter & @som-snytt
@lrytz thanks for improving the comment. |
Except that it actually doesn't warn on the example I put in the comment 😄 (logged at scala/bug#10773 (comment)) |
@lrytz it's a long getting stuck in the data array. Also demonstrates that, like the |
Is there a compiler switch to turn the warning off? |
|
I recommend your favorite beverage and armchair and |
@som-snytt @SethTisue it's heart-warming to see you both get up in the morning and be thinking about |
Int to Float, Long to Float and Long to Double are dangerous conversions and should never be done automatically.
Example:
Rebase #7405 and use ordinary warning system.