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

37 lines
1.2 KiB
Plaintext
Raw Normal View History

2014-10-01 02:15:18 +02:00
tests/cases/compiler/constructorOverloads7.ts(1,15): error TS2300: Duplicate identifier 'Point'.
2014-10-01 20:27:20 +02:00
tests/cases/compiler/constructorOverloads7.ts(15,10): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/constructorOverloads7.ts(22,18): error TS2384: Overload signatures must all be ambient or non-ambient.
2014-10-01 02:15:18 +02:00
==== tests/cases/compiler/constructorOverloads7.ts (3 errors) ====
2014-07-13 01:04:16 +02:00
declare class Point
2014-10-01 02:15:18 +02:00
~~~~~
!!! error TS2300: Duplicate identifier 'Point'.
2014-07-13 01:04:16 +02:00
{
x: number;
y: number;
constructor(x: number, y: number);
add(dx: number, dy: number): Point;
origin: Point;
}
// Type provided by extern declaration
// Because Point is a constructor function, this is inferred
// to be Point and return type is inferred to be void
function Point(x, y) {
2014-10-01 20:27:20 +02:00
~~~~~
!!! error TS2300: Duplicate identifier 'Point'.
2014-07-13 01:04:16 +02:00
this.x = x;
this.y = y;
return this;
}
declare function EF1(a:number, b:number):number;
~~~
!!! error TS2384: Overload signatures must all be ambient or non-ambient.
2014-07-13 01:04:16 +02:00
function EF1(a,b) { return a+b; }