Bug 7311 – typeof(x~y) should never be const(T)[] if T has no mutable indirections

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2012-01-18T10:56:00Z
Last change time
2013-04-25T23:37:06Z
Assigned to
nobody
Creator
timon.gehr

Comments

Comment #0 by timon.gehr — 2012-01-18T10:56:30Z
typeof(x~y) should never be const(T)[]. const only has a meaning in presence of aliasing. Unique const data is meaningless. int[] a; immutable int[] b; const int[] c; static assert(typeof(a~b)==int[]); static assert(typeof(a~c)==int[]); static assert(typeof(b~b)==immutable(int)[]); static assert(typeof(b~c)==immutable(int)[]); static assert(typeof(c~c)==int[]);
Comment #1 by timon.gehr — 2012-01-19T02:31:01Z
(of course, this only applies if T has no mutable indirections)
Comment #2 by yebblies — 2013-04-25T23:37:06Z
*** This issue has been marked as a duplicate of issue 1654 ***