Bug 565 – Cannot forward reference types within template parameter list

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-18T12:52:00Z
Last change time
2014-02-15T13:19:05Z
Keywords
rejects-valid, spec
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla
Blocks
340, 511

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2006-11-18T12:52:08Z
In the spec, under "Argument Deduction", the following example is given: template TBar(D : E*, E) { } alias TBar!(int*, int) Bar3; // (1) E is int // (3) D is int* This does, however, not compile: asdf.d(1): Error: identifier 'E' is not defined asdf.d(1): Error: E is used as a type Another similar example is used later in the same section: class A { } class B : A { } template TBar(T : U*, U : A) { } alias TBar!(B*, B) Foo5; // (2) T is B* // (3) U is B I'd say this is a DMD bug since it's evidently expected to work.
Comment #1 by davidl — 2007-06-12T11:15:28Z
Fixed at least in dmd 1.014 earlier version not tested yet