Summary: declaring pure function with void return type should
                    be compile time error
           Product: D
           Version: 2.036
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from Michal Minich <> 2009-12-04 02:37:33 
PST ---
In D specification is written: "Pure functions are functions that produce the
same result for the same arguments. To that end, a pure function has parameters
that are all immutable or are implicitly convertible to immutable

void function cannot produce any result, thus they are meaningless as pure
functions. Also when all parameters are implicitly immutable, there is no
possibility to modify "out" parameters. So the only way for function to produce
result, is by returning it (and void has no value).

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to