[Issue 3572] declaring pure function with void return type should be compile time error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 6 02:46:54 PST 2013


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


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |yebblies at gmail.com
            Version|2.036                       |D2
         Resolution|INVALID                     |
           Severity|normal                      |enhancement


--- Comment #8 from yebblies <yebblies at gmail.com> 2013-03-06 21:46:46 EST ---
(In reply to comment #7)
> In current, we can declare a pure function which has "weak" purity.
> 
> pure void foo(int* p, out string s, ref int[] arr);
> 
> All results are returned through its parameters.
> So, returning void itself has no problem in pure functions.

This would still be meaningful for strongly-pure or const-pure functions.

eg.
pure void foo(string x)
By definition calling foo does no observable work.

While this might be WONTFIX or LATER like issue 3882, it is not invalid.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list