www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - to! fails with fixed length char array for dmd 2.051

reply stephan <none example.com> writes:
The following code worked fine with dmd 2.050, but fails to compile for dmd
2.051. Any reason for this (other than a bug)?

import std.conv;

void main() {
    char[4] t = "test";
    auto s = to!(dstring)(t);
}

Error message seems to indicate that two templates match, one checking for
isStaticArray, and one checking for isSomeString:

C:\D2\dmd2\windows\bin\..\..\src\phobos\std\conv.d(99): Error: template
std.conv.toImpl(T,S) if (!implicitlyConverts!(S,T) && isSomeString!(T) &&
isInputRange!(Unqual!(S)) && isSomeChar!(ElementType!(S))) toImpl(T,S) if
(!implicitlyConverts!(S,T) && isSomeString!(T) && isInputRange!(Unqual!(S))
&& isSomeChar!(ElementType!(S))) matches more than one template declaration,
C:\D2\dmd2\windows\bin\..\..\src\phobos\std\conv.d(114):toImpl(T,S) if
(!implicitlyConverts!(S,T) && isSomeString!(T) && isInputRange!(Unqual!(S))
&& isSomeChar!(ElementType!(S))) and
C:\D2\dmd2\windows\bin\..\..\src\phobos\std\conv.d(224):toImpl(T,S) if
(isStaticArray!(S))
Jan 06 2011
parent Jesse Phillips <jessekphillips+D gmail.com> writes:
Probably an instance of this bug:

http://d.puremagic.com/issues/show_bug.cgi?id=5381
Jan 06 2011