[Issue 8243] cannot initialize tuple with an element at module scope

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 18 01:52:22 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=8243

--- Comment #3 from timon.gehr at gmx.ch ---
(In reply to hsteoh from comment #2)
> Why should this code be accepted? TypeTuple!(int,int) expects two
> initializers, but only one is specified.


The validity of this code should be consistent with the validity of the code
below:
alias Seq(T...)=T;
void main(){
    Seq!(int,int) a=12;
}

We can also just disallow that code as well, those type tuple initializers
behave in a quite strange way anyway:

alias Seq(T...)=T
void main(){
    int x=0;
    Seq!(int,int) a=x++;
    import std.stdio;
    writeln(a); // "01"
}

--


More information about the Digitalmars-d-bugs mailing list