[Issue 10971] assigning derived class to base should not trigger promotion of result

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 5 06:49:11 PDT 2013


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


Maxim Fomin <maxim at maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim at maxim-fomin.ru


--- Comment #1 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-09-05 06:49:10 PDT ---
I doubt it will ever be implemented because it breaks static typing of D. In
second example type of a is "A" and not "B" and your request would require
compiler to accept/reject sometimes arguments depending on context. For
example, initializer for a can be not new B, but Object foo() and in such
context compiler cannot know whether returned value is trully B or not.

-- 
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