www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - DMD 0.128: Alias arguments to a template cannot have default template

reply Burton Radons <burton-radons smocky.com> writes:
This is allowed by the compiler:

    template A () { }

    class B (alias arg) { }

    class C : B! (A! ()) { }

But this is rejected with the error string "Error: A!() is not a symbol":

    template A () { }

    class B (alias arg = A! ()) { }

    class C : B! () { }
Jul 20 2005
parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
"Burton Radons" <burton-radons smocky.com> wrote in message 
news:dbn2eh$1bbi$1 digitaldaemon.com...
 This is allowed by the compiler:

    template A () { }

    class B (alias arg) { }

    class C : B! (A! ()) { }

 But this is rejected with the error string "Error: A!() is not a symbol":

    template A () { }

    class B (alias arg = A! ()) { }

    class C : B! () { }
I cannot see any wrong behavior here. alias arg = something 'something' here should be some variable name but not a type name as in your example.
Jul 22 2005
parent Burton Radons <burton-radons smocky.com> writes:
Andrew Fedoniouk wrote:
 "Burton Radons" <burton-radons smocky.com> wrote in message 
 news:dbn2eh$1bbi$1 digitaldaemon.com...
 
This is allowed by the compiler:

   template A () { }

   class B (alias arg) { }

   class C : B! (A! ()) { }

But this is rejected with the error string "Error: A!() is not a symbol":

   template A () { }

   class B (alias arg = A! ()) { }

   class C : B! () { }
I cannot see any wrong behavior here. alias arg = something 'something' here should be some variable name but not a type name as in your example.
It's an alias argument, it can take any scope - just as the first, working example shows.
Jul 22 2005