Closed
Description
TypeScript Version: nightly (2.0.2)
In strictNullChecks mode only:
Code
const CONFIG = {
foo: '',
setFoo: function(foo: string) {
// accessing (reading or writing) CONFIG.foo is not allowed!
CONFIG.foo = foo; // <-- Error: Variable 'CONFIG' is used before being assigned.
}
};
Expected behavior:
I don't see why this is not a valid statement.
Actual behavior:
Trying to access any defined member of CONFIG
in a method, defined within the object itself, raises an error: Variable 'CONFIG' is used before being assigned.