It doesn't? `x?.toString()` can return `null`, `x....
# announcements
k
It doesn't?
x?.toString()
can return
null
,
x.toString where x:Any?
will return
"null"
instead.
r
You misunderstood. There is a defined
Copy code
fun Any?.toString(): String
in the standard library
k
Yes, that's my second example.
r
Yes, and @Dias was referring to the definition
Any?.toString()
, not to the call
x?.toString()
k
Hmm, I guess I see what he means. I meant the
?.
at the callsite simple smile
r
Indeed. I think this distinction between definition and call site is more confusing than the returned value 🙂
k
Agreed!