Thread overview
[Issue 6848] New: typeof(super) does not take into account const/immutable attributes inside member functions
Oct 25, 2011
Kenji Hara
Apr 21, 2012
SomeDude
Apr 21, 2012
Kenji Hara
Apr 21, 2012
Kenji Hara
October 25, 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@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@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: -------
April 21, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6848


SomeDude <lovelydear@mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear@mailmetrash.com


--- Comment #1 from SomeDude <lovelydear@mailmetrash.com> 2012-04-20 17:03:12 PDT ---
Output of 2.059 Win32

PS E:\DigitalMars\dmd2\samples> rdmd --main bug.d
immutable(Bar)
immutable(Bar)
immutable(Foo)
immutable(Foo)
PS E:\DigitalMars\dmd2\samples>

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 21, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6848



--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2012-04-20 19:08:47 PDT ---
(In reply to comment #1)
> Output of 2.059 Win32
> 
> PS E:\DigitalMars\dmd2\samples> rdmd --main bug.d
> immutable(Bar)
> immutable(Bar)
> immutable(Foo)
> immutable(Foo)
> PS E:\DigitalMars\dmd2\samples>

Thanks for your checking.
May fixed in 2.057.

https://github.com/D-Programming-Language/dmd/pull/475

https://github.com/D-Programming-Language/dmd/commit/85549f10e7904dac18da80b94a0cea2084936542

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 21, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6848


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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