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) } }
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>
(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