Join Slack
Powered by
Why is String with Int concatenation not symmetric...
# stdlib
h
holgerbrandl
06/07/2016, 11:32 AM
Why is String with Int concatenation not symmetric?
Copy code
println("test" + 1) println( 1 + " test")
The second line is invalid code because String defines an generic plus
kotlin.String.plus
whereas Integer does not do so. This feels odd, especially since Java does both.
4
Views
Open in Slack
Previous
Next