Bug 1481 – add final on template function cause local variable be finaled

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-09-06T21:16:00Z
Last change time
2014-02-16T15:22:51Z
Keywords
rejects-valid
Assigned to
nobody
Creator
redsea

Comments

Comment #0 by redsea — 2007-09-06T21:16:24Z
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)(); }
Comment #1 by clugdbug — 2012-11-21T00:43:40Z
This is fixed in both D1 and D2. Part of an attribute bugfix I believe.