Bug 5296 – 2.50: std.conv.to!string() fails on char[ 256 ] buf

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-12-01T04:36:00Z
Last change time
2012-05-12T06:45:16Z
Assigned to
andrei
Creator
ah08010-d

Comments

Comment #0 by ah08010-d — 2010-12-01T04:36:46Z
This code: ========== module scratch; import std.conv; void main() { char[ 256 ] buf; auto s = to!string( buf ); } ========== Produces this error. This appears to be 2.50 specific, since the code from which this test case derives has been working for some time under .49 ========== $ dmd -run scratch.d d:\Devel\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(95): 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, d:\Devel\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(110):toImpl(T,S) if (!implicitlyConverts!(S,T) && isSomeString!(T) && isInputRange!(Unqual!(S)) && isSomeChar!(ElementType!(S))) and d:\Devel\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(220):toImpl(T,S) if (isStaticArray!(S)) ========== It's worth noting that the error message is pretty much incomprehensible due to the enormously long template conditions, and that it doesn't refer at all to the original source line.
Comment #1 by lovelydear — 2012-04-22T09:23:38Z
Compiles fine under 2.059