It’s not possible to instantiate or assign, which is more like a never type than a unit
Actually, this is because void is not a type, it is just a keyword, a placeholder used instead of the return type when a function doesn’t return anything.
If it were a bottom type, that would mean that a method returning void must diverge, which is simply not true.
Also, if it were a bottom type, it would be possible to write an “unreachable” method
void unreachable(void bottom) {
return bottom;
}
Even though it couldn’t be called, it should be possible to define it, if void was a bottom type. But it is not, because void isn’t a bottom type, it’s no type at all.
Actually, this is because
void
is not a type, it is just a keyword, a placeholder used instead of the return type when a function doesn’t return anything.If it were a bottom type, that would mean that a method returning
void
must diverge, which is simply not true.Also, if it were a bottom type, it would be possible to write an “unreachable” method
Even though it couldn’t be called, it should be possible to define it, if
void
was a bottom type. But it is not, becausevoid
isn’t a bottom type, it’s no type at all.