[Issue 8338] New: Unqual doesn't work properly on arrays
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 2 19:12:35 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8338
Summary: Unqual doesn't work properly on arrays
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: jmdavisProg at gmx.com
--- Comment #0 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-07-02 19:12:33 PDT ---
Take this bit of code
import std.stdio;
import std.traits;
void main()
{
writeln(Unqual!(char[]).stringof);
writeln(Unqual!(wchar[]).stringof);
writeln(Unqual!(dchar[]).stringof);
writeln(Unqual!(const char[]).stringof);
writeln(Unqual!(const wchar[]).stringof);
writeln(Unqual!(const dchar[]).stringof);
writeln(Unqual!string.stringof);
writeln(Unqual!wstring.stringof);
writeln(Unqual!dstring.stringof);
writeln();
writeln(Unqual!(ubyte[]).stringof);
writeln(Unqual!(short[]).stringof);
writeln(Unqual!(uint[]).stringof);
writeln(Unqual!(const ubyte[]).stringof);
writeln(Unqual!(const short[]).stringof);
writeln(Unqual!(const uint[]).stringof);
writeln(Unqual!(immutable ubyte[]).stringof);
writeln(Unqual!(immutable short[]).stringof);
writeln(Unqual!(immutable uint[]).stringof);
}
It prints out
char[]
wchar[]
dchar[]
const(char)[]
const(wchar)[]
const(dchar)[]
string
immutable(wchar)[]
immutable(dchar)[]
ubyte[]
short[]
uint[]
const(ubyte)[]
const(short)[]
const(uint)[]
immutable(ubyte)[]
immutable(short)[]
immutable(uint)[]
None of those const or immutables should be there. The only changes between
this and not using Unqual at all is the const T[] are now const(T)[] and the
immutable T[] are now immutable(T)[]. And the immutable(T)[], are still
immutable(T)[]. The immutable on their elements aren't stripped.
Unqual specifically states that it removes _all_ qualifiers. It's clearly only
removing them from the array itself and not the elements, so it's not removing
all of the qualifiers.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list