If you move the definition of dayNames
before the self
declaration it compiles fine so it appears you're calling doSomething()
before dayNames
is defined.
Why this is the case, and why it doesn't generate a more helpful compiler error I'm not sure - I'd put that down to TypeScript still being alpha code. You may want to raise it as an issue on CodePlex.
I have noticed a few other instances like this. For example if you have one class which extends another in the same file, you need to put the base class first, otherwise the compiler sometimes falls over.