[Issue 9741] New: undefined identifier with User Defined Attribute

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 17 10:29:00 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9741

           Summary: undefined identifier with User Defined Attribute
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: tim.d at t-online.de


--- Comment #0 from tim.d at t-online.de 2013-03-17 10:28:57 PDT ---
// 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.

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


More information about the Digitalmars-d-bugs mailing list