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


Sobirari Muhomori <dfj1es...@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |2573


--- Comment #2 from Sobirari Muhomori <dfj1es...@sneakemail.com> 2010-12-09 
11:27:03 PST ---
>     auto c = new Concrete;
>     auto x = c.foo();
>     writeln (typeof(x).stringof); // prints Derived (even it is result of 'new
> Base')

You're doing it wrong.
typeof(x) is evaluated at compile time and always gives the declared type even
if x==null

The correct code is
---
auto c = new Concrete;
auto x = c.foo();
writeln(x.classinfo.name); // Base
---

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

Reply via email to