www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10141] New: wrong error message with Tuple!(int) : Error: static assert "Cannot put a char[] into a Appender!(string)"

reply d-bugmail puremagic.com writes:
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



----
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 23 2013
next sibling parent d-bugmail puremagic.com writes:
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



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 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10141





 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 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
May 27 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Jul 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10141




13:26:19 PDT ---

 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: -------
Jul 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10141


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

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



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: -------
Jul 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10141




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


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: -------
Jul 15 2013
prev sibling parent d-bugmail puremagic.com writes:
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: -------
Jul 16 2013