Closed bmaslakov closed 6 years ago
As a side note, it'd be also great to have Some(123)
instead of Some(value=123)
I guess the only use case where com.gojuno.koptional.None@7ce026d3
is useful is dealing with scenarios like https://youtrack.jetbrains.com/issue/KT-14540 when you accidentally end up having multiple instances of object
But I'd still merge this PR :)
Fixed the line separator and added a cleaner version of Some.toString
.
As for KT-14540, I think the proper workaround would be to add None.equals(other) = other is None
, but I think it is really out of scope for this PR.
Did my best :)
@ming13 @nostra13 PTAL
MAYBE WE EVEN NEED TO BUMP MAJOR VERSION
I often use this class for debugging, and calling something like
println("sessionId=$optional")
gives this:Why don't we override
toString
? :)