V82(A): Possible bug with 'Void' and variables

Monkey Forums/Monkey Bug Reports/V82(A): Possible bug with 'Void' and variables

ImmutableOctet(SKNG)(Posted 2014) [#1]
Hey Mark, just a heads up: If you were to assign a variable to a function or method which has the "return type" (Not exactly a type in this case) 'Void', Monkey's compiler won't cause an error. I am using a slightly modified version of V82(A); I basically just added that '_env' fix to my version. That isn't relevant to the problem, though.

The native compiler will obviously catch this, but this is just an odd bug I found with 'trans'.

This can be tested by compiling the following example:


Nothing too terrible, but it caught me off guard when debugging my own code; I forgot the return type of a specific method, and assumed it wasn't 'Void'.

So, is this an oversight, or is 'Void' just platform-defined to the point of odd behavior like this? Because, just using 'Void' like I did with my 'W' variable will cause an error. But if you assign it, the compiler doesn't care about it being 'Void'.