mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
868 B
Plaintext
24 lines
868 B
Plaintext
constructorOverloads8.ts(2,5): error TS2392: Multiple constructor implementations are not allowed.
|
|
constructorOverloads8.ts(3,5): error TS2392: Multiple constructor implementations are not allowed.
|
|
|
|
|
|
==== constructorOverloads8.ts (2 errors) ====
|
|
class C {
|
|
constructor(x) { }
|
|
~~~~~~~~~~~
|
|
!!! error TS2392: Multiple constructor implementations are not allowed.
|
|
constructor(y, x) { } // illegal, 2 constructor implementations
|
|
~~~~~~~~~~~
|
|
!!! error TS2392: Multiple constructor implementations are not allowed.
|
|
}
|
|
|
|
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
|
|
} |