`Void` and `()` cannot be used

IDE: Visual Studio X/Fire
Version: 10.0.0.2459 (develop)
Target (If relevant): Island(OSX)
Description:
The compiler emits various errors for use of Void and () that are incorrect.
Although all of these cases are trivial, the compiler shouldn’t forbid them.

Expected Behavior:
Compiles.
Actual Behavior:
See below.
Steps:

let x: () = () // E62 Type mismatch, cannot assign "<tuple literal>" to "Void"

let y: Void = () // E503 Tuples require .NET v4.0

let z = () // E503 Tuples require .NET v4.0

let w: () // E96 Internal type "Void" cannot be used directly

func foo(x: () ) { // E96 Internal type "Void" cannot be used directly
    
}

foo(x: ()) // E503 Tuples require .NET v4.0

func bar(x: Void ) {
    
}

bar(x: ()) // E503 Tuples require .NET v4.0

Thanks, logged as bugs://83611

bugs://83611 got closed with status fixed.

This case is still not working on 10.0.0.2461 (develop), FYI.

func foo(x: () ) {} // E96 Internal type "Void" cannot be used directly 

ah yes. Fixed.

1 Like

Another, somewhat silly, Void problem in 10.0.0.2465 (develop):

var v: Void {
	return // E467 Cannot return without a value
}

Found in a test verifying properties had the correct name when translated to LLVM.

Odd. Will log.

Thanks, logged as bugs://83689

bugs://83689 got closed with status fixed.

This last thing was, unfortunately, not actually fixed in 10.0.0.2471 (develop).
It just changed the error. It now outputs:

var v: Void {
	return // E524 Method reaches end without returning a value
}

bugs://83689 got reopened.

bugs://83689 got closed with status fixed.