www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1481] New: add final on template function cause local variable be finaled

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

           Summary: add final on template function cause local variable be
                    finaled
           Product: D
           Version: 1.018
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: redsea 163.com


error message:
Error: cannot modify final variable 'p'

code:

module test;
import test1;

class C
{
   final void test(bool check)()
    {
        int p;
        p++;
    }
}

void main()
{
C c = new C;

c.test!(false)();
}


-- 
Sep 06 2007