[Issue 4884] New: Using template struct parameters in method definition fails with "parameter _param_0 is already defined"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 17 16:16:02 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4884

           Summary: Using template struct parameters in method definition
                    fails with "parameter _param_0 is already defined"
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: osa8aso at gmail.com


--- Comment #0 from osa8aso at gmail.com 2010-09-17 16:15:29 PDT ---
I'm trying to define a struct template where template parameters are used to
define struct methods:
----
struct A( T... ) {
    void foo( T ) {}
    void bar( bool, T ) {}
}

void main() {
    auto a = A!( int )();
}
----

This fails to compile (dmd 2.049), producing the following errors:

a.d(3): Error: function a.A!(int).A.bar parameter bar._param_0 is already
defined
a.d(7): Error: template instance a.A!(int) error instantiating

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


More information about the Digitalmars-d-bugs mailing list