www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1481


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



This is fixed in both D1 and D2. Part of an attribute bugfix I believe.

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