Bug 6848 – typeof(super) does not take into account const/immutable attributes inside member functions

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-10-24T22:01:00Z
Last change time
2012-04-20T19:14:57Z
Keywords
accepts-invalid, rejects-valid, wrong-code
Assigned to
nobody
Creator
k.hara.pg
Blocks
2573

Comments

Comment #0 by k.hara.pg — 2011-10-24T22:01:10Z
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) } }
Comment #1 by lovelydear — 2012-04-20T17:03:12Z
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>
Comment #2 by k.hara.pg — 2012-04-20T19:08:47Z
(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