to!(ubyte[])("")

simendsjo simendsjo at gmail.com
Fri Jun 22 02:18:38 PDT 2012


Bug or by design? (using dmd head)

import std.conv;
void main() {
     to!(ubyte[])("");
}


std/array.d(493): Attempting to fetch the front of an empty array of  
immutable(char)
----------------
to(_d_assert_msg+0x45) [0x43700d]
to(@property dchar  
std.array.front!(immutable(char)[]).front(immutable(char)[])+0x4c)  
[0x42f2b8]
to(ubyte[] std.conv.parse!(ubyte[], immutable(char)[]).parse(ref  
immutable(char)[], dchar, dchar, dchar).void  
parseCheck!(_D3std4conv17__T5parseTAhTAyaZ5parseFKAyawwwZAh1sAya).parseCheck(dchar,  
immutable(char)[], ulong)+0x2f) [0x43482b]
to(ubyte[] std.conv.parse!(ubyte[], immutable(char)[]).parse(ref  
immutable(char)[], dchar, dchar, dchar)+0x49) [0x42f50d]
to(ubyte[] std.conv.toImpl!(ubyte[],  
immutable(char)[]).toImpl(immutable(char)[])+0x31) [0x42f619]
to(ubyte[]  
std.conv.to!(ubyte[]).to!(immutable(char)[]).to(immutable(char)[])+0x20)  
[0x42f268]
to(_Dmain+0x1a) [0x42f242]


More information about the Digitalmars-d-learn mailing list