TypeScript/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.errors.txt
2014-09-12 13:35:07 -07:00

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);
}
}
}
}