digitalmars.D.bugs - [Issue 1298] New: More on foreach and tuple
- d-bugmail puremagic.com (39/39) Jun 29 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1298
- d-bugmail puremagic.com (14/14) Jun 29 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1298
- d-bugmail puremagic.com (12/12) Aug 25 2009 http://d.puremagic.com/issues/show_bug.cgi?id=1298
- d-bugmail puremagic.com (12/12) Jan 30 2010 http://d.puremagic.com/issues/show_bug.cgi?id=1298
http://d.puremagic.com/issues/show_bug.cgi?id=1298 Summary: More on foreach and tuple Product: D Version: 1.017 Platform: PC OS/Version: Windows Status: NEW Severity: blocker Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: samukha voliacable.com These may be duplicates of other reported tuple bugs. Also, it would be awesome if some info about compile-time expansion of foreach on tuples is added to docs (in ForeachStatement section?). Thanks! All statements in foreach block below should compile for both CTFE and RTFE: import std.stdio; template Foo(Strings...) { char[] bar() { char[] ret; foreach (s; Strings) { static assert(is(typeof(s) : char[])); //RTFE ok. CTFE fails pragma(msg, typeof(s).stringof); //RTFE ok. CTFE fails pragma(msg, s); //Error: string expected for message, not 's' ret ~= s; //RTFE ok. CTFE fails } return ret; } } void main(char[][] args) { alias Foo!("eeny", "meeny", "miny", "mo") foo; static s = foo.bar(); writefln(foo.bar()); } --
Jun 29 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1298 ------- Comment #1 from samukha voliacable.com 2007-06-29 10:37 ------- One more bug: template Foo(Strings...) { const a1 = ["one", "two"]; //ok const a2 = [Strings]; // Error: cannot implicitly convert expression (tuple("one","two")) of type (char[3], char[3]) to char } void main(char[][] args) { alias Foo!("one", "two") foo; } --
Jun 29 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1298 --- Comment #2 from Don <clugdbug yahoo.com.au> 2009-08-25 01:18:12 PDT --- The second bug here does not involve CTFE. I've created a new bug (bug #3263)for it. It is completely unrelated to the first bug. Please don't append new bugs to existing bug reports. It's easy enough to mark bugs as duplicates, but it's really a pain to split them. Especially once people have voted for the bug, as in this case. This one fails because it requires slice assignment to char[] arrays, which is not yet implemented. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 25 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1298 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED --- Comment #3 from Walter Bright <bugzilla digitalmars.com> 2010-01-30 22:39:29 PST --- fixed dmd 1.056 and 2.040 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 30 2010