Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.8.2
-
Fix Version/s: 0.9
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
Testcase:
class Test:
public static final X = 1
static def constructor():
X = 2
print Test.X #prints 1 ... or crash
static final with a literal initializer sets the IL flag 'literal'.
Two solutions:
1) forbidding assignment of static final field, even in static constructor
2) implicitely change IL flag to 'initonly' ... but it can be unwanted behavior
I'd take 1, objections?
edit: changed my mind to 2, it makes thing more consistent with the 'instance final' and non-literal types.
Fixed in rev. 3151