Bug 572 – parse error when using template instantiation with typeof

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2006-11-19T02:17:00Z
Last change time
2015-06-09T05:15:12Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
lovesyao

Attachments

IDFilenameSummaryContent-TypeSize
79parser_typedef.patchpatch(I didn't do regression test)text/plain968

Comments

Comment #0 by lovesyao — 2006-11-19T02:17:03Z
class Test{ static const test2=1; template test(){ const int test=1; } } void main(){ auto a=new Test; static assert(typeof(a).test2==1);//ok alias typeof(a) t; static assert(t.test!()==1);//ok static assert(typeof(a).test!()==1);//syntax error }
Comment #1 by lovesyao — 2006-11-19T04:17:00Z
Created attachment 79 patch(I didn't do regression test)
Comment #2 by thomas-dloop — 2006-11-25T07:50:51Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-11-19: > http://d.puremagic.com/issues/show_bug.cgi?id=572 > class Test{ > static const test2=1; > template test(){ > const int test=1; > } > } > > void main(){ > auto a=new Test; > static assert(typeof(a).test2==1);//ok > alias typeof(a) t; > static assert(t.test!()==1);//ok > static assert(typeof(a).test!()==1);//syntax error > } Added to DStress as http://dstress.kuehne.cn/compile/t/typeof_15_A.d http://dstress.kuehne.cn/compile/t/typeof_15_B.d http://dstress.kuehne.cn/compile/t/typeof_15_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFaEh6LK5blCcjpWoRAiWBAJ4xw9WFGZ90lO6mSQ5baAqejlWtYACgjre2 rHPttb/ti4zwesxXCR5Ir50= =gX9g -----END PGP SIGNATURE-----
Comment #3 by bugzilla — 2008-07-09T22:36:36Z
Fixed dmd 1.032 and 2.016