https://kotlinlang.org logo
Title
j

Jamie Huson

05/01/2018, 8:16 PM
such as
if(isNull(someString)) { someString.length } else { someString.length }
, the first
someString.length
would give an error or something
a

Andreas Sinz

05/01/2018, 8:21 PM
not right now, you need to wait for contracts to make it into the language
why not use a regular
if(someString == null)
?
j

Jamie Huson

05/01/2018, 8:25 PM
some languages support a falsey null, like
if(null)
and i was adding a simple function to help with that
🤮 1
but yeah you can just null check and its alright
could you point me to info on contracts in kotlin progress?
a

Andreas Sinz

05/01/2018, 8:29 PM
there is not much progress/public information about contracts yet, just https://discuss.kotlinlang.org/t/status-of-kotlin-internal-contracts/6392
j

Jamie Huson

05/01/2018, 8:32 PM
thx!