digitalmars.D.bugs - [Issue 2056] New: Const system does not allow certain safe casts/conversions involving deep composite types
- d-bugmail puremagic.com (28/28) Apr 28 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2056
- d-bugmail puremagic.com (18/18) May 28 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2056
- d-bugmail puremagic.com (15/15) Nov 17 2010 http://d.puremagic.com/issues/show_bug.cgi?id=2056
- d-bugmail puremagic.com (6/6) Nov 17 2010 http://d.puremagic.com/issues/show_bug.cgi?id=2056
- d-bugmail puremagic.com (15/15) Nov 18 2010 http://d.puremagic.com/issues/show_bug.cgi?id=2056
- d-bugmail puremagic.com (6/8) Nov 18 2010 So what does the fix for bug 3621, I wonder? (It's for dmd 2.038)
- d-bugmail puremagic.com (9/13) Nov 19 2010 http://d.puremagic.com/issues/show_bug.cgi?id=2056
http://d.puremagic.com/issues/show_bug.cgi?id=2056 Summary: Const system does not allow certain safe casts/conversions involving deep composite types Product: D Version: 2.013 Platform: PC OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: critical Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: brunodomedeiros+bugz gmail.com Const system does not allow certain safe casts/conversions involving deep composite types. In the following example, all casts should be allowed. ---- void testcases() { int[][] intArrayArray; int[][][] intArrayArrayArray; const(int)[][] f1 = intArrayArray; // Error here const(int[])[] f2 = intArrayArray; const(int)[][][] g1 = intArrayArrayArray; // Error here const(int[])[][] g2 = intArrayArrayArray; // Error here const(int[][])[] g3 = intArrayArrayArray; } --
Apr 28 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2056 I'm not sure if I should open a new bug or not, but since this one is still open, I'll put it here. The array cases seem to be fixed in DMD 2.14, but the very same problem still exists with pointer types, for example: void testcases() { int** intPtrPtr; int*** intPtrPtrPtr; const(int)** h1 = intPtrPtr; // Error here const(int*)* h2 = intPtrPtr; const(int)*** i1 = intPtrPtrPtr; // Error here const(int*)** i2 = intPtrPtrPtr; // Error here const(int**)* i3 = intPtrPtrPtr; } Similar issues also exist for associative arrays. --
May 28 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2056 Bruno Medeiros <bdom.pub+deebugz gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID 12:15:17 PST --- The latest DMD compiles both code samples now, *however*, I've come to realize that in fact this code should NOT be allowed (that is, any of the "Error here" lines in the code above should produce an error), because these casts are actually not safe. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 17 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2056 14:21:51 PST --- So this is a regression? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 17 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2056 04:06:29 PST --- A regression? Not exactly. When this bug was submitted, the lines marked with "// Error here" did not compile, and that was the "bug" that was reported. At some point DMD was changed so that the first, and later both code samples above compiled without errors. (I don't know if it was because Walter tried to fix this "bug" specifically, or if it was due to some other DMD changes). actually invalid, and should not have been fixed in the first place. ( For curiosity, it would only be valid if immutable did not exist, or more precisely, if T was the only subtype of const(T) ) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 18 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2056 12:11:28 PST ---When this bug was submitted, the lines marked with "// Error here" did not compileSo what does the fix for bug 3621, I wonder? (It's for dmd 2.038) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 18 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2056 15:20:41 PST ---not fixed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------When this bug was submitted, the lines marked with "// Error here" did not compileSo what does the fix for bug 3621, I wonder? (It's for dmd 2.038)
Nov 19 2010