January 06, 2011 to! fails with fixed length char array for dmd 2.051 | ||||
---|---|---|---|---|
| ||||
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)) |
January 06, 2011 Re: to! fails with fixed length char array for dmd 2.051 | ||||
---|---|---|---|---|
| ||||
Posted in reply to stephan | Probably an instance of this bug: http://d.puremagic.com/issues/show_bug.cgi?id=5381 |
Copyright © 1999-2021 by the D Language Foundation