Given code like
we get code like this:
static int x;
+ (int) x {
if (x == nil) x = 50;
return x;
}
This breaks badly for non-Dynamic types. Even for Dynamic types, it becomes impossible to set such a variable to null later on in the code, because on next access, it's reinitialized again. So these assignments should be done in a static initializer (#7).
Also, lack on an initialization value leads to bad code:
leads to:
static int x;
+ (int) x {
if (x == nil) x = ; // <-- invalid code
return x;
}
Given code like
we get code like this:
This breaks badly for non-Dynamic types. Even for Dynamic types, it becomes impossible to set such a variable to null later on in the code, because on next access, it's reinitialized again. So these assignments should be done in a static initializer (#7).
Also, lack on an initialization value leads to bad code:
leads to: