https://issues.dlang.org/show_bug.cgi?id=12512
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #6 from [email protected] --- (In reply to Walter Bright from comment #5) > The s.dup should work. Marking this as a bug, not an enhancement. It's NOT a bug! > Note that: > > const(int*)[] s; > s.dup; > > does work. That's *still* a type where "const(T) : T": "Unqual!(const(int*))" is "const(int)*". dup simply *can't* work for certain types. For example, something as trivial as classes: //---- class A{} void main() { const(A)[] a; a.dup; } //---- Error: cannot implicitly convert element type const(A) to mutable in a.dup //---- > Not going to do a .cdup Fine. Could we then allow "dup" to return "const(T)[]" for the cases where it can't return a mutable then? --
