Bug 9741 – undefined identifier with User Defined Attribute

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-17T10:28:00Z
Last change time
2014-01-14T17:05:58Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
tim.dlang

Comments

Comment #0 by tim.dlang — 2013-03-17T10:28:57Z
// In file a.d: module a; import b; struct A {} alias X = ShowAttributes!(B); @A struct B {} // In file b.d: module b; template ShowAttributes(alias X) { pragma(msg,X.stringof); pragma(msg,__traits(getAttributes,X)); } If I combile this with dmd -c a.d b.d, I get the following output: B a.d(8): Error: undefined identifier A, did you mean module b? tuple((__error)) a.d(6): Error: template instance b.ShowAttributes!(B) error instantiating If the alias X is moved to the end of file a.d, then it compiles without error. Tested with dmd v2.062.
Comment #1 by k.hara.pg — 2014-01-13T20:38:17Z
Comment #2 by github-bugzilla — 2014-01-14T13:14:47Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/fd181823a6b3e23c5bb048f086e104c56f461cb3 fix Issue 9741 - undefined identifier with User Defined Attribute Also fixes incorrect 'undefined identifier' error in `fail_compilation/ice11919.d`.