[Issue 7724] 'final:' doesn't work
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Apr 21 07:29:36 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7724
Dejan Lekic <dejan.lekic at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dejan.lekic at gmail.com
--- Comment #4 from Dejan Lekic <dejan.lekic at gmail.com> 2012-04-21 07:30:33 PDT ---
This is not a bug - you can't use final with variables.
Examine following D2 code:
import std.stdio;
class Issue7724 {
/+--------------------------+
| Uncomment to get "...someValue final cannot be applied to variable" error.
final:
int someValue;
int setValue(int argValue) { someValue = argValue; }
int getValue() { return someValue; }
+--------------------------+/
// Correct:
int someValue;
final:
void setValue(int argValue) { someValue = argValue; }
int getValue() { return someValue; }
}
int main() {
return 0;
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list