Safe call on a non-null receiver will have nullable type in future releases.
Right now safe call on non nullable receiver has not null type:
"hello"?.length
has type Int
In future releases all safe calls will have nullable type:
"hello"?.length
will have type Int?
用意:
- 不要濫用 nullable type and safe call(?.) : 如果確定是 non-null object 請直接用 dot call 提取 property 或 呼叫 function
- safe call 性質傳遞 : 不論是否 non-null object 用 safe call 提取 property 或 function return 也直接感染 nullable type