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
Looks like another case of http://d.puremagic.com/issues/show_bug.cgi?id=9549. That one was closed after it was fixed by accident: https://github.com/D-Programming-Language/dmd/pull/1676#issuecomment-14059594 Apparently it's resurfaced again in this new test-case.
Comment #2 by k.hara.pg — 2013-05-25T21:20:49Z
(In reply to comment #1) > Looks like another case of http://d.puremagic.com/issues/show_bug.cgi?id=9549. > That one was closed after it was fixed by accident: > https://github.com/D-Programming-Language/dmd/pull/1676#issuecomment-14059594 > > Apparently it's resurfaced again in this new test-case. This 'regression' is not caused by the compiler change. It is introduced by a Phobo change: https://github.com/D-Programming-Language/phobos/commit/895550649f07dabfb0d8fc7693027e86065b3e57 I think that essentially incomplete compiler's template error report mechanism would be the root cause of such redundant errors.
Comment #3 by k.hara.pg — 2013-05-27T05:58:54Z
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.
Comment #6 by k.hara.pg — 2013-07-13T23:48:30Z
Comment #7 by github-bugzilla — 2013-07-15T00:19:47Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/8c5cce3e6ffd63ad3af23caf2e15ea7a3eabeea5 fix Issue 10141 - wrong error message with Tuple!(int) : Error: static assert "Cannot put a char[] into a Appender!(string)" Essentially it's bad code if it branches based on the condition `global.errors != 0`. https://github.com/D-Programming-Language/dmd/commit/390a9340cad6f9c44757cd4782792b08d95a56ba Merge pull request #2346 from 9rnsr/fix10141 Issue 10141 - wrong error message with Tuple!(int) : Error: static assert "Cannot put a char[] into a Appender!(string)"