[Issue 4720] contracts don't work on function definitions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 8 05:07:17 PST 2013


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


Andrei Alexandrescu <andrei at erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei at erdani.com


--- Comment #1 from Andrei Alexandrescu <andrei at erdani.com> 2013-02-08 05:07:16 PST ---
What is the expected use and effect of the code show? (Not sure I'm getting
it.) With or without contracts, externcontracts.foo and externcontracts2.foo
are distinct functions, so automatic forwarding from one another won't happen.

One obvious workaround would be:

module externcontracts;
import externcontracts2;
void foo(int a) in {assert(a>=0);} { return externcontracts2.foo(a); }

which may be automated in a number of ways (introspection, mixin etc).

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