Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Type void

Fuzion's void type is the only type that does not have any values. Not having any values means that there is no means to produce a value of this type. Any feature with void as result type is therefore guaranteed never to return.

Void result of endless loop

A simple way to create code whose result is of type void is an endless loop:

Some intrinsic standard features also result in void, e.g. exit. Consequently, a feature that ends with a call to exit results in a void result:

void is sometimes useful as a generic argument if it should be impossible to provide any actual values of that type. An examples is an empty array, whose default type is array<void>. No values can be extracted from an empty array, since this would result in an index error: