[Issue 850] New: we need (*type).property to refer to property if we use typedef

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 14 18:00:31 PST 2007


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

           Summary: we need (*type).property to refer to property if we use
                    typedef
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: davidl at 126.com


module test.test;
class test
{
        int myMember;
}
typedef test *ptest;
void main()
{
        ptest k;
        k.myMember = 1;
}
dmd complains:
test.d(10): Error: no property 'myMember' for type 'test*'
test.d(10): Error: constant (k).myMember is not an lvalue

typedef test *ptest; <--- the problem is here. I think it's 
something related to dmd's strong type mechanism. 
alias test *ptest; // this would work fine

i don't know if i can call this a bug , but at least the 
compile message should be nicer. Leave to u to decide either
this should be a bug or an enhancement.


-- 



More information about the Digitalmars-d-bugs mailing list