Skip to content

Conversation

@noti0na1
Copy link
Member

@noti0na1 noti0na1 commented Nov 30, 2025

Fix #24599

We remove | Null from implicit BigDecimal conversion similar to BigInt.

// For the following function, both the parameter and the return type are non-nullable.
// However, if a null reference is passed explicitly, this method will still return null.
// We intentionally keep this signature to discourage passing nulls implicitly while
// preserving the previous behavior for backward compatibility.

/** Implicit conversion from `java.math.BigDecimal` to `scala.BigDecimal`. */
implicit def javaBigDecimal2bigDecimal(x: BigDec): BigDecimal = mapNull(x, apply(x))

/** Implicit conversion from `java.math.BigInteger` to `scala.BigInt`. */
implicit def javaBigInteger2bigInt(x: BigInteger): BigInt = mapNull(x, apply(x))

I have double-checked all other implicit functions in stdlib, and there is no nullable signature left anymore.

@noti0na1 noti0na1 requested a review from a team as a code owner November 30, 2025 23:38
@noti0na1 noti0na1 added this to the 3.8.0 milestone Nov 30, 2025
@noti0na1 noti0na1 added backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. area:nullability labels Nov 30, 2025
@noti0na1 noti0na1 requested a review from hamzaremmal November 30, 2025 23:41
@noti0na1 noti0na1 merged commit 250facc into scala:main Dec 1, 2025
46 checks passed
@noti0na1 noti0na1 deleted the fix-24599 branch December 1, 2025 11:39
@WojciechMazur WojciechMazur added backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels Dec 1, 2025
WojciechMazur added a commit that referenced this pull request Dec 2, 2025
…sion similar to BigInt" to 3.8.0 (#24613)

Backports #24600 to the 3.8.0-RC3.

PR submitted by the release tooling.
[skip ci]
@WojciechMazur WojciechMazur added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:nullability backport:done This PR was successfully backported.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression for opaque types + -Yexplicit-nulls

3 participants