r/mAndroidDev • u/programadorthi • Mar 23 '26
Billion Dollar Mistake Null also Null
Kotlin is really a null-safety language. It allows you create a silent bug that should be avoided:
null.also {
println("Hello production silent null bug")
}
0
Upvotes
View all comments
Show parent comment
2
u/Zhuinden DDD: Deprecation-Driven Development Mar 24 '26
This isn't C++
This is literally the code
If you expect this to do any "null safety shenanigans" that's kinda on you ngl
If it was "null-safe" it'd be
<T: Any>.