Consider:
function a() { a = null; }
Why can't a be assigned?
The spec seems quite restrictive here, but then function definitions behave quite strangely, so it is understandable. (That is, you can call them earlier in the source code than they are declared... strange!)
Only reference expressions can be assigned to, which are defined in Section 4 of the spec as:
... references are combinations of identifiers (section 4.3), parentheses (section 4.7), and property accesses (section 4.10).
and in 4.3,
An identifier expression that references a variable or parameter is classified as a reference. An identifier expression that references any other kind of entity is classified as a value (and therefore cannot be the target of an assignment).
So, you could change it from a function definition into a variable declaration, probably with little change to the rest of your code:
var foo = function() {
foo = null;
}
DestroyUniverse()function?solutionin the first place, because I didn't have aproblem. I just made an observation about TypeScript by accident and my curiosity was the only reason why I came here. If asking questions unbound to specific problems is a crime, then I beg your pardon.