http://d.puremagic.com/issues/show_bug.cgi?id=8632

           Summary: DMD accepts illegal template metaprogram
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-09-08 15:01:25 PDT ---
DMD 2.060:
template BrokenY(alias F){
    template BrokenY(A...){
        template Z(alias X){
            alias F!(X,A) Z;
        }
        alias Z!Z BrokenY;
    }
}
template AlmostFact(alias BrokenFact, int n){
    static if(n) enum AlmostFact = n*BrokenFact!(n-1);
    else enum AlmostFact=1;
}
alias BrokenY!AlmostFact BrokenFact;
pragma(msg, BrokenFact!3); // "36"

DMD accepts this code, but it is invalid. It seems to be some kind of lookup
problem. Consistently renaming one of the two BrokenFact aliases makes the
problem disappear.

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

Reply via email to