Bug 11299 – Regression (2.064 git-head): formattedRead does not compile without -unittest
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-19T03:58:00Z
Last change time
2013-10-19T06:27:28Z
Keywords
pull, rejects-valid
Assigned to
andrej.mitrovich
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2013-10-19T03:58:32Z
-----
import std.format;
import std.typecons;
void main()
{
Tuple!(int, int) t;
string s = "1 2";
formattedRead(s, "%s %s", &t);
}
-----
C:\dev\code\d_code>dmd test.d
DMD v2.064 DEBUG
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(578): Error: template instance isTuple!A template 'isT
uple' is not defined
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(588): Error: template std.format.unformatValue does no
t match any function template declaration. Candidates are:
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(3939): std.format.unformatValue(T, Range, Char)
(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && is(Unqual!T == bool))
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(3994): std.format.unformatValue(T, Range, Char)
(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && is(T == typeof(null)))
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(4006): std.format.unformatValue(T, Range, Char)
(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && isIntegral!T && !is(T == enum))
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(4026): std.format.unformatValue(T, Range, Char)
(ref Range input, ref FormatSpec!Char spec) if (isFloatingPoint!T && !is(T == enum))
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(4102): std.format.unformatValue(T, Range, Char)
(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && isSomeChar!T && !is(T == enum))
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(588): ... (4 more, -v to show) ...
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\format.d(588): Error: template std.format.unformatValue(T, Rang
e, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && is(Unqual!T == bool)) cannot deduc
e template function from argument types !(Tuple!(int, int))(string, FormatSpec!char)
test.d(10): Error: template instance std.format.formattedRead!(string, char, Tuple!(int, int)*) error instantiat
ing
This is going to keep happening if we only run the test-suite with the -unittest flag.
Comment #1 by andrej.mitrovich — 2013-10-19T03:59:56Z
(In reply to comment #0)
> This is going to keep happening if we only run the test-suite with the
> -unittest flag.
Well actually, there's no other way to test the function. It's an interesting problem for sure. Anyway a pull is coming soon.
Comment #2 by andrej.mitrovich — 2013-10-19T04:01:37Z