Thread overview
[Issue 10141] New: wrong error message with Tuple!(int) : Error: static assert "Cannot put a char[] into a Appender!(string)"
May 24, 2013
Andrej Mitrovic
May 26, 2013
Kenji Hara
May 27, 2013
Kenji Hara
Jul 13, 2013
Henning Pohl
Jul 13, 2013
Andrej Mitrovic
Jul 14, 2013
Kenji Hara
Jul 16, 2013
Kenji Hara
May 23, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141

           Summary: wrong error message with Tuple!(int) : Error: static
                    assert  "Cannot put a char[] into a Appender!(string)"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: thelastmammoth@gmail.com


--- Comment #0 from thelastmammoth@gmail.com 2013-05-23 02:16:28 PDT ---
----
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 24, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-05-23 19:14:33 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 26, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141



--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2013-05-25 21:20:49 PDT ---
(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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 27, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
           Severity|regression                  |normal


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2013-05-27 05:58:54 PDT ---
I think this is not a blocker regression against 2.063 release. Change the importance.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 13, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141


Henning Pohl <henning@still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |henning@still-hidden.de
           Severity|normal                      |critical


--- Comment #4 from Henning Pohl <henning@still-hidden.de> 2013-07-13 12:41:26 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 13, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141



--- Comment #5 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-07-13 13:26:19 PDT ---
(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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 14, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #6 from Kenji Hara <k.hara.pg@gmail.com> 2013-07-13 23:48:30 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2346

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 15, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141



--- Comment #7 from github-bugzilla@puremagic.com 2013-07-15 00:19:47 PDT ---
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)"

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 16, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10141


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------