<div class="gmail_quote">On 25 September 2012 17:25, Steven Schveighoffer <span dir="ltr"><<a href="mailto:schveiguy@yahoo.com" target="_blank">schveiguy@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, 25 Sep 2012 07:53:17 -0400, Manu <<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So I have this recurring pattern, it's really starting to annoy me.<br>
It stems from the fact that a function prototype and the definition can not<br>
appear in the same file in D (as it can in C/C++)<br>
</blockquote>
<br></div>
Doing this is not illegal.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Eg,<br>
<br>
void func(int x); // <-- declaration of function, informs type and<br>
associated names, args, ...<br>
<br>
//later<br>
void func(int x) // <-- may be generated with magic (and may use the<br>
prototype declaration for type information as declared by the prototype<br>
above)<br>
{<br>
  ... do stuff<br>
}<br>
</blockquote>
<br></div>
This compiles.  Do you have a better case to show the problem?<br></blockquote><div><br></div><div><div>void blah();</div><div><br></div><div>void 
blah()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>int x = 0;</div><div>}</div></div><div><br></div><div>void f()</div><div>{</div><div>   blah(); // <- call it</div><div>}</div>
<div><br></div><div><br></div><div><div>W:\project\main\sourcedata\plugins\remedy\modules\test_module.d(38):Error: function remedy.testmodule.blah called with argument types:</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>(())</div>
<div>matches both:</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>remedy.testmodule.blah()</div><div>and:</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>remedy.testmodule.blah()</div>
</div><div><br></div><div>Obviously, one is just a prototype, and the symbol is resolved within the local file.</div></div>