1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
tests/cases/compiler/noImplicitThisObjectLiterals.ts(2,8): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
tests/cases/compiler/noImplicitThisObjectLiterals.ts(4,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
tests/cases/compiler/noImplicitThisObjectLiterals.ts(7,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
==== tests/cases/compiler/noImplicitThisObjectLiterals.ts (3 errors) ====
let o = {
d: this, // error, this: any
~~~~
!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
m() {
return this.d.length; // error, this: any
~~~~
!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
},
f: function() {
return this.d.length; // error, this: any
~~~~
!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
}
}
|