What is the name of Kotlin! operator

When I talk with other developers, what do I call an operator !!?

In Kotlin ?:is called the operator of Elvis

These sources do not say the name !!:

If you look online, then the general term for !!is a double hit . Do I use the same for Kotlin, even if the swift operator !is called force deployment (Note: !in swift it is similar to Kotlin !!.)

What I am specifically looking for:

  • A name I can orally call an operation !!that Kotlin developers can understand
  • A name other than a double exclamation mark or bang bang or double bang
+6
source share
5 answers

This is called in the Kotlin documentationthe not-null assertion operator .

Personally, I call it hold my beer operator.

+8
source

Kotlin in Action calls this a non-empty statement statement. We decided to update the documents to use this term too.

+4
source

" " ,

a!!.length

Android ALT + ENTER.

, , .

+2
source

I use it as a " double bang ", but actually hold my beer operatoralso falls into his heart (thanks @Todd ;-)).

+2
source

I use "force deployment" (same as in Swift).

+1
source

Source: https://habr.com/ru/post/1689985/


All Articles