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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 3 15:53:15 PST 2013


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


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #6 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-02-03 15:53:14 PST ---
(In reply to comment #3)
> (In reply to comment #2)
> > ?????  Why would you allow out parameters in a pure function?  This seems
> > reasonable for simple value types (ints, floats, etc.), but when you start
> > passing objects in, you start allowing the modification of whole object
> > subgraphs from pure functions.  This makes no sense.
> 
> Why doesn't it make sense? Aren't you thinking of inout parameters? A pure
> function  void foo(out A a); ought to be exactly the same as A foo(); together
> with an assignment. I'm not seeing anything impure in that.
> BTW, it works fine in CTFE. (CTFE isn't quite the same concept as pure, but
> it's close).

Should we close this report then?

-- 
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