[Issue 8104] UFCS on opaque struct won't compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 19 19:08:38 PDT 2012


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



--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> 2012-05-19 19:10:14 PDT ---
(In reply to comment #0)
> It should be possible to use UFCS on an opaque struct.
> 
> ----
> struct State;
> 
> void foo(State*) {};
> 
> void main() {
>     State* s;
>     foo(s);  // ok
>     s.foo(); // compile error
> }
> 
> ----
> Error: struct State is forward referenced when looking for 'foo'
> Error: struct State is forward referenced when looking for 'opDot'
> Error: struct State is forward referenced when looking for 'opDispatch'

I think this is expected behavior. s.foo() should look up Stete's members, but
it is impossible, then errors occur.
UFCS should be a lookup for fall-back. If properly lookup fails, UFCS should
not hide the error.

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