Summary: UFCS functions get lost when type is transmitted to
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Walter Bright <> 2012-03-30 
23:10:11 PDT ---
void foo(T)(T t) {

class C { }
void func(C c) { }
void test(C c) {

This fails to compile because a.d doesn't know about test.func(C c), and so
does not find it when attempting to resolve t.func() using UFCS.

The solution is to:

If func() is not found as a member function of t, then look in the template
instantiation scope for a func(t). If found, use that as the UFCS function, and
then mark the template instantiation as LOCAL to the instantiation context.
This will ensure that the mangled name of the instantiation will not conflict
with other instantiations of foo(T) with other func(T) functions.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to