https://kotlinlang.org logo
#announcements
Title
# announcements
n

nish

11/05/2017, 3:16 AM
Thanks
r

rcgonzalezf

11/05/2017, 3:21 AM
FWIW it’s the same on Java:
class Main { public static void main(String[] args) { String s3 = null + “test”; System.out.println(s3); } }
// prints nulltest
n

nish

11/05/2017, 3:28 AM
Yeah I know. I don’t think it’s a good idea.
It seems to be inconsistent behavior for nullable types
r

rcgonzalezf

11/05/2017, 3:50 AM
I guess that potentially you could create an extension function for java.lang.String.valueOf: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#valueOf(java.lang.Object) that seems to be the root of that issue.
5 Views