[Issue 6848] New: typeof(super) does not take into account const/immutable attributes inside member functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 24 22:02:15 PDT 2011


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

           Summary: typeof(super) does not take into account
                    const/immutable attributes inside member functions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-10-24 22:01:10 PDT ---
This is similar to bug 6695.

class Foo {}

class Bar : Foo
{
    void func() immutable {
        pragma(msg, typeof(this));  // immutable(Bar)
        auto t = this;
        pragma(msg, typeof(t));     // immutable(Bar)

        pragma(msg, typeof(super)); // Foo instead of immutable(Foo)
        auto s = super;
        pragma(msg, typeof(s));     // Foo instead of immutable(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