TypeScript/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt
2014-09-11 16:11:08 -07:00

21 lines
1.3 KiB
Plaintext

==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (6 errors) ====
// array type cannot use typeof.
var x = 1;
var xs: typeof x[]; // Not an error. This is equivalent to Array<typeof x>
var xs2: typeof Array;
var xs3: typeof Array<number>;
~
!!! error TS1005: '=' expected.
~
!!! error TS1109: Expression expected.
~~~
!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }':
!!! error TS2322: Property 'isArray' is missing in type 'Number'.
var xs4: typeof Array<typeof x>;
~
!!! error TS1005: '=' expected.
~
!!! error TS1109: Expression expected.
~~~
!!! error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'.