[Issue 5123] New: Cannot assign null to a class with 'alias this'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 26 13:35:40 PDT 2010


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

           Summary: Cannot assign null to a class with 'alias this'
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: osa8aso at gmail.com


--- Comment #0 from osa8aso at gmail.com 2010-10-26 13:34:54 PDT ---
If class has 'alias this' for a struct member, attempt to assign null to a
class instance fails:
------
struct Foo {}
class Bar {
    Foo foo_;
    alias foo_ this;
}
void main() {
    Bar a;
    a = null;
}
------
aliasthis1.d(8): Error: cannot implicitly convert expression (null) of type
void* to Foo

-- 
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