|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 3067] New: std.range.chain returns a range of wrong type elements
http://d.puremagic.com/issues/show_bug.cgi?id=3067 Summary: std.range.chain returns a range of wrong type elements Product: D Version: 2.030 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: rayerd.wiz gmail.com import std.stdio; import std.algorithm; import std.range; void main() { f(chain("a")); // immutable(char) <- OK f(chain("a".dup)); // char <-------- ? f(chain("a".dup, "b")); // int <---- NG } void f(Range)(Range r) { writeln(typeid(ElementType!(Range))); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- Jun 13 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3067 --- Comment #1 from Haruki Shigemori <rayerd.wiz gmail.com> 2009-06-13 15:40:47 PDT --- (In reply to comment #0) - f(chain("a".dup)); // char <-------- ? + f(chain("a".dup)); // char <-------- OK -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- Jun 13 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3067 Andrei Alexandrescu <andrei metalanguage.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|andrei metalanguage.com |bugzilla digitalmars.com --- Comment #2 from Andrei Alexandrescu <andrei metalanguage.com> 2009-08-27 23:03:45 PDT --- This is a bug in the compiler. Consider: import std.stdio; void main() { auto x = true ? ("a".dup)[0] : "b"[0]; writeln(typeof(x).stringof); } This program prints int, meaning that the common type of a char and immutable(char) is int. It should be char. I'm reassigning this to Walter. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- Aug 27 2009
|