52 lines
1.2 KiB
Plaintext
52 lines
1.2 KiB
Plaintext
==== tests/cases/compiler/autoLift2.ts (10 errors) ====
|
|
class A
|
|
|
|
{
|
|
constructor() {
|
|
this.foo: any;
|
|
~
|
|
!!! error TS1005: ';' expected.
|
|
~~~
|
|
!!! error TS2339: Property 'foo' does not exist on type 'A'.
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'any'.
|
|
this.bar: any;
|
|
~
|
|
!!! error TS1005: ';' expected.
|
|
~~~
|
|
!!! error TS2339: Property 'bar' does not exist on type 'A'.
|
|
~~~
|
|
!!! error TS2304: Cannot find name 'any'.
|
|
}
|
|
|
|
|
|
baz() {
|
|
|
|
this.foo = "foo";
|
|
~~~
|
|
!!! error TS2339: Property 'foo' does not exist on type 'A'.
|
|
|
|
this.bar = "bar";
|
|
~~~
|
|
!!! error TS2339: Property 'bar' does not exist on type 'A'.
|
|
|
|
[1, 2].forEach((p) => this.foo);
|
|
~~~
|
|
!!! error TS2339: Property 'foo' does not exist on type 'A'.
|
|
|
|
[1, 2].forEach((p) => this.bar);
|
|
~~~
|
|
!!! error TS2339: Property 'bar' does not exist on type 'A'.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var a = new A();
|
|
|
|
a.baz();
|
|
|
|
|
|
|