Bug 10141 – wrong error message with Tuple!(int) : Error: static assert "Cannot put a char[] into a Appender!(string)"
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-23T02:16:00Z
Last change time
2013-07-16T10:30:41Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
thelastmammoth
Comments
Comment #0 by thelastmammoth — 2013-05-23T02:16:28Z
----
main.d:
import std.typecons;
import std.typecons:unexisting_symbol;
Tuple!(int) fun(){return Tuple!(int).init;}
----
dmd 2.062:
dmd main.d:
main.d:Error: module std.typecons import 'unexisting_symbol' not found
(which is correct)
dmd 2.063(beta5):
dmd main.d:
main.d: Error: module std.typecons import 'unexisting_symbol' not found
dmd2_063_beta5/osx/bin/../../src/phobos/std/range.d(611): Error: static assert "Cannot put a char[] into a Appender!(string)"
dmd2_063_beta5/osx/bin/../../src/phobos/std/format.d(1433): instantiated from here: put!(Appender!(string), char[])
dmd2_063_beta5osx/bin/../../src/phobos/std/format.d(1335): instantiated from here: formatUnsigned!(Appender!(string), char)
dmd2_063_beta5/osx/bin/../../src/phobos/std/format.d(1309): instantiated from here: formatIntegral!(Appender!(string), ulong, char)
dmd2_063_beta5/osx/bin/../../src/phobos/std/format.d(2950): ... (3 instantiations, -v to show) ...
dmd2_063_beta5/osx/bin/../../src/phobos/std/typecons.d(326): instantiated from here: format!(char, ulong, ulong)
main.d(3): instantiated from here: Tuple!(int)
(which is incorrect : the stuff after the 1st line doesnt' make sense)
I'm on osx if that matters.
Comment #1 by andrej.mitrovich — 2013-05-23T19:14:33Z
I think this is not a blocker regression against 2.063 release.
Change the importance.
Comment #4 by henning — 2013-07-13T12:41:26Z
A bit more reduced:
---
import std.typecons;
lets cause_an_error;
Tuple!int tf;
---
I have seen this bug hiding other erros, so only the "static assert
"Cannot put a char[] into a Appender!(string)"" error and the instantiation trace shows up. This becomes really really bad in big code bases. I've experienced this multiple times.
Comment #5 by andrej.mitrovich — 2013-07-13T13:26:19Z
(In reply to comment #4)
> This becomes really really bad in big code bases. I've
> experienced this multiple times.
Yeah me too, lately quite often.