Skip to content

Update unified-types.md #3046

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

Merged
merged 1 commit into from
Oct 26, 2024
Merged

Update unified-types.md #3046

merged 1 commit into from
Oct 26, 2024

Conversation

shitpoet
Copy link
Contributor

Add phrase:

Note that Long to Float conversion is deprecated in new versions of Scala, because of the potential precision lost.

Add phrase:
> Note that `Long` to `Float` conversion is deprecated in new versions of Scala, because of the potential precision lost.
Copy link
Member

@bishabosha bishabosha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! While this is technically correct, perhaps its better to fix the example to another conversion that isn't lossy

@som-snytt
Copy link
Contributor

I had to visit the web page to understand the issue. I think bishabosha's previous edit .toFloat breaks the text, which is trying to show how easy and wonderful numeric widening is. Instead, it should show the types and also trumpet Scala's "gun buy-back program" for footguns.

@SethTisue
Copy link
Member

Merging since this is strictly an improvement, but it would be nice if a volunteer improved it further, as per above discussion.

@SethTisue SethTisue merged commit 0ab41a6 into scala:main Oct 26, 2024
fResult pushed a commit to fResult/docs.scala-lang that referenced this pull request Oct 27, 2024
Add phrase:
> Note that `Long` to `Float` conversion is deprecated in new versions of Scala, because of the potential precision lost.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants