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

           Summary: Nested struct creation by a template
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: jesse.k.phillip...@gmail.com


--- Comment #0 from Jesse Phillips <jesse.k.phillip...@gmail.com> 2012-10-18 
14:15:06 PDT ---
I'm not sure the intended behavior but currently is inconsistent. The following
code fails to compile with:

bad.d(2): Error: function D main is a nested function and cannot be accessed
from bad.fun!(R).fun

T fun(T)() if(is(T == struct)) {
    T s;
    return s;
}

void main() {
    struct R {
        void f() { }
    }

    auto m = fun!R();
}

However removing the function from the struct definition (include other values
if desired) then it will compile. I'd think we'd want templates to have the
ability to create a nested struct.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to