[Issue 1102] New: switch case couldn't contain template member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 5 23:11:33 PDT 2007


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

           Summary: switch case couldn't contain template member
           Product: D
           Version: 1.010
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: davidl at 126.com


In my opinion, the following should be compilable:
enum type{
        a,
        b,
}
class myclass
{
        template XX(uint a, uint c)
        {
                uint XX(){ return (a*256+c);}
        }
        void testcase()
        {
                switch (cast(uint)type.a)
                {
                case XX!(cast(uint)type.a,cast(uint)type.b)():  /*emit me error
message: case must be a string or an integral constant, not (this.XX)()*/
                        break;
                }

        }
}
void main()
{

}


-- 



More information about the Digitalmars-d-bugs mailing list