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


Walter Bright <bugzi...@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzi...@digitalmars.com
           Severity|critical                    |enhancement


--- Comment #15 from Walter Bright <bugzi...@digitalmars.com> 2012-04-24 
11:53:49 PDT ---
The compiler behavior here is obviously deliberate, so this isn't a bug but an
enhancement request.

'final' in Java for a variable means it is assigned once in the constructor,
and never again. The equivalent is achieved in D using 'const' and not
supplying an initializer.

'final' in D1 has similar semantics to Java.

The reason 'final' applied to fields in D2 is an error is so that the user
transferring code from D1 to D2 will be notified of changes required, rather
than silently breaking his code.

Silently breaking code is very, very bad. There are still a lot of D users who
are moving from D1 to D2, and while that's going on I don't think implementing
this is a good idea.

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

Reply via email to