You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
staticint 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:
staticvarx;
leads to:
staticint x;
+ (int) x {
if (x == nil) x = ; // <-- invalid codereturn x;
}
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: