[Issue 2246] New: specialization of template to template containing int arguments fails
Bill Baxter
dnewsgroup at billbaxter.com
Fri Jul 25 20:23:12 PDT 2008
d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=2246
>
> Summary: specialization of template to template containing int
> arguments fails
> Product: D
> Version: 1.024
> Platform: Macintosh
> OS/Version: Mac OS X
> Status: NEW
> Keywords: rejects-valid
> Severity: normal
> Priority: P2
> Component: DMD
> AssignedTo: bugzilla at digitalmars.com
> ReportedBy: fawzi at gmx.ch
>
>
> {{{
> class A(T,d){
> T p;
> }
>
> class B(int rk){
> int[rk] p;
> }
>
> class C(T,int rk){
> T[rk] p;
> }
>
> template f(T:A!(U,d),U,d){
> void f(){ }
> }
>
> template f(T:B!(rank),int rank){
> void f(){ }
> }
>
> template f(T:C!(U,rank),U,int rank){
> void f(){ }
> }
>
> void main(){
> A!(int,long) a;
> B!(2) b;
> C!(int,2) c;
> f!(A!(int,long))();
> f!(B!(2))();
> f!(C!(int,2))();
> }
> }}}
>
> fails on
> f!(B!(2))();
> and
> f!(C!(int,2))();
>
> {{{
> Line 30: template instance f!(B) does not match any template declaration
> Line 30: Error: template instance 'f!(B)' is not a variable
> Line 30: Error: function expected before (), not f!(B) of type int
> }}}
>
> also GDC, and (i suspect) newer DMD releases have this problem
>
> Fawzi
>
>
There was a related-sounding bug fixed in the last 1.x release. Have
you tried it there (1.033 I think)?
--bb
More information about the Digitalmars-d-bugs
mailing list