[Issue 2006] Empty array literals with explicit type implicitly convert to any array type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 3 18:11:01 PST 2012


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


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Appending empty array using |Empty array literals with
                   |~= cast(T[]) [] doesn't     |explicit type implicitly
                   |work                        |convert to any array type


--- Comment #9 from yebblies <yebblies at gmail.com> 2012-02-04 13:10:58 EST ---
No, you're wrong.  I just wrote a patch to fix this bug, I think I know where
the problem was and what I had to change to fix it.

eg.
struct S {}

void main()
{
        int[] x = cast(S[])[];
}

It has nothing to do with appending, but the fact that for T[][] the compiler
has to choose to append an empty array as a T[] or a T[][], and it does this by
checking implicit conversions, which pass incorrectly.

Please at least read the patch before deciding you know what the problem is.

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