https://issues.dlang.org/show_bug.cgi?id=8243
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|cannot initialize tuple |cannot initialize tuple |with an element at module |with an element at module |scope |scope but this is allowed | |in function-local scopes --- Comment #6 from [email protected] --- (In reply to hsteoh from comment #5) > I think those look like bugs. While investigating a related issue recently, > I noted that some parts of dmd don't appear to treat tuple types properly, > so I wouldn't be surprised if things like what you posted are unintentional > bugs. To me, it makes no sense to declare something with a tuple type of > multiple items, yet the initializer receives only one argument. This is allowed too: void main(){ int[2] x=2; } > Even if this is intentionally allowed, I'd assume so, though /maybe/ the duplication of side-effects is unintentional. > I'd argue it's a misfeature because it makes it > too easy for a typo to silently cause bugs. I don't disagree at all, but the behaviour should in any case be consistent. --
