www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13860] New: template required forward reference for

https://issues.dlang.org/show_bug.cgi?id=13860

          Issue ID: 13860
           Summary: template required forward reference for typeof(member)
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: vlevenfeld gmail.com

struct Foo (Bar...)
    {        
        Bar bars;
        auto baz (size_t d)(){}
        pragma(msg, typeof(baz!0)); // line A
    }

auto bar (S,R)(S, R)
    {pragma(msg, typeof(Foo!().baz!0));} // line B

void main ()
    {/*...}*/
        int[] x;
        int[] y;
        x.bar (y);
    }

if line A is not commented out:
  Error: Foo!().Foo no size yet for forward reference

line B displays the expected output.

--
Dec 14 2014