Bug 4267 – forward reference error when 2-fold aliasing a template instance

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-06-03T15:24:00Z
Last change time
2014-02-15T02:42:46Z
Keywords
rejects-valid
Assigned to
nobody
Creator
hoganmeier
Depends on
4503

Comments

Comment #0 by hoganmeier — 2010-06-03T15:24:52Z
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)'
Comment #1 by hoganmeier — 2010-06-03T16:39:38Z
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
Comment #2 by hoganmeier — 2010-06-03T18:31:04Z
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.
Comment #3 by bugzilla — 2010-08-08T21:33:28Z
Fixed with 4503