www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5771] New: Template constructor auto ref and do not work

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5771

           Summary: Template constructor auto ref and do not work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



Test code:
----
struct S
{
    this(A)(auto ref A a){}     // line 3
}
void main()
{
    S s = S(10);
}
----
Line 3 causes error 'Error: auto can only be used for template function
parameters'.

Workaround is follows:
----
struct S
{
    template __ctor(A){         // workaround
        ref typeof(this) __ctor(auto ref A a){ ...; return this; }
    }
}
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 23 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5771


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid



Patch posted.

https://github.com/D-Programming-Language/dmd/pull/30

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 16 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5771


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



15:12:01 PDT ---
https://github.com/D-Programming-Language/dmd/commit/37e51929c93b6e3ed0c6ed719607b5673c6b171a

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 28 2011