[Issue 8892] Not precise error message with failed fixed size array assign

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 26 14:35:22 PST 2013


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



--- Comment #4 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-01-26 14:35:20 PST ---
(In reply to comment #2)
> struct Foo {
>     char[2] data;
> }
> void main() {
>     auto f = Foo(['A']);
> }

What I don't understand is why the above fails at compile-time but the
following compiles (it fails at runtime):

char[2] data = ['A'];

$ object.Error: lengths don't match for array copy, 2 = 1

I think this case should also an accepts-invalid, because the compiler can see
at compile-time that the lengths don't match.

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