<div class="gmail_quote">On Wed, May 16, 2012 at 4:59 AM, John Belmonte <span dir="ltr"><<a href="mailto:john@neggie.net" target="_blank">john@neggie.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Tuesday, 15 May 2012 at 05:02:20 UTC, Timon Gehr wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 05/15/2012 04:28 AM, John Belmonte wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
C API's often use a opaque struct pointer as a handle. Mapping such a<br>
struct to D using a forward declaration, I noticed that UFCS doesn't work:<br>
<br>
struct State;<br>
...<br>
State* s = new_state();<br>
foo(s); // ok<br>
s.foo(); // compile error<br>
<br>
Error detail:<br>
<br>
Error: struct State is forward referenced when looking for 'foo'<br>
Error: struct State is forward referenced when looking for 'opDot'<br>
Error: struct State is forward referenced when looking for 'opDispatch'<br>
<br>
I'm wondering if anything would be harmed by removing this restriction.<br>
<br>
As a workaround I can use "struct State {}", but that feels wrong.<br>
<br>
</blockquote>
<br>
This is a compiler bug. You can report it here: <a href="http://d.puremagic.com/issues/" target="_blank">http://d.puremagic.com/issues/</a><br>
</blockquote>
<br></div></div>
Thanks-- filed <a href="http://d.puremagic.com/issues/show_bug.cgi?id=8104" target="_blank">http://d.puremagic.com/issues/<u></u>show_bug.cgi?id=8104</a>.<br>
<br>
</blockquote></div><br clear="all"><div>voted up<br><br>-- </div>Bye,<br>Gor Gyolchanyan.<br>