Bug 4884 – Using template struct parameters in method definition fails with "parameter _param_0 is already defined"
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-09-17T16:15:00Z
Last change time
2012-07-01T19:02:03Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
osa8aso
Comments
Comment #0 by osa8aso — 2010-09-17T16:15:29Z
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