March 04, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5697

           Summary: Instantiation from typetuple of templates
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2011-03-04 09:50:53 PST ---
This D2 code compiles and runs with no errors (DMD 2.052):


template TypeTuple(TList...) {
    alias TList TypeTuple;
}
int foo(alias bar)() {
    return bar();
}
int spam() {
    return 1;
}
void main() {
    alias TypeTuple!(foo, foo) templates;
    alias templates[0] templates0; // OK
    assert(templates0!spam() == 1); // OK
}




But if I remove the alias, to merge the last two lines:

template TypeTuple(TList...) {
    alias TList TypeTuple;
}
int foo(alias bar)() {
    return bar();
}
int spam() {
    return 1;
}
void main() {
    alias TypeTuple!(foo, foo) templates;
    assert(templates[0]!spam() == 1); // line 12, error
}



It doesn't compile, with the errors:

test.d(12): found '!' when expecting ')'
test.d(12): found 'spam' when expecting ';' following statement
test.d(12): expression expected, not ')'


Some alternative ways to write this line don't seem to work:
templates[0]!spam()

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 08, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5697


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich@gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-08 15:28:59 PST ---
*** This issue has been marked as a duplicate of issue 6474 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------