mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
31 lines
851 B
Plaintext
31 lines
851 B
Plaintext
constructorOverloads7.ts(22,18): error TS2384: Overload signatures must all be ambient or non-ambient.
|
|
|
|
|
|
==== constructorOverloads7.ts (1 errors) ====
|
|
declare class Point
|
|
{
|
|
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) {
|
|
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.
|
|
|
|
function EF1(a,b) { return a+b; }
|
|
|