44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
==== tests/cases/compiler/bases.ts (10 errors) ====
|
|
interface I {
|
|
x;
|
|
}
|
|
|
|
class B {
|
|
constructor() {
|
|
this.y: any;
|
|
~
|
|
!!! error TS1005: ';' expected.
|
|
~
|
|
!!! error TS2339: Property 'y' does not exist on type 'B'.
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'any'.
|
|
}
|
|
}
|
|
|
|
class C extends B implements I {
|
|
~
|
|
!!! error TS2421: Class 'C' incorrectly implements interface 'I':
|
|
!!! error TS2421: Property 'x' is missing in type 'C'.
|
|
constructor() {
|
|
~~~~~~~~~~~~~~~
|
|
this.x: any;
|
|
~
|
|
!!! error TS1005: ';' expected.
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
~
|
|
!!! error TS2339: Property 'x' does not exist on type 'C'.
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'any'.
|
|
}
|
|
~~~~~
|
|
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
|
|
}
|
|
|
|
new C().x;
|
|
~
|
|
!!! error TS2339: Property 'x' does not exist on type 'C'.
|
|
new C().y;
|
|
~
|
|
!!! error TS2339: Property 'y' does not exist on type 'C'.
|
|
|
|
|