Can someone explain this error?

Sean Kelly sean at invisibleduck.org
Tue Sep 23 17:08:08 PDT 2008


== Quote from Bill Baxter (wbaxter at gmail.com)'s article
> On Wed, Sep 24, 2008 at 8:26 AM, Sean Kelly <sean at invisibleduck.org> wrote:
> >    class C
> >    {
> >        this() {}
> >        this( int x, int y ) {}
> >    }
> >
> >    void main()
> >    {
> >        auto c = alloc!(C);
> >        auto d = alloc!(C)( 1, 2 );
> >    }
> >
> >    T alloc(T, Params ...)( Params params )
> >    {
> >        return new T( params );
> >    }
> >
> > $ dmd test
> > test.d(10): Error: expected 0 arguments, not 2
> >
> This is the thing Walter made work in D2 but not D1.
>   http://d.puremagic.com/issues/show_bug.cgi?id=493

Hm.  It was D2 that gave me the error.


Sean


More information about the Digitalmars-d-learn mailing list