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

24 lines
948 B
Plaintext
Raw Normal View History

2014-10-01 02:15:18 +02:00
tests/cases/compiler/constructorOverloads8.ts(2,5): error TS2392: Multiple constructor implementations are not allowed.
tests/cases/compiler/constructorOverloads8.ts(3,5): error TS2392: Multiple constructor implementations are not allowed.
2014-10-01 02:15:18 +02:00
==== tests/cases/compiler/constructorOverloads8.ts (2 errors) ====
2014-07-13 01:04:16 +02:00
class C {
constructor(x) { }
2014-10-01 02:15:18 +02:00
~~~~~~~~~~~~~~~~~~
!!! error TS2392: Multiple constructor implementations are not allowed.
2014-07-13 01:04:16 +02:00
constructor(y, x) { } // illegal, 2 constructor implementations
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2392: Multiple constructor implementations are not allowed.
2014-07-13 01:04:16 +02:00
}
class D {
constructor(x: number);
constructor(y: string); // legal, overload signatures for 1 implementation
constructor(x) { }
}
interface I {
new (x);
new (x, y); // legal, overload signatures for (presumably) 1 implementation
}