July 06, 2012 [Issue 8353] New: Array of polymorphic objects does not compile | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=8353 Summary: Array of polymorphic objects does not compile Product: D Version: D2 Platform: x86_64 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: jens.k.mueller@gmx.de --- Comment #0 from jens.k.mueller@gmx.de 2012-07-06 13:59:05 PDT --- A student of ours discovered the following non-compiling code: class Base { } class A : Base { } class B : Base { } unittest { auto c = [ new A, new B ]; // fails to compile but shouldn't A/B be implicitly // convertible to Base } We think the code should compile. c should be an array of Base. As a work around you can add explicit casts to Base. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 07, 2012 [Issue 8353] Array of polymorphic objects does not compile | ||||
---|---|---|---|---|
| ||||
Posted in reply to jens.k.mueller@gmx.de | http://d.puremagic.com/issues/show_bug.cgi?id=8353 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies@gmail.com Resolution| |DUPLICATE --- Comment #1 from yebblies <yebblies@gmail.com> 2012-07-07 21:23:26 EST --- *** This issue has been marked as a duplicate of issue 5498 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation