mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
28 lines
1.4 KiB
Plaintext
28 lines
1.4 KiB
Plaintext
constructorOverloadsWithDefaultValues.ts(2,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor.
|
|
constructorOverloadsWithDefaultValues.ts(3,17): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
|
constructorOverloadsWithDefaultValues.ts(9,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor.
|
|
constructorOverloadsWithDefaultValues.ts(10,17): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
|
|
|
|
|
==== constructorOverloadsWithDefaultValues.ts (4 errors) ====
|
|
class C {
|
|
foo: string;
|
|
~~~
|
|
!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor.
|
|
constructor(x = 1); // error
|
|
~~~~~
|
|
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
|
constructor() {
|
|
}
|
|
}
|
|
|
|
class D<T> {
|
|
foo: string;
|
|
~~~
|
|
!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor.
|
|
constructor(x = 1); // error
|
|
~~~~~
|
|
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
|
constructor() {
|
|
}
|
|
} |