[Issue 8104] UFCS on forward reference won't compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 15 19:53:17 PDT 2012


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



--- Comment #1 from John Belmonte <john at neggie.net> 2012-05-15 19:54:46 PDT ---
I scanned the dmd UFCS implementation.  Apparently expressions are blindly
translated from e.g. foo.bar() to bar(foo) when the normal searches on foo
fail.  In other words, we don't know at the time of the normal searches whether
there is a matching free function.

I propose resolving this by, in all cases, not considering a search on an
opaque struct to be an error.  That is, foo.bar() will not yield a "forward
referenced" error regardless of whether a matching free function exists.

For the case where no free function exists, the compile error would then be
"undefined identifier 'bar'"-- i.e. the same as for a non-opaque struct.

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