18 lines
646 B
Plaintext
18 lines
646 B
Plaintext
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorOverloadsWithDefaultValues.ts (2 errors) ====
|
|
class C {
|
|
foo: string;
|
|
constructor(x = 1); // error
|
|
~~~~~
|
|
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
|
constructor() {
|
|
}
|
|
}
|
|
|
|
class D<T> {
|
|
foo: string;
|
|
constructor(x = 1); // error
|
|
~~~~~
|
|
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
|
constructor() {
|
|
}
|
|
} |