15 lines
606 B
Plaintext
15 lines
606 B
Plaintext
==== tests/cases/compiler/parameterPropertyInConstructor2.ts (3 errors) ====
|
|
module mod {
|
|
class Customers {
|
|
constructor(public names: string);
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2394: Overload signature is not compatible with function implementation.
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
|
constructor(public names: string, public ages: number) {
|
|
~~~~~
|
|
!!! error TS2300: Duplicate identifier 'names'.
|
|
}
|
|
}
|
|
}
|
|
|