www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - DMD 0.97: Some kind of instantiation problem, I guess

This code fails compilation with the following errors:

    foo.d(5): template A() is used as a type
    foo.d(5): variable result voids have no value
    foo.d(6): cannot implicitly convert void to A

The code is:

    struct A ()
    {
       static A opCall ()
       {
          A result;
          return result;
       }
    }

    struct B ()
    {
       .A! () a ()
       {
          return .A! () ();
       }
    }

    B! () x;

I believe that this code is correct.
Jul 29 2004