That is how the ECMAScript spec is designed. And TypeScript _should_ follow the spec.
I doubt that a strict interpretation requires that it does so before other modules are loaded.
I suggest that 'right there' , i.e. the execution context can be delayed until mods are loaded.
One could argue that all modules could be loaded before execution context.
In Java, for example, you do not have this problem and yet, in Java we would say the attribute is initialized 'right there' as well.
Obviously, when I say 'loaded' I don't mean 'executed'.
In any event, it's a problem.
I doubt that a strict interpretation requires that it does so before other modules are loaded.
I suggest that 'right there' , i.e. the execution context can be delayed until mods are loaded.
One could argue that all modules could be loaded before execution context.
In Java, for example, you do not have this problem and yet, in Java we would say the attribute is initialized 'right there' as well.
Obviously, when I say 'loaded' I don't mean 'executed'.
In any event, it's a problem.