D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6369 - alias this doesn't work with initializer
Summary: alias this doesn't work with initializer
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-23 06:07 UTC by Kenji Hara
Modified: 2011-08-25 15:04 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2011-07-23 06:07:33 UTC
D has tuple declaration like follows:

TypeTuple!(int, int) f = 10;
assert(f[0] == 10);
assert(f[1] == 10);

But, alias this tuple is not expanded automatically:

TypeTuple!(int, string) f = tuple(10, "str");
assert(f[0] == 10);
assert(f[1] == "str");

And, built-in tuple also should allow on initializer:

TypeTuple!(int, string) f = TypeTuple!(10, "str");
assert(f[0] == 10);
assert(f[1] == "str");
Comment 1 bearophile_hugs 2011-07-23 06:10:30 UTC
(In reply to comment #0)
> D has tuple declaration like follows:
> 
> TypeTuple!(int, int) f = 10;
> assert(f[0] == 10);
> assert(f[1] == 10);

See bug 6367