Conversation
|
As a side note, it'd be also great to have |
|
|
||
| data class Some<out T : Any>(val value: T) : Optional<T>() | ||
| object None : Optional<Nothing>() | ||
| object None : Optional<Nothing>() { |
There was a problem hiding this comment.
nit: maybe add an empty line between classes now?
With additional code it now looks a little bit crumpled :)
|
I guess the only use case where But I'd still merge this PR :) |
|
Fixed the line separator and added a cleaner version of |
artem-zinnatullin
left a comment
There was a problem hiding this comment.
LGTM, let's add tests? :)
| data class Some<out T : Any>(val value: T) : Optional<T>() | ||
| object None : Optional<Nothing>() | ||
| data class Some<out T : Any>(val value: T) : Optional<T>() { | ||
| override fun toString() = "Some($value)" |
There was a problem hiding this comment.
Let's add simple unit tests btw?
| } | ||
|
|
||
| object None : Optional<Nothing>() { | ||
| override fun toString() = "None" |
|
Did my best :) |
|
|
||
| } | ||
|
|
||
| context("Some<Object>.toString") { |
There was a problem hiding this comment.
This one seems unnecessary, but we can leave it :)
nostra13
left a comment
There was a problem hiding this comment.
I've never gone to review before but this time I'm definitely going to vote for Tostringin. Candidate for release!
|
MAYBE WE EVEN NEED TO BUMP MAJOR VERSION |
Add None.toString (gojuno#16)
I often use this class for debugging, and calling something like
println("sessionId=$optional")gives this:Why don't we override
toString? :)