Thread overview | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 17, 2010 [Issue 4662] New: Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=4662 Summary: Array ops on const arrays Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2010-08-17 07:06:13 PDT --- This D2 program shows two problems (dmd 2.048): void foo(const double[] arr1) { arr1[] += 1; // line 2, no error here double[] arr2; arr1[] += arr2[]; // line 4, Error here } void main() {} The first problem is at line 2, where the const nature of arr1 is ignored. The second problem is at line 4, that generates a wrong error message: test.d(4): Error: invalid array operation arr1[] += cast(const(double[]))arr2[] (did you forget a [] ?) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 28, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dsimcha@yahoo.com --- Comment #1 from yebblies <yebblies@gmail.com> 2012-01-28 18:27:05 EST --- *** Issue 7286 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: ------- |
January 28, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid CC| |yebblies@gmail.com Platform|x86 |All AssignedTo|nobody@puremagic.com |yebblies@gmail.com OS/Version|Windows |All --- Comment #2 from yebblies <yebblies@gmail.com> 2012-01-28 18:38:19 EST --- Looks like the fix for issue 5284 only got assignment. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 28, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #3 from yebblies <yebblies@gmail.com> 2012-01-28 19:57:33 EST --- https://github.com/D-Programming-Language/dmd/pull/648 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 14, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 --- Comment #4 from github-bugzilla@puremagic.com 2012-07-14 07:19:24 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e917e1e404f8dc6b3440788d40fcf936c51bdf57 Fix Issue 4662 - Array ops on const arrays For BinAssignExp, check that the lhs is assignable or mutable. https://github.com/D-Programming-Language/dmd/commit/738114f00b12726a14fb4a65abe825957f82875d Merge pull request #648 from yebblies/issue4662 Issue 4662 - Array ops on const arrays -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 14, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 --- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> 2012-07-14 08:11:15 PDT --- Additional fix for yebblies's patch: https://github.com/D-Programming-Language/dmd/pull/1046 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 15, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 --- Comment #6 from bearophile_hugs@eml.cc 2012-07-15 04:15:20 PDT --- The two problems of the example seems fixed. Now this program: void main() { const int[] a = new int[5]; int[] b = new int[5]; b[] += a[]; } Gives: test.d(4): Error: slice cast(const(int)[])b[] is not mutable I think is a rejects-valid. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 15, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 --- Comment #7 from yebblies <yebblies@gmail.com> 2012-07-15 23:05:17 EST --- (In reply to comment #6) > The two problems of the example seems fixed. Now this program: > > > void main() { > const int[] a = new int[5]; > int[] b = new int[5]; > b[] += a[]; > } > > > Gives: > test.d(4): Error: slice cast(const(int)[])b[] is not mutable > > I think is a rejects-valid. Yes, my mistake. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 15, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 --- Comment #8 from yebblies <yebblies@gmail.com> 2012-07-15 23:24:37 EST --- Ok, not really my mistake, but a problem with typeMerge or the use of typeMerge in BinAssignExp::semantic. It doesn't make any sense for a BinAssignExp or a BinAssignExp::e1 to be type-merged with the rhs, ever. Bearophile, could you please open another bug for this? It is a regression because this bug previously hid the error. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 15, 2012 [Issue 4662] Array ops on const arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4662 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #9 from bearophile_hugs@eml.cc 2012-07-15 07:49:23 PDT --- (In reply to comment #8) > Ok, not really my mistake, but a problem with typeMerge or the use of typeMerge in BinAssignExp::semantic. It doesn't make any sense for a BinAssignExp or a BinAssignExp::e1 to be type-merged with the rhs, ever. > > Bearophile, could you please open another bug for this? It is a regression because this bug previously hid the error. OK, thank you for answering. I close this bug report as fixed, and I have opened a new regression, Issue 8390 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation