Unit and Nothing
Unit represents the type of "no meaningful value," similar to void in other languages. Unit has only one value, written as (). Operations that only care about side effects, such as println, assignment expressions, and loop expressions, have Unit as their type.
Nothing is a more special type: it represents "there will be no value," and no expression of any type returns a value of Nothing type. Expressions that interrupt program flow—break, continue, return, and throw—all have Nothing type. After executing these expressions, subsequent code will not be executed.
The code on the right demonstrates usage scenarios for Unit and Nothing. Code after break will never execute because break has type Nothing. Observe that the while loop returns Unit type.
Nothing type is a subtype of all types, but currently cannot be explicitly used in type annotation positions.