Make stableNull public in the stdlib#25886
Conversation
|
If we're making stuff public for explicit nulls, should |
|
I wouldn't make |
|
so this is i guess just as safe as |
|
It's not "not at all". Both require you to provide the reasoning/guarantee for one property. Then they do the rest of the job.
If you provide those guarantees, then they guarantee the rest of the safety.
|
|
For |
Then, we can guarantee: if a field/variable has been initialized, it will never become null again. |
|
For question about Kotlin's behaviour: no, they don't track mutable fields for smart cast. class A(var s: String?)
fun main() {
val a = A("a")
if (a.s != null) {
println(a.s.length) // rejected by smart cast: 's' is a mutable property that could be mutated concurrently
}
}cc @odersky |
|
Core agreed today that this can become public, modulo a possible name change. |
The PR removes
private[scala]fromstableNulldefinition.It was first introduced by #23528 for 3.8 stdlib migration. We want to make it public as part of explicit nulls.
How much have you relied on LLM-based tools in this contribution?
Minimally for document polishing
How was the solution tested?
It was already tested by #23528
Note
Need a minor release