www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 926] New: Implicit conversion from Derived[] to Base[]

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=926

           Summary: Implicit conversion from Derived[] to Base[]
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: csantander619 gmail.com


In
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=47590,
Kan noted that this was again allowed:

class A {}
class B : A {}

void main()
{
        B [] b;
        A [] a = b;
}

I don't know if the docs mention it, but it seems to have been re-allowed out
of the blue.


-- 
Feb 03 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=926


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #1 from thomas-dloop kuehne.cn  2007-04-05 11:33 -------
http://www.digitalmars.com/d/arrays.html

 
 A dynamic array T[] can be implicitly converted to one of the following:
 
    * U[]
    * void[]

 Where U is a base class of T.

--
Apr 05 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=926


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
             Status|RESOLVED                    |REOPENED
          Component|DMD                         |www.digitalmars.com
         Resolution|INVALID                     |
            Summary|Implicit conversion from    |Revival of implicit
                   |Derived[] to Base[]         |conversion from Derived[] to
                   |                            |Base[] not noted in
                   |                            |changelog




------- Comment #2 from smjg iname.com  2009-02-24 09:30 -------
So the bug is that either:
(a) It was disallowed in 0.73 according to the changelog, but the spec itself
not updated.  The 'bug' that it didn't behave according to spec was
subsequently fixed, but Walter completely forgot about the time when the
anomaly was introduced.

(b) It was disallowed in 0.73, the spec updated, and then the reversion both in
the spec and in the compiler was inadvertently left out of the changelog.


-- 
Feb 24 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=926


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P5
                 CC|                            |andrei metalanguage.com
            Version|unspecified                 |D2
         AssignedTo|nobody puremagic.com        |bugzilla digitalmars.com
           Severity|normal                      |critical


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 08 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=926


Stewart Gordon <smjg iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P5                          |P2
            Version|D2                          |unspecified
           Severity|critical                    |normal


--- Comment #3 from Stewart Gordon <smjg iname.com> 2011-01-08 15:26:39 PST ---
The version, priority and severity changes just made make no sense at all.

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