http://d.puremagic.com/issues/show_bug.cgi?id=3572

           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
        AssignedTo: nob...@puremagic.com
        ReportedBy: michal.min...@gmail.com


--- Comment #0 from Michal Minich <michal.min...@gmail.com> 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to