Sometimes Void and () means the same thing, and sometimes they do not. Here's what the compiler (7.1 beta) can tell us:
func foo0() {} // OK
func foo1() -> () { return () } // OK
func foo2() -> Void { return () } // OK
func foo3() -> Void { return Void } // Error: Unexpected non-void return value in void function
func foo4() -> Void { return Void() } // OK
let bar0: () = () // OK
let bar1: Void = () // OK
let bar2: Void = Void() // OK
let bar3: () = Void() // OK
let bar4: Void = Void // Error: Cannot convert value of type 'Void.Type' (aka '().Type') to specified type '()'
let bar5: Void.Type = Void // Error: Expected member name or constructor call after type name
let bar6: Void.Type = Void.self // OK
let bar7: ().Type = ().self // Error: Cannot convert value of type '()' to specified type '().Type'
let bar8: () = ().self // OK
let bar9: Void = Void.self // Error: Cannot convert value of type 'Void.Type' (aka '().Type') to specified type 'Void' (aka '()')
let barA: ().Type = Void.self // OK
let barB: Void.Type = Void.self // OKSo, as eg foo2, foo4, bar1 and bar2 shows, Void() and () seems to mean exactly the same thing, they are both instances of the type Void.
Yet, as eg bar3 shows, () is the type of Void() and therefore also the type of (), so () is the type and an instance of itself ...
It seems like () and Void both mean exactly the same thing (the type Void) when used in the context of a type declaration, but in all other contexts, () instead means an instance of the type Void, ie the same as Void(). But then we look at bar8, bar9 and barA and it's clear that this can't be the case either ...
Is there a simple explanation for all this?