Bug 12103 – TypeTuple loop variable as template alias argument doesn't work

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-07T14:41:00Z
Last change time
2014-02-16T14:26:43Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
peter.alexander.au
Blocks
8224

Comments

Comment #0 by peter.alexander.au — 2014-02-07T14:41:32Z
See this: template id(alias a) { alias id = a; } void main() { import std.typetuple; alias TypeTuple!(() => 0, () => 1) fs; foreach (i, f; fs) assert(id!f() == i, i.stringof); } In both iterations, id!f aliases ()=>0, so the assertion fails on the second iteration. Expected behaviour: id!f aliases ()=>1 on the second iteration, and passes the assertion.
Comment #1 by k.hara.pg — 2014-02-10T01:25:44Z
Comment #2 by github-bugzilla — 2014-02-16T10:16:52Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/77e3ea11637a4ac989139682252734ea0f2e6798 fix Issue 12103 - TypeTuple loop variable as template alias argument doesn't work https://github.com/D-Programming-Language/dmd/commit/78096898bac8cfb5e2fb8f18fd3b59b15322ed7c Merge pull request #3243 from 9rnsr/fix12103 Issue 12103 - TypeTuple loop variable as template alias argument doesn't work