How I access outer types

Topics: General
Jul 17, 2013 at 3:45 PM
Supposing I have following code:
module F {
    class Array<T> {}
    
    function f(...p : Array<number>) {
        
    }
}
This code is incorrect because I use my Array and not the one from the library.
But it is impossible to access the global class.
Is there any possibility ?
Jul 17, 2013 at 3:48 PM
Don't call your class "Array".
Jul 17, 2013 at 5:14 PM
What if I use external JS library where it defines Array type ?:)
Anyway there should be a way to access global things.
Jul 18, 2013 at 9:55 AM
That would only be an issue if the external JS library defined the Array type in the same module/namepsace as your code, which seems unlikely.
Jul 18, 2013 at 4:35 PM
I think what NN is referring to is something similar to this issue: https://typescript.codeplex.com/workitem/1210

For now, it seems there is no way around it other than using any as a type and make typescript not bother with it.

We will have to wait for 1.0.