Bug 2449 – Attempting to use struct type .init inside a template causes "forward declaration" error

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2008-11-11T17:23:00Z
Last change time
2014-03-01T00:35:59Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
jarrett.billingsley
Blocks
340

Comments

Comment #0 by jarrett.billingsley — 2008-11-11T17:23:02Z
Oh, forward references. Why must you hate me so? struct S { // line 16 } template Tuple(T...) { alias T Tuple; } template T(U) { alias Tuple!(U.init) T; // line 27 } alias T!(S) V; Error: dtest.d(16): declaration _D5dtest1S6__initZ forward declaration dtest.d(27): template instance dtest.Tuple!(_D5dtest1S6__initZ) error instantiating
Comment #1 by jarrett.billingsley — 2008-11-12T20:01:03Z
You know, I thought this bug sounded familiar.. Sad that I had forgotten I reported it. *** This bug has been marked as a duplicate of 1667 ***