www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4267] New: forward reference error when 2-fold aliasing a template instance

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4267

           Summary: forward reference error when 2-fold aliasing a
                    template instance
           Product: D
           Version: 2.041
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: mrmocool gmx.de


--- Comment #0 from Trass3r <mrmocool gmx.de> 2010-06-03 15:24:52 PDT ---
alias Bar Bar2; // but the second one doesn't
alias Foo!(1) Bar; // 1 alias "level" works

//alias Bar Bar2; // putting it behind the 1st alias makes it work

template Foo(uint ver)
{
}

ddraw.d(1): Error: forward reference to 'Foo!(1)'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 03 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4267



--- Comment #1 from Trass3r <mrmocool gmx.de> 2010-06-03 16:39:38 PDT ---
Oh and moving the alias declaration doesn't help in the real-world example:


interface IDirectDrawSurfaceB(uint ver) : IUnknown
{
...
HRESULT  Initialize(LPDIRECTDRAW, LPDDSURFACEDESC ); // line 153
...
}
alias IDirectDrawSurfaceB!(1) IDirectDrawSurface; // line 199


interface IDirectDrawB(uint ver) : IUnknown
{
...
    HRESULT  CreateSurface(LPDDSURFACEDESC, LPDIRECTDRAWSURFACE *, IUnknown *);
...
}
alias IDirectDrawB!(1) IDirectDraw; ///

alias IDirectDraw *LPDIRECTDRAW;
alias IDirectDrawSurface *LPDIRECTDRAWSURFACE;


ddraw.d(153): Error: forward reference to 'IDirectDrawB!(1)'
ddraw.d(153): Error: IDirectDraw is used as a type
ddraw.d(199): Error: alias ddraw.IDirectDrawSurface recursive alias declaration

ddraw.d(199): Error: template instance ddraw.IDirectDrawSurfaceB!(1) error
instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 03 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4267


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major


--- Comment #2 from Trass3r <mrmocool gmx.de> 2010-06-03 18:31:04 PDT ---
I tried using direct aliases also for the pointers to see if this solves the
problem:
alias IDirectDrawB!(1) *LPDIRECTDRAW;

but it still doesn't work.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 03 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4267


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


--- Comment #3 from Walter Bright <bugzilla digitalmars.com> 2010-08-08
21:33:28 PDT ---
Fixed with 4503

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