TypeScript/tests/baselines/reference/constructorOverloads4.errors.txt

30 lines
1.4 KiB
Text
Raw Normal View History

2014-10-01 02:15:18 +02:00
tests/cases/compiler/constructorOverloads4.ts(2,18): error TS2300: Duplicate identifier 'Function'.
2014-10-01 20:27:20 +02:00
tests/cases/compiler/constructorOverloads4.ts(5,21): error TS2300: Duplicate identifier 'Function'.
tests/cases/compiler/constructorOverloads4.ts(6,21): error TS2300: Duplicate identifier 'Function'.
tests/cases/compiler/constructorOverloads4.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/constructorOverloads4.ts(11,1): error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'?
2014-10-01 02:15:18 +02:00
==== tests/cases/compiler/constructorOverloads4.ts (5 errors) ====
2014-07-13 01:04:16 +02:00
declare module M {
export class Function {
2014-10-01 02:15:18 +02:00
~~~~~~~~
!!! error TS2300: Duplicate identifier 'Function'.
2014-07-13 01:04:16 +02:00
constructor(...args: string[]);
}
export function Function(...args: any[]): any;
2014-10-01 20:27:20 +02:00
~~~~~~~~
!!! error TS2300: Duplicate identifier 'Function'.
2014-07-13 01:04:16 +02:00
export function Function(...args: string[]): Function;
2014-10-01 20:27:20 +02:00
~~~~~~~~
!!! error TS2300: Duplicate identifier 'Function'.
2014-07-13 01:04:16 +02:00
}
(new M.Function("return 5"))();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
2014-07-13 01:04:16 +02:00
M.Function("yo");
~~~~~~~~~~~~~~~~
!!! error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'?
2014-07-13 01:04:16 +02:00