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

21 lines
799 B
Plaintext

==== tests/cases/compiler/constructorOverloads4.ts (4 errors) ====
declare module M {
export class Function {
constructor(...args: string[]);
}
export function Function(...args: any[]): any;
~~~~~~~~
!!! error TS2300: Duplicate identifier 'Function'.
export function Function(...args: string[]): Function;
~~~~~~~~
!!! error TS2300: Duplicate identifier 'Function'.
}
(new M.Function("return 5"))();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
M.Function("yo");
~~~~~~~~~~~~~~~~
!!! error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'?