Thread overview
[Issue 860] New: Typedef of an alias in another module used as template parameter combined with circular imports fails strangely
Jan 20, 2007
d-bugmail
[Issue 860] Typedef/alias of a typedef/alias in another module, used as template parameter, combined with circular imports, fails to compile
Jan 20, 2007
d-bugmail
Sep 18, 2009
Rainer Schuetze
Sep 18, 2009
Matti Niemenmaa
January 20, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=860

           Summary: Typedef of an alias in another module used as template
                    parameter combined with circular imports fails strangely
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: deewiant@gmail.com


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.


-- 

January 20, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=860


deewiant@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Typedef of an alias in      |Typedef/alias of a
                   |another module used as      |typedef/alias in another
                   |template parameter combined |module, used as template
                   |with circular imports fails |parameter, combined with
                   |strangely                   |circular imports, fails to
                   |                            |compile




------- Comment #1 from deewiant@gmail.com  2007-01-20 14:41 -------
Did some more testing, and apparently it doesn't matter whether either is specifically a typedef or an alias.


-- 

September 18, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=860


Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario@gmx.de


--- Comment #2 from Rainer Schuetze <r.sagitario@gmx.de> 2009-09-18 01:39:16 PDT ---
I could not reproduce this bug with DMD 1.047 and DMD 2.032.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 18, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=860


Matti Niemenmaa <matti.niemenmaa+dbugzilla@iki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #3 from Matti Niemenmaa <matti.niemenmaa+dbugzilla@iki.fi> 2009-09-18 01:43:29 PDT ---
Right you are, this seems to have been fixed at some point.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------