Purpose of double exclamation operator (null check)

!! basically allows you to write
myFun(foo ?: throw AssertionError("Can't happen, I'm sure foo is not null"))
as
myFun(foo!!).

There is nothing more interesting about it.

1 Like