digitalmars.D.bugs - [Issue 8892] New: Not precise error message with failed fixed size array assign
- d-bugmail puremagic.com (36/36) Oct 25 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (11/15) Oct 25 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (14/16) Oct 25 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (6/6) Nov 29 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (12/18) Jan 26 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (17/17) Jan 26 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (25/34) Jan 27 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (11/11) Jan 27 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (11/11) Jan 27 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (10/10) Feb 11 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8892
- d-bugmail puremagic.com (10/10) Feb 11 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8892
http://d.puremagic.com/issues/show_bug.cgi?id=8892 Summary: Not precise error message with failed fixed size array assign Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: diagnostic Severity: minor Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc struct Foo { char[3] data; } int bar(Foo f) { return f.data[0]; } void main() { auto f = Foo(['A', 'B']); } DMD 2.061alpha: test.d(8): Error: cannot implicitly convert expression (['A','B']) of type char[] to char A better error message is: test.d(8): Error: cannot implicitly convert expression (['A','B']) of type char[] to char[4] Or even something like: test.d(8): Error: cannot implicitly convert expression (['A','B']) of type char[] to char[4] ('Foo.data' field) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 25 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8892 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich gmail.com 10:47:34 PDT ---A better error message is: test.d(8): Error: cannot implicitly convert expression (['A','B']) of type char[] to char[4]Don't you mean char[3]? Also the 'bar' function is not necessary for test-case. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 25 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8892Don't you mean char[3]?Right, sorry (this code comes from Issue 8893 ).Also the 'bar' function is not necessary for test-case.Right, shorter test case: struct Foo { char[2] data; } void main() { auto f = Foo(['A']); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 25 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8892 14:49:23 PST --- *** Issue 8918 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 29 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8892 14:35:20 PST ---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: -------
Jan 26 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8892 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull Platform|x86 |All AssignedTo|nobody puremagic.com |andrej.mitrovich gmail.com Summary|Not precise error message |Wrong diagnostic for static |with failed fixed size |array assignment |array assign | OS/Version|Windows |All Severity|minor |normal 14:44:44 PST --- https://github.com/D-Programming-Language/dmd/pull/1558 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 26 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8892What 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.It is known inconsistency around static array initialization. int[3] garr = [1,2]; // When creating data section, garr[2] is filled by 0 void main() { int[3] larr = [1,2]; // This is translated to runtime element-wise blit assign: // larr[0..3] = [1,2] // and fails at runtime. } When we based on the issue, following code still have similar issue. struct Foo { char[2] data; } void main() { auto f = Foo(['A']); // 1. should be compile time error, array length mismatch, or // 2. the initializer should be translated to Foo(['A', char.init]) ? } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 27 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8892 Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/646ce34fae3a1e12032bb7a2343e54daf0074db0 Fixes Issue 8892 - Better diagnostic for static array assignment. https://github.com/D-Programming-Language/dmd/commit/c316e2e6d059b7e6fdc6ae8616e72dfda9dfa8f6 Issue 8892 - Better diagnostic for static array assignment -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 27 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8892 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Error message is now improved. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 27 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8892 Commits pushed to staging at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/646ce34fae3a1e12032bb7a2343e54daf0074db0 Fixes Issue 8892 - Better diagnostic for static array assignment. https://github.com/D-Programming-Language/dmd/commit/c316e2e6d059b7e6fdc6ae8616e72dfda9dfa8f6 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 11 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8892 Commits pushed to https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/646ce34fae3a1e12032bb7a2343e54daf0074db0 Fixes Issue 8892 - Better diagnostic for static array assignment. https://github.com/D-Programming-Language/dmd/commit/c316e2e6d059b7e6fdc6ae8616e72dfda9dfa8f6 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 11 2013