27 lines
1.2 KiB
Plaintext
27 lines
1.2 KiB
Plaintext
tests/cases/compiler/collisionThisExpressionAndLocalVarInMethod.ts(5,21): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
|
|
tests/cases/compiler/collisionThisExpressionAndLocalVarInMethod.ts(11,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
|
|
|
|
|
|
==== tests/cases/compiler/collisionThisExpressionAndLocalVarInMethod.ts (2 errors) ====
|
|
class a {
|
|
method1() {
|
|
return {
|
|
doStuff: (callback) => () => {
|
|
var _this = 2;
|
|
~~~~~
|
|
!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
|
|
return callback(this);
|
|
}
|
|
}
|
|
}
|
|
method2() {
|
|
var _this = 2;
|
|
~~~~~
|
|
!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
|
|
return {
|
|
doStuff: (callback) => () => {
|
|
return callback(this);
|
|
}
|
|
}
|
|
}
|
|
} |