[Issue 1396] lazy void tuple breaks

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 2 15:12:18 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1396





------- Comment #2 from ibisbasenji at gmail.com  2007-08-02 17:12 -------
(In reply to comment #0)
> import std.stdio;
> template tuple(T...) { alias T tuple; }
> void test(lazy tuple!(void, void) a) { a[0](); a[1](); }
> void main() { test(writefln("Hello"), writefln("World")); }
> 
> Expected: "Hello\nWorld"
> Resulted: Error: cannot have parameter of type void.
> Observed: Seems as if the lazy isn't being applied to all the tuple members as
> it should be.
> 
>  --downs
> 

Since 'lazy void' is really shorthand for 'void delegate()' I wouldn't actually
have expected 'lazy' to work in this way anyhow...  Although it could indeed be
useful.  Try running it with 'tuple!(lazy void, lazy void) a' and it should
work.

I consider this an enhancement request, or clarification request, rather than a
bug.  (It'd be a nice enhancement, though.)


-- 



More information about the Digitalmars-d-bugs mailing list