D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4945 - Bad error message with wrong struct literal
Summary: Bad error message with wrong struct literal
Status: RESOLVED DUPLICATE of issue 8892
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 enhancement
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2010-09-26 10:36 UTC by bearophile_hugs
Modified: 2015-12-09 12:23 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 bearophile_hugs 2010-09-26 10:36:03 UTC
struct Foo(int N) {
    int[N] bar;
}
void main() {
    auto r = Foo!(1)([1, 2]);
}


DMD 2.049 shows:
test.d(5): Error: cannot implicitly convert expression ([1,2]) of type int[] to int

But I think there are no int types here, just an int array of the wrong length.
Comment 1 Infiltrator 2015-12-09 09:53:09 UTC
dmd 2.069 shows the error as
Error: cannot implicitly convert expression ([1, 2]) of type int[] to int[1]

Would you call this fixed?
Comment 2 Kenji Hara 2015-12-09 12:23:08 UTC

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