Summary: Nested struct creation by a template
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Jesse Phillips <> 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

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:
------- You are receiving this mail because: -------

Reply via email to