Function-like with parameter of type `Void`

IDE: Visual Studio X/Fire
Version: 10.0.0.2399 (develop)
Target (If relevant): OSX
Description:
The parser fails to parse an empty tuple (Void) in argument passing position.

Expected Behavior:
Compiles.
Actual Behavior:
“E: Syntax error [<file> (<line>)]”
"E: Declaration expected [<file> (<line>)]
Steps:

func foo(_ x: Void) {}
foo(()) // Errors Here

Thanks, logged as bugs://82583

what would ever be the point of this method?

This is a reduction, so not much, however:

  • If foo was generic, one might have instantiated a parameter as Void
  • if foo used globals and the parameter was labeled (i.e. foo(_internal: ()))
    could be an internal variant for having pre-checked conditions.
  • possibly others?

I see, yeah.

bugs://82583 got closed with status fixed.