D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 926 - Revival of implicit conversion from Derived[] to Base[] not noted in changelog
Summary: Revival of implicit conversion from Derived[] to Base[] not noted in changelog
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 normal
Assignee: Stewart Gordon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-03 11:14 UTC by Carlos Santander
Modified: 2015-12-16 02:18 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Carlos Santander 2007-02-03 11:14:46 UTC
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.
Comment 1 Thomas Kühne 2007-04-05 11:33:19 UTC
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.
>
Comment 2 Stewart Gordon 2009-02-24 09:30:56 UTC
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.
Comment 3 Stewart Gordon 2011-01-08 15:26:39 UTC
The version, priority and severity changes just made make no sense at all.
Comment 4 Walter Bright 2012-01-29 02:10:38 UTC
This is D1 only. D2 does not allow it.

The D1 spec allows it, and changing it would be an enhancement.
Comment 5 Stewart Gordon 2012-01-29 07:15:47 UTC
The D1 spec allows what?

The spec and the changelog to contradict each other?

In which DMD version was this misfeature revived, anyway?
Comment 6 Walter Bright 2012-01-29 10:29:25 UTC
(In reply to comment #5)
> The D1 spec allows what?

It allows implict conversion of an array of derived classes to an array of base classes. Thomas quoted the relevant verbage.


> The spec and the changelog to contradict each other?

What matters is what the spec says and what the compiler does now. If someone wants to go through the compiler/spec diffs from years ago to see when things changed, that's fine and I'll fold in changelog changes if they present them, but I've got a lot of current issues to address, and historical spelunking is off the radar.


> In which DMD version was this misfeature revived, anyway?

I don't know. I agree it is a misfeature, but I am loathe to break existing D1 code at this point, so I believe it should stay as it is.
Comment 7 Stewart Gordon 2012-01-30 08:55:26 UTC
(In reply to comment #6)

> What matters is what the spec says and what the compiler does now. If someone
> wants to go through the compiler/spec diffs from years ago to see when things
> changed, that's fine and I'll fold in changelog changes if they present them,

The standard meaning of WONTFIX is "this issue is to stay as it is" not "I personally can't be bothered/don't have time to deal with it".  The way to indicate the latter is to leave it open and reassign it to nobody - this shows that it's free for anybody to take the issue and work on it.

Here's an idea: I'll have a look at it myself over the next few days.
Comment 8 Walter Bright 2012-01-30 11:27:08 UTC
(In reply to comment #7)
> Here's an idea: I'll have a look at it myself over the next few days.

I'll be happy to merge in any changes you suggest.
Comment 9 Jack Stouffer 2015-12-16 02:18:57 UTC
Remarking this as won't fix because it's a luxury D1 issue that no one really has time for, and frankly, who honestly cares? No one uses D1 anymore and the fact that a changelog entry is missing for something that came out eight years ago now is not going to be fixed.