D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6567 - Type deduction of empty array literal is inconsistent
Summary: Type deduction of empty array literal is inconsistent
Status: RESOLVED DUPLICATE of issue 4953
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-08-27 22:12 UTC by Kenji Hara
Modified: 2011-08-28 21:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2011-08-27 22:12:38 UTC
This code fails to compile, but it shouldn't.

void foo1(Object[] a){}
void foo2()(Object[] a){}
void foo3(T)(T[] a){}

void bar1(Object[][] a){}
void bar2()(Object[][] a){}
void bar3(T)(T[][] a){}

void main()
{
    foo1([]);   // OK
    foo2([]);   // NG
    foo3([]);   // OK, T == void

    bar1([[]]); // OK
    bar2([[]]); // NG
    bar3([[]]); // OK, T == void
}
Comment 1 yebblies 2011-08-28 21:39:56 UTC

*** This issue has been marked as a duplicate of issue 4953 ***