digitalmars.D.bugs - [Issue 954] New: Recursive templates with values, Error: T is used as a type
- d-bugmail puremagic.com (29/29) Feb 12 2007 http://d.puremagic.com/issues/show_bug.cgi?id=954
- d-bugmail puremagic.com (8/8) Feb 12 2007 http://d.puremagic.com/issues/show_bug.cgi?id=954
- d-bugmail puremagic.com (10/10) Apr 06 2007 http://d.puremagic.com/issues/show_bug.cgi?id=954
- d-bugmail puremagic.com (9/9) Mar 08 2009 http://d.puremagic.com/issues/show_bug.cgi?id=954
http://d.puremagic.com/issues/show_bug.cgi?id=954 Summary: Recursive templates with values, Error: T is used as a type Product: D Version: 1.005 Platform: PC OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: lio lunesu.com template Foo( char C ) { const Foo = true; } template Bar(char[] T, int F ) { const Bar = Foo!(T[F]); //line 7 } static assert( Bar!("asd",1) ); Results in: t.d(7): Error: T is used as a type t.d(7): template instance Foo!(void[1]) does not match any template declaration t.d(7): variable t.Bar!("asd",1).Bar voids have no value Workaround: change the reference to F in that line to "F+0" --
Feb 12 2007
http://d.puremagic.com/issues/show_bug.cgi?id=954 ------- Comment #1 from lio lunesu.com 2007-02-12 07:21 ------- Forgot to emphasize: direct references to T[F] work fine, for example: template Foo(char[] T, int F) { const Foo = T[F]; } --
Feb 12 2007
http://d.puremagic.com/issues/show_bug.cgi?id=954 thomas-dloop kuehne.cn changed: What |Removed |Added ---------------------------------------------------------------------------- OS/Version|Windows |All ------- Comment #2 from thomas-dloop kuehne.cn 2007-04-06 06:29 ------- Added to DStress as http://dstress.kuehne.cn/compile/t/template_59_A.d http://dstress.kuehne.cn/compile/t/template_59_B.d --
Apr 06 2007
http://d.puremagic.com/issues/show_bug.cgi?id=954 lio+bugzilla lunesu.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #3 from lio+bugzilla lunesu.com 2009-03-08 20:54 ------- This seems to have been fixed in version 1.030 --
Mar 08 2009