On 25 September 2012 17:25, Steven Schveighoffer <schvei...@yahoo.com>wrote:
> On Tue, 25 Sep 2012 07:53:17 -0400, Manu <turkey...@gmail.com> wrote: > > So I have this recurring pattern, it's really starting to annoy me. >> It stems from the fact that a function prototype and the definition can >> not >> appear in the same file in D (as it can in C/C++) >> > > Doing this is not illegal. > > > Eg, >> >> void func(int x); // <-- declaration of function, informs type and >> associated names, args, ... >> >> //later >> void func(int x) // <-- may be generated with magic (and may use the >> prototype declaration for type information as declared by the prototype >> above) >> { >> ... do stuff >> } >> > > This compiles. Do you have a better case to show the problem? > void blah(); void blah() { int x = 0; } void f() { blah(); // <- call it } W:\project\main\sourcedata\plugins\remedy\modules\test_module.d(38):Error: function remedy.testmodule.blah called with argument types: (()) matches both: remedy.testmodule.blah() and: remedy.testmodule.blah() Obviously, one is just a prototype, and the symbol is resolved within the local file.