D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 860 - Typedef/alias of a typedef/alias in another module, used as template parameter, combined with circular imports, fails to compile
Summary: Typedef/alias of a typedef/alias in another module, used as template paramete...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 minor
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2007-01-20 14:31 UTC by Matti Niemenmaa
Modified: 2014-02-15 13:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Matti Niemenmaa 2007-01-20 14:31:55 UTC
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 Matti Niemenmaa 2007-01-20 14:41:12 UTC
Did some more testing, and apparently it doesn't matter whether either is specifically a typedef or an alias.
Comment 2 Rainer Schuetze 2009-09-18 01:39:16 UTC
I could not reproduce this bug with DMD 1.047 and DMD 2.032.
Comment 3 Matti Niemenmaa 2009-09-18 01:43:29 UTC
Right you are, this seems to have been fixed at some point.