Bug 810 – Cannot forward reference template

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-01-07T05:42:00Z
Last change time
2014-02-15T13:13:00Z
Keywords
rejects-valid
Assigned to
nobody
Creator
matti.niemenmaa+dbugzilla
Blocks
340, 945

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2007-01-07T05:42:55Z
They don't get much shorter than this: Template!(int) stack; template Template(T) {} Flip the two lines and the code compiles.
Comment #1 by thomas-dloop — 2007-04-05T05:27:54Z
Comment #2 by clugdbug — 2009-08-19T07:23:24Z
This test case is faulty (as are the Dstress cases), it should be: Template!(int) stack; template Template(T) { alias int Template; } This failed in 1.041, but is working in 1.046 and 2.031. I bet this was fixed by bug#106 in 1.046.
Comment #3 by matti.niemenmaa+dbugzilla — 2009-08-19T09:49:00Z
Right you are; I checked and indeed, flipping the two lines doesn't make the code acceptable even with DMD 1.00. My bad, I presumably changed it from "class" to "template" at the last minute. Confirmed that this is indeed fixed with 1.046: it didn't work in 1.045. Happy days! My code is riddled with "waiting on #810"-type comments.