Bug 860 – Typedef/alias of a typedef/alias in another module, used as template parameter, combined with circular imports, fails to compile
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-01-20T14:31:00Z
Last change time
2014-02-15T13:12:52Z
Keywords
rejects-valid
Assigned to
nobody
Creator
matti.niemenmaa+dbugzilla
Comments
Comment #0 by matti.niemenmaa+dbugzilla — 2007-01-20T14:31:55Z
A bug quite hard to summarize understandably. The code may help:
--
module aliasesType;
alias int myAlias;
--
module definesType;
import aliasesType;
import usesType; // creates the import cycle
typedef myAlias myTypedef;
--
module usesType;
import definesType;
template T(x) {}
// just use T with myTypedef somehow, doesn't matter what this is
mixin T!(myTypedef);
--
Compiling the definesType module results in the error "definesType.d(5): Error: identifier 'myAlias' is not defined". Using the fully qualified name "aliasesType.myAlias" instead fixes this error.
Comment #1 by matti.niemenmaa+dbugzilla — 2007-01-20T14:41:12Z
Did some more testing, and apparently it doesn't matter whether either is specifically a typedef or an alias.
Comment #2 by r.sagitario — 2009-09-18T01:39:16Z
I could not reproduce this bug with DMD 1.047 and DMD 2.032.
Comment #3 by matti.niemenmaa+dbugzilla — 2009-09-18T01:43:29Z
Right you are, this seems to have been fixed at some point.